ImFusion SDK 4.3
ImFusion::Serialization Namespace Reference

Collection of utility functions for serialization and deserialization. More...

Detailed Description

Collection of utility functions for serialization and deserialization.

Functions

std::optional< ByteBufferdataToByteBuffer (const DataList &data)
 Serializes a DataList into a ByteBuffer for streaming and data transfer over a network.
 
std::optional< OwningDataListdataFromByteBuffer (const ByteBufferView &buffer)
 Deserializes a ByteBuffer with content generated via dataToByteBuffer() back to an OwningDataList.
 

Function Documentation

◆ dataToByteBuffer()

std::optional< ByteBuffer > dataToByteBuffer ( const DataList & data)

Serializes a DataList into a ByteBuffer for streaming and data transfer over a network.

Returns std::nullopt upon failure in serialization.

The current implementation uses the ImFusionFile format internally and supports custom data types if a corresponding ImFusionFilePlugin is registered. The function performs the inverse operation of dataFromByteBuffer().

Note
The content of the returned buffer must be consumed by the same version of the SDK. This function does not guarantee any future forward- or backward compatibility, as the internal implementation may change.

◆ dataFromByteBuffer()

std::optional< OwningDataList > dataFromByteBuffer ( const ByteBufferView & buffer)

Deserializes a ByteBuffer with content generated via dataToByteBuffer() back to an OwningDataList.

Returns std::nullopt upon failure in deserialization.

The current implementation uses the ImFusionFile format internally and supports custom data types if a corresponding ImFusionFilePlugin is registered. The function performs the inverse operation of dataToByteBuffer(const DataList& data).

Note
The content of buffer must be generated with the same version of the SDK. This function does not guarantee any future forward- or backward compatibility, as the internal implementation may change.
Search Tab / S to search, Esc to close