fpmas 1.5
Static Public Member Functions | List of all members
fpmas::io::datapack::LightSerializer< NodePtrWrapper< T > > Struct Template Reference

#include <distributed_node.h>

Static Public Member Functions

static std::size_t size (const LightObjectPack &p, const NodePtrWrapper< T > &node)
 
static void to_datapack (LightObjectPack &pack, const NodePtrWrapper< T > &node)
 
static NodePtrWrapper< T > from_datapack (const LightObjectPack &pack)
 

Detailed Description

template<typename T>
struct fpmas::io::datapack::LightSerializer< NodePtrWrapper< T > >

DistributedNode LightSerializer specialization, notably used to efficiently transmit DistributedEdge instances, where source and target node data are not required.

Only the id of the node is serialized, and also the light version of its data. The light serialization of the node data can eventually produce an empty BasicObjectPack, so that only the node id is serialized.

Serialization scheme
node->getId() node->data()

Member Function Documentation

◆ size()

template<typename T >
static std::size_t fpmas::io::datapack::LightSerializer< NodePtrWrapper< T > >::size ( const LightObjectPack p,
const NodePtrWrapper< T > &  node 
)
inlinestatic

Returns the buffer size required to serialize node into p, i.e. p.size<DistributedId>() + p.size(node->data()).

Notice that in this light version, p.size(node->data()) might be null.

◆ to_datapack()

template<typename T >
static void fpmas::io::datapack::LightSerializer< NodePtrWrapper< T > >::to_datapack ( LightObjectPack pack,
const NodePtrWrapper< T > &  node 
)
inlinestatic

DistributedNode LightObjectPack serialization.

Parameters
packdestination LightObjectPack
nodenode to serialize

◆ from_datapack()

template<typename T >
static NodePtrWrapper< T > fpmas::io::datapack::LightSerializer< NodePtrWrapper< T > >::from_datapack ( const LightObjectPack pack)
inlinestatic

DistributedNode LightObjectPack deserialization.

Parameters
packsource LightObjectPack
Returns
deserialized and dynamically allocated node

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