Classes | |
struct | serialboxMetainfoElementInfo_t |
Data-structure to query the info of the elements (keys and corresponding types) in the meta-information. More... | |
SERIALBOX_API serialboxMetainfo_t * | serialboxMetainfoCreate (void) |
Construct an empty meta-information. More... | |
SERIALBOX_API serialboxMetainfo_t * | serialboxMetainfoCreateFromMetainfo (const serialboxMetainfo_t *other) |
Copy construct the meta-information. More... | |
SERIALBOX_API void | serialboxMetainfoDestroy (serialboxMetainfo_t *metaInfo) |
Destroy the meta-information and deallocate all memory. More... | |
SERIALBOX_API int | serialboxMetainfoGetSize (const serialboxMetainfo_t *metaInfo) |
Get number of elemenets in the meta-information. More... | |
SERIALBOX_API int | serialboxMetainfoIsEmpty (const serialboxMetainfo_t *metaInfo) |
Check if meta information is empty. More... | |
SERIALBOX_API void | serialboxMetainfoClear (serialboxMetainfo_t *metaInfo) |
All the elements in the Metainfo are dropped: their destructors are called, and they are removed from the container, leaving it with a size of 0. More... | |
SERIALBOX_API int | serialboxMetainfoEqual (const serialboxMetainfo_t *m1, const serialboxMetainfo_t *m2) |
Check if Metainfo m1 is equal to Metainfo m2 More... | |
SERIALBOX_API int | serialboxMetainfoHasKey (const serialboxMetainfo_t *metaInfo, const char *key) |
Check if and element with key key exists. More... | |
SERIALBOX_API enum serialboxTypeID | serialboxMetainfoGetTypeIDOfKey (const serialboxMetainfo_t *metaInfo, const char *key) |
Get TypeID of element with key key More... | |
SERIALBOX_API char * | serialboxMetainfoToString (const serialboxMetainfo_t *metaInfo) |
Convert to string. More... | |
SERIALBOX_API serialboxMetainfoElementInfo_t * | serialboxMetainfoCreateElementInfo (const serialboxMetainfo_t *metaInfo) |
Allocate and intialize the element-info. More... | |
SERIALBOX_API void | serialboxMetainfoDestroyElementInfo (serialboxMetainfoElementInfo_t *elementInfo) |
Destroy the element-information and deallocate all memory. More... | |
SERIALBOX_API int | serialboxMetainfoDeleteKey (serialboxMetainfo_t *metaInfo, const char *key) |
Delete element given by key More... | |
SERIALBOX_API int | serialboxMetainfoAddBoolean (serialboxMetainfo_t *metaInfo, const char *key, serialboxBoolean_t value) |
Add a new element in the form key=value pair to the meta-information. More... | |
SERIALBOX_API int | serialboxMetainfoAddInt32 (serialboxMetainfo_t *metaInfo, const char *key, serialboxInt32_t value) |
SERIALBOX_API int | serialboxMetainfoAddInt64 (serialboxMetainfo_t *metaInfo, const char *key, serialboxInt64_t value) |
SERIALBOX_API int | serialboxMetainfoAddFloat32 (serialboxMetainfo_t *metaInfo, const char *key, serialboxFloat32_t value) |
SERIALBOX_API int | serialboxMetainfoAddFloat64 (serialboxMetainfo_t *metaInfo, const char *key, serialboxFloat64_t value) |
SERIALBOX_API int | serialboxMetainfoAddString (serialboxMetainfo_t *metaInfo, const char *key, const char *value) |
SERIALBOX_API int | serialboxMetainfoAddArrayOfBoolean (serialboxMetainfo_t *metaInfo, const char *key, const serialboxArrayOfBoolean_t *array) |
Add a new element in the form key=[array] to the meta-information. More... | |
SERIALBOX_API int | serialboxMetainfoAddArrayOfInt32 (serialboxMetainfo_t *metaInfo, const char *key, const serialboxArrayOfInt32_t *array) |
SERIALBOX_API int | serialboxMetainfoAddArrayOfInt64 (serialboxMetainfo_t *metaInfo, const char *key, const serialboxArrayOfInt64_t *array) |
SERIALBOX_API int | serialboxMetainfoAddArrayOfFloat32 (serialboxMetainfo_t *metaInfo, const char *key, const serialboxArrayOfFloat32_t *array) |
SERIALBOX_API int | serialboxMetainfoAddArrayOfFloat64 (serialboxMetainfo_t *metaInfo, const char *key, const serialboxArrayOfFloat64_t *array) |
SERIALBOX_API int | serialboxMetainfoAddArrayOfString (serialboxMetainfo_t *metaInfo, const char *key, const serialboxArrayOfString_t *array) |
SERIALBOX_API serialboxBoolean_t | serialboxMetainfoGetBoolean (const serialboxMetainfo_t *metaInfo, const char *key) |
Convert value of element with key key to type T (where T is given by the suffix of thefunction. More... | |
SERIALBOX_API serialboxInt32_t | serialboxMetainfoGetInt32 (const serialboxMetainfo_t *metaInfo, const char *key) |
SERIALBOX_API serialboxInt64_t | serialboxMetainfoGetInt64 (const serialboxMetainfo_t *metaInfo, const char *key) |
SERIALBOX_API serialboxFloat32_t | serialboxMetainfoGetFloat32 (const serialboxMetainfo_t *metaInfo, const char *key) |
SERIALBOX_API serialboxFloat64_t | serialboxMetainfoGetFloat64 (const serialboxMetainfo_t *metaInfo, const char *key) |
SERIALBOX_API serialboxString_t | serialboxMetainfoGetString (const serialboxMetainfo_t *metaInfo, const char *key) |
SERIALBOX_API serialboxArrayOfBoolean_t * | serialboxMetainfoGetArrayOfBoolean (const serialboxMetainfo_t *metaInfo, const char *key) |
Convert value of element with key key to a newly allocated array array of type T More... | |
SERIALBOX_API serialboxArrayOfInt32_t * | serialboxMetainfoGetArrayOfInt32 (const serialboxMetainfo_t *metaInfo, const char *key) |
SERIALBOX_API serialboxArrayOfInt64_t * | serialboxMetainfoGetArrayOfInt64 (const serialboxMetainfo_t *metaInfo, const char *key) |
SERIALBOX_API serialboxArrayOfFloat32_t * | serialboxMetainfoGetArrayOfFloat32 (const serialboxMetainfo_t *metaInfo, const char *key) |
SERIALBOX_API serialboxArrayOfFloat64_t * | serialboxMetainfoGetArrayOfFloat64 (const serialboxMetainfo_t *metaInfo, const char *key) |
SERIALBOX_API serialboxArrayOfString_t * | serialboxMetainfoGetArrayOfString (const serialboxMetainfo_t *metaInfo, const char *key) |
SERIALBOX_API int serialboxMetainfoAddArrayOfBoolean | ( | serialboxMetainfo_t * | metaInfo, |
const char * | key, | ||
const serialboxArrayOfBoolean_t * | array | ||
) |
Add a new element in the form key=[array] to the meta-information.
The element is inserted only if its key is not equivalent to the key of any other element already in the meta-information struct (i.e keys must be unique).
metaInfo | Meta-information to use |
key | Key of the new element |
array | Array to be copied to the value of the new element |
SERIALBOX_API int serialboxMetainfoAddBoolean | ( | serialboxMetainfo_t * | metaInfo, |
const char * | key, | ||
serialboxBoolean_t | value | ||
) |
Add a new element in the form key=value pair to the meta-information.
The element is inserted only if its key is not equivalent to the key of any other element already in the meta-information struct (i.e keys must be unique).
metaInfo | Meta-information to use |
key | Key of the new element |
value | Object to be copied to the value of the new element |
SERIALBOX_API void serialboxMetainfoClear | ( | serialboxMetainfo_t * | metaInfo | ) |
All the elements in the Metainfo are dropped: their destructors are called, and they are removed from the container, leaving it with a size of 0.
metaInfo | Meta-information to use |
Definition at line 75 of file Metainfo.cpp.
SERIALBOX_API serialboxMetainfo_t* serialboxMetainfoCreate | ( | void | ) |
Construct an empty meta-information.
Definition at line 25 of file Metainfo.cpp.
SERIALBOX_API serialboxMetainfoElementInfo_t* serialboxMetainfoCreateElementInfo | ( | const serialboxMetainfo_t * | metaInfo | ) |
Allocate and intialize the element-info.
To free the data-structure use serialboxMetainfoDestroyElementInfo
.
metaInfo | Meta-information to use |
serialboxMetainfoElementInfo_t
Definition at line 111 of file Metainfo.cpp.
SERIALBOX_API serialboxMetainfo_t* serialboxMetainfoCreateFromMetainfo | ( | const serialboxMetainfo_t * | other | ) |
Copy construct the meta-information.
other | Metainfo to copy from |
Definition at line 38 of file Metainfo.cpp.
SERIALBOX_API int serialboxMetainfoDeleteKey | ( | serialboxMetainfo_t * | metaInfo, |
const char * | key | ||
) |
Delete element given by key
metaInfo | Meta-information to use |
key | Key of element to delete |
Definition at line 148 of file Metainfo.cpp.
SERIALBOX_API void serialboxMetainfoDestroy | ( | serialboxMetainfo_t * | metaInfo | ) |
Destroy the meta-information and deallocate all memory.
metaInfo | Pointer to meta-information to use |
Definition at line 52 of file Metainfo.cpp.
SERIALBOX_API void serialboxMetainfoDestroyElementInfo | ( | serialboxMetainfoElementInfo_t * | elementInfo | ) |
Destroy the element-information and deallocate all memory.
elementInfo | Element-information to deallcate |
Definition at line 133 of file Metainfo.cpp.
SERIALBOX_API int serialboxMetainfoEqual | ( | const serialboxMetainfo_t * | m1, |
const serialboxMetainfo_t * | m2 | ||
) |
Check if Metainfo m1
is equal to Metainfo m2
m1 | First Metainfo to use |
m2 | Second Metainfo to use |
m1 == m2
, 0 otherwise Definition at line 80 of file Metainfo.cpp.
SERIALBOX_API serialboxArrayOfBoolean_t* serialboxMetainfoGetArrayOfBoolean | ( | const serialboxMetainfo_t * | metaInfo, |
const char * | key | ||
) |
Convert value of element with key key
to a newly allocated array array of type T
If the type T
of the elements is different than the internally stored type, the function does its best to convert the individual elements to T
in a meaningful way.
The allocated array should be freed using the corresponding serialboxArrayOfXDestroy
methods.
metaInfo | Meta-information to use |
key | Key of the element |
FatalError | Key key does not exist, conversion results in truncation of the value or conversions from primitive to array type |
SERIALBOX_API serialboxBoolean_t serialboxMetainfoGetBoolean | ( | const serialboxMetainfo_t * | metaInfo, |
const char * | key | ||
) |
Convert value of element with key key
to type T
(where T
is given by the suffix of thefunction.
If the type T
is different than the internally stored type, the function does its best to convert the value to T
in a meaningful way.
The string version will allocate a sufficiently large char
buffer (using malloc()) which needs be freed by the user using free().
metaInfo | Meta-information to use |
key | Key of the element |
T
FatalError | Key key does not exist, conversion results in truncation of the value |
SERIALBOX_API int serialboxMetainfoGetSize | ( | const serialboxMetainfo_t * | metaInfo | ) |
Get number of elemenets in the meta-information.
metaInfo | Meta-information to use |
Definition at line 65 of file Metainfo.cpp.
SERIALBOX_API enum serialboxTypeID serialboxMetainfoGetTypeIDOfKey | ( | const serialboxMetainfo_t * | metaInfo, |
const char * | key | ||
) |
Get TypeID of element with key key
metaInfo | Meta-information to use |
key | Key used for lookup |
Definition at line 91 of file Metainfo.cpp.
SERIALBOX_API int serialboxMetainfoHasKey | ( | const serialboxMetainfo_t * | metaInfo, |
const char * | key | ||
) |
Check if and element with key key
exists.
metaInfo | Meta-information to use |
key | Key to be searched for |
Definition at line 86 of file Metainfo.cpp.
SERIALBOX_API int serialboxMetainfoIsEmpty | ( | const serialboxMetainfo_t * | metaInfo | ) |
Check if meta information is empty.
metaInfo | Meta-information to use |
Definition at line 70 of file Metainfo.cpp.
SERIALBOX_API char* serialboxMetainfoToString | ( | const serialboxMetainfo_t * | metaInfo | ) |
Convert to string.
The function will allocate a sufficiently large char
buffer (using malloc()) which needs be freed by the user using free().
metaInfo | Meta-information to use |
Definition at line 103 of file Metainfo.cpp.