A non-POD type which wishes to mark itself byte representable should extend this class. More...
#include <SerializationSupport.hpp>
Public Member Functions | |
virtual std::size_t | to_bytes (char *v) const =0 |
Write this class's marshalled representation into the array found at v. More... | |
virtual void | post_object (const std::function< void(char const *const, std::size_t)> &) const =0 |
Pass a pointer to a buffer containing this class's marshalled representation into the function f. More... | |
virtual std::size_t | bytes_size () const =0 |
the size of the marshalled representation of this object. More... | |
virtual | ~ByteRepresentable () |
A non-POD type which wishes to mark itself byte representable should extend this class.
Intended to use to convert classes to and from contiguous sequences of bytes.
Definition at line 24 of file SerializationSupport.hpp.
|
inlinevirtual |
Definition at line 68 of file SerializationSupport.hpp.
|
pure virtual |
the size of the marshalled representation of this object.
useful when allocating arrays in which to store this object.
NOTE: it is recommended that users not call this directly, and prefer to use mutils::bytes_size(T,v) instead.
Implemented in persistent::Persistent< ObjectType, storageType >, persistent::Persistent< ObjectType, ST_MEM >, persistent::Persistent< objectstore::DeltaObjectStoreCore >, mutils::marshalled, VariableBytes, objectstore::Blob, and mutils::Bytes.
|
pure virtual |
Pass a pointer to a buffer containing this class's marshalled representation into the function f.
This pointer is not guaranteed to live beyond the duration of the call to f, so make a copy if you need to keep it around.
NOTE: it is recommended that users not call this directly, and prefer to use mutils::post_object(f,T) instead.
Implemented in persistent::Persistent< ObjectType, storageType >, persistent::Persistent< ObjectType, ST_MEM >, persistent::Persistent< objectstore::DeltaObjectStoreCore >, objectstore::Blob, VariableBytes, and mutils::Bytes.
|
pure virtual |
Write this class's marshalled representation into the array found at v.
assume v has at least bytes_size() of free memory available; behavior is undefined otherwise.
Returns number of bytes written, which should be the same as bytes_size().
NOTE: it is recommended that users not call this directly, and prefer to use mutils::to_bytes(T,v) instead.
Implemented in persistent::Persistent< ObjectType, storageType >, persistent::Persistent< ObjectType, ST_MEM >, persistent::Persistent< objectstore::DeltaObjectStoreCore >, mutils::marshalled, objectstore::Blob, VariableBytes, and mutils::Bytes.