Defines the serialization API of the global egomotion module.
The typical use case of the serialization API is transmission of the state history across process and/or machine boundaries. The state is transmitted as a variable-size array of state elements and combined into a full state on deserialization.
Example:
Typedefs | |
| typedef struct dwGlobalEgomotionSerializer * | dwGlobalEgomotionSerializerHandle_t |
| Mutable handle to a global egomotion serializer. More... | |
| typedef struct dwGlobalEgomotionSerializer const * | dwGlobalEgomotionSerializerConstHandle_t |
| Const handle to a global egomotion serializer. More... | |
| typedef struct dwGlobalEgomotionDeserializer * | dwGlobalEgomotionDeserializerHandle_t |
| Mutable handle to a global egomotion deserializer. More... | |
| typedef struct dwGlobalEgomotionDeserializer const * | dwGlobalEgomotionDeserializerConstHandle_t |
| Const handle to a global egomotion deserializer. More... | |
Functions | |
| DW_API_PUBLIC dwStatus | dwGlobalEgomotion_initializeDeserializer (dwGlobalEgomotionHandle_t *handle, size_t historySize, dwContextHandle_t ctx) |
| Initializes a global egomotion deserializer object. More... | |
| DW_API_PUBLIC dwStatus | dwGlobalEgomotion_serialize (dwGlobalEgomotionStateElement *buffer, size_t *bufferSize, size_t const bufferCapacity, dwGlobalEgomotionHandle_t handle) |
| Serialize the global egomotion state history out into the provided buffer. More... | |
| DW_API_PUBLIC dwStatus | dwGlobalEgomotion_deserialize (dwGlobalEgomotionStateElement const *buffer, size_t bufferSize, dwGlobalEgomotionHandle_t handle) |
| Deserialize the global egomotion state history from the provided buffer. More... | |
| typedef struct dwGlobalEgomotionDeserializer const* dwGlobalEgomotionDeserializerConstHandle_t |
Const handle to a global egomotion deserializer.
Definition at line 93 of file GlobalEgomotionSerialization.h.
| typedef struct dwGlobalEgomotionDeserializer* dwGlobalEgomotionDeserializerHandle_t |
Mutable handle to a global egomotion deserializer.
Definition at line 91 of file GlobalEgomotionSerialization.h.
| typedef struct dwGlobalEgomotionSerializer const* dwGlobalEgomotionSerializerConstHandle_t |
Const handle to a global egomotion serializer.
Definition at line 88 of file GlobalEgomotionSerialization.h.
| typedef struct dwGlobalEgomotionSerializer* dwGlobalEgomotionSerializerHandle_t |
Mutable handle to a global egomotion serializer.
Definition at line 86 of file GlobalEgomotionSerialization.h.
| DW_API_PUBLIC dwStatus dwGlobalEgomotion_deserialize | ( | dwGlobalEgomotionStateElement const * | buffer, |
| size_t | bufferSize, | ||
| dwGlobalEgomotionHandle_t | handle | ||
| ) |
Deserialize the global egomotion state history from the provided buffer.
This call replaces any existing state history.
| [in] | buffer | Buffer containing serialized state history. |
| [in] | bufferSize | Number of elements in buffer. |
| [in] | handle | Handle of a global egomotion object storing the deserialized history. |
buffer is nullptr or the data is invalid. buffer has been deserialized into corresponding global egomotion object.| DW_API_PUBLIC dwStatus dwGlobalEgomotion_initializeDeserializer | ( | dwGlobalEgomotionHandle_t * | handle, |
| size_t | historySize, | ||
| dwContextHandle_t | ctx | ||
| ) |
Initializes a global egomotion deserializer object.
This object does not support the dwGlobalEgomotion_addRelativeMotion, dwGlobalEgomotion_addRelativeMotionState and dwGlobalEgomotion_addGPSMeasurement APIs.
The deserializer is released with dwGlobalEgomotion_release.
| [out] | handle | A pointer to the handle for the created deserializer object. |
| [in] | historySize | Size of the internal history, |
| [in] | ctx | Handle of the context under which the objects are created. |
| DW_API_PUBLIC dwStatus dwGlobalEgomotion_serialize | ( | dwGlobalEgomotionStateElement * | buffer, |
| size_t * | bufferSize, | ||
| size_t const | bufferCapacity, | ||
| dwGlobalEgomotionHandle_t | handle | ||
| ) |
Serialize the global egomotion state history out into the provided buffer.
Fills out the provided buffer with the current global egomotion state history. The most recent state history is serialized, up to the buffer capacity. Filling order is oldest to most recent state history element.
Provide a buffer with capacity larger or equal to the historySize parameter of the global egomotion module to be serialized in order to ensure the full state history can be stored. If the buffer capacity is too low to fit the state history, the buffer is filled with the latest history elements that fit.
| [out] | buffer | Buffer containing serialized state history. |
| [out] | bufferSize | Number of elements written to buffer. |
| [in] | bufferCapacity | Capacity of buffer in number of elements. |
| [in] | handle | Handle of a global egomotion object from which to serialize data. |
buffer or bufferSize is nullptr. buffer has been filled with state history.