ttg_data_descriptor Struct Reference

Documentation

This provides an efficient C API for serializing/deserializing a data type to a nonportable contiguous bytestring. An object of this type will need to be provided for each serializable type. The default implementation, in serialization.h, works only for primitive/POD data types; backend-specific implementations may be available in backend/serialization.h .

Definition at line 22 of file data_descriptor.h.

Public Attributes

const char * name
 
uint64_t(* payload_size )(const void *object)
 measures the size of the binary representation of object More...
 
uint64_t(* pack_payload )(const void *object, uint64_t max_nbytes_to_write, uint64_t offset, void *buf)
 serializes object to a buffer More...
 
uint64_t(* unpack_payload )(void *object, uint64_t max_nbytes_to_read, uint64_t offset, const void *buf)
 deserializes object from a buffer More...
 
void(* print )(const void *object)
 

Member Data Documentation

◆ name

const char* ttg_data_descriptor::name

Definition at line 23 of file data_descriptor.h.

◆ pack_payload

uint64_t(* ttg_data_descriptor::pack_payload) (const void *object, uint64_t max_nbytes_to_write, uint64_t offset, void *buf)

serializes object to a buffer

Parameters
[in]objectpointer to the object to be serialized
[in]max_nbytes_to_writethe maximum number of bytes to write
[in]offsetthe position in buf where the first byte of serialized data will be written
[in,out]bufthe data buffer that will contain the serialized representation of the object
Returns
position in buf after the last byte written

Definition at line 36 of file data_descriptor.h.

◆ payload_size

uint64_t(* ttg_data_descriptor::payload_size) (const void *object)

measures the size of the binary representation of object

Parameters
[in]objectpointer to the object to be serialized
Returns
the number of bytes needed for binary representation of object

Definition at line 28 of file data_descriptor.h.

◆ print

void(* ttg_data_descriptor::print) (const void *object)

Definition at line 46 of file data_descriptor.h.

◆ unpack_payload

uint64_t(* ttg_data_descriptor::unpack_payload) (void *object, uint64_t max_nbytes_to_read, uint64_t offset, const void *buf)

deserializes object from a buffer

Parameters
[in]objectpointer to the object to be deserialized
[in]max_nbytes_to_readthe maximum number of bytes to read
[in]offsetthe position in buf where the first byte of serialized data will be read
[in]bufthe data buffer that contains the serialized representation of the object
Returns
position in buf after the last byte read

Definition at line 44 of file data_descriptor.h.


The documentation for this struct was generated from the following file: