Next: serialiser operations, Up: serialiser [Contents][Index]
serialiser trait: type definitionsType of the serialiser trait. Instances of this type are meant to be handed by value
to function calls.
Type of methods table for the serialiser trait. It has the following fields:
ccname_trait_method_type(ccstructs_serialiser_T, required_size) * required_sizePointer to function implementing the required_size() method.
ccname_trait_method_type(ccstructs_serialiser_T, write) * writePointer to function implementing the write() method.
Type of functions implementing the required_size() method. Return the minimum number of
bytes needed to hold the serialisation of the source struct; we should use the returned number to
allocate a block of memory for the serialisation operation; it is possible that the actual
serialisation will consume less memory.
Type of functions implementing the write() method. Serialise the struct to the block of
memory referenced by B, which must be big enough to hold the number of bytes returned by the
method required_size().
When successful: return a new block referencing the leftover memory right after the serialised data. If an error occurs: raise an exception violation by performing a non–local exit to L; in this case there is no way to know the state of the data written on the output block B.
memory block described by B |-------------------------------------| |++++++++++++++++++++++++|------------| memory filled with leftover struct serialisation memory
Next: serialiser operations, Up: serialiser [Contents][Index]
This document describes version 0.3.0-devel.3 of CCStructs.