Ocean
|
This class implements utility functions for input and output operations. More...
Public Types | |
typedef std::vector< uint8_t > | Buffer |
Definition of a vector holding 8 bit elements. More... | |
Static Public Member Functions | |
static bool | readFile (const std::string &filename, Buffer &buffer) |
Reads a file and copies the data into a buffer. More... | |
static void | encodeHomogenousMatrix4 (const HomogenousMatrix4 &matrix, Buffer &buffer) |
Encodes a 4x4 homogeneous matrix. More... | |
static Buffer | encodeHomogenousMatrix4 (const HomogenousMatrix4 &matrix, const size_t reservedHeaderSize=0) |
Encodes a 4x4 homogeneous matrix. More... | |
static bool | decodeHomogenousMatrix4 (const uint8_t *&data, size_t &size, HomogenousMatrix4 &matrix) |
Decodes a 4x4 homogeneous matrix. More... | |
static bool | decodeHomogenousMatrix4 (const Buffer &buffer, HomogenousMatrix4 &matrix) |
Decodes a 4x4 homogeneous matrix. More... | |
static void | encodeVectors2 (const Vector2 *vectors, const size_t size, Buffer &buffer) |
Encodes a set of given 2D vectors. More... | |
static Buffer | encodeVectors2 (const Vector2 *vectors, const size_t size, const size_t reservedHeaderSize=0) |
Encodes a set of given 2D vectors. More... | |
static bool | decodeVectors2 (const uint8_t *&data, size_t &size, Vectors2 &vectors) |
Decodes a set of 2D vectors. More... | |
static bool | decodeVectors2 (const Buffer &buffer, Vectors2 &vectors) |
Decodes a set of 2D vectors. More... | |
static void | encodeVectors3 (const Vector3 *vectors, const size_t size, Buffer &buffer) |
Encodes a set of given 3D vectors. More... | |
static Buffer | encodeVectors3 (const Vector3 *vectors, const size_t size, const size_t reservedHeaderSize=0) |
Encodes a set of given 3D vectors. More... | |
static bool | decodeVectors3 (const uint8_t *&data, size_t &size, Vectors3 &vectors) |
Decodes a set of 3D vectors. More... | |
static bool | decodeVectors3 (const Buffer &buffer, Vectors3 &vectors) |
Decodes a set of 3D vectors. More... | |
static void | encodeVectors4 (const Vector4 *vectors, const size_t size, Buffer &buffer) |
Encodes a set of given 4D vectors. More... | |
static Buffer | encodeVectors4 (const Vector4 *vectors, const size_t size, const size_t reservedHeaderSize=0) |
Encodes a set of given 4D vectors. More... | |
static bool | decodeVectors4 (const uint8_t *&data, size_t &size, Vectors4 &vectors) |
Decodes a set of 4D vectors. More... | |
static bool | decodeVectors4 (const Buffer &buffer, Vectors4 &vectors) |
Decodes a set of 4D vectors. More... | |
This class implements utility functions for input and output operations.
typedef std::vector<uint8_t> Ocean::IO::Utilities::Buffer |
Definition of a vector holding 8 bit elements.
|
inlinestatic |
Decodes a 4x4 homogeneous matrix.
The buffer must provide the matrix with 64 bit precision.
buffer | The buffer providing the matrix data |
matrix | The resulting matrix |
|
static |
Decodes a 4x4 homogeneous matrix.
The buffer must provide the matrix with 64 bit precision.
data | The pointer to the buffer providing the matrix data, will be shifted by the number of consumed bytes afterwards |
size | The size of the entire buffer, will be reduced by the number of consumed bytes afterwards |
matrix | The resulting matrix |
|
inlinestatic |
Decodes a set of 2D vectors.
The buffer must provide the vectors with 64 bit precision.
buffer | The buffer providing the 2D vectors |
vectors | The resulting vectors |
|
static |
Decodes a set of 2D vectors.
The buffer must provide the vectors with 64 bit precision.
data | The pointer to the buffer providing the 2D vectors, will be shifted by the number of consumed bytes afterwards |
size | The size of the entire buffer, will be reduced by the number of consumed bytes afterwards |
vectors | The resulting vectors |
|
inlinestatic |
Decodes a set of 3D vectors.
The buffer must provide the vectors with 64 bit precision.
buffer | The buffer providing the 3D vectors |
vectors | The resulting vectors |
|
static |
Decodes a set of 3D vectors.
The buffer must provide the vectors with 64 bit precision.
data | The pointer to the buffer providing the 3D vectors, will be shifted by the number of consumed bytes afterwards |
size | The size of the entire buffer, will be reduced by the number of consumed bytes afterwards |
vectors | The resulting vectors |
|
inlinestatic |
Decodes a set of 4D vectors.
The buffer must provide the vectors with 64 bit precision.
buffer | The buffer providing the 4D vectors |
vectors | The resulting vectors |
|
static |
Decodes a set of 4D vectors.
The buffer must provide the vectors with 64 bit precision.
data | The pointer to the buffer providing the 4D vectors, will be shifted by the number of consumed bytes afterwards |
size | The size of the entire buffer, will be reduced by the number of consumed bytes afterwards |
vectors | The resulting vectors |
|
static |
Encodes a 4x4 homogeneous matrix.
The matrix will be stored with 64 bit precision.
matrix | The homogeneous matrix which will be encoded |
buffer | The resulting buffer which will be extended so that already existing data stays untouched |
|
inlinestatic |
Encodes a 4x4 homogeneous matrix.
The matrix will be stored with 64 bit precision.
matrix | The homogeneous matrix which will be encoded |
reservedHeaderSize | The number of bytes which will be reserved for an optional header, so that the resulting buffer has a header followed by the payload data |
|
static |
Encodes a set of given 2D vectors.
The vectors will be stored with 64 bit precision.
vectors | The vectors to encode |
size | The number of given vectors |
buffer | The resulting buffer which will be extended so that already existing data stays untouched |
|
inlinestatic |
Encodes a set of given 2D vectors.
The vectors will be stored with 64 bit precision.
vectors | The vectors to encode |
size | The number of given vectors |
reservedHeaderSize | The number of bytes which will be reserved for an optional header, so that the resulting buffer has a header followed by the payload data |
|
static |
Encodes a set of given 3D vectors.
The vectors will be stored with 64 bit precision.
vectors | The vectors to encode |
size | The number of given vectors |
buffer | The resulting buffer which will be extended so that already existing data stays untouched |
|
inlinestatic |
Encodes a set of given 3D vectors.
The vectors will be stored with 64 bit precision.
vectors | The vectors to encode |
size | The number of given vectors |
reservedHeaderSize | The number of bytes which will be reserved for an optional header, so that the resulting buffer has a header followed by the payload data |
|
static |
Encodes a set of given 4D vectors.
The vectors will be stored with 64 bit precision.
vectors | The vectors to encode |
size | The number of given vectors |
buffer | The resulting buffer which will be extended so that already existing data stays untouched |
|
inlinestatic |
Encodes a set of given 4D vectors.
The vectors will be stored with 64 bit precision.
vectors | The vectors to encode |
size | The number of given vectors |
reservedHeaderSize | The number of bytes which will be reserved for an optional header, so that the resulting buffer has a header followed by the payload data |
|
static |
Reads a file and copies the data into a buffer.
In case the file exists but is empty, the resulting buffer will be empty but the function succeeds.
filename | The name of the file from which the data will be read, must be valid |
buffer | The buffer receiving the data |