ug4
ug::GridDataSerializationHandler Class Reference

Serialization of data associated with grid elements. More...

#include <serialization.h>

Public Member Functions

void deserialization_done ()
 
void deserialization_starts ()
 
void deserialize (BinaryBuffer &in, GridObjectCollection goc)
 Calls deserialize on all elements in the given geometric object collection. More...
 
template<class TIterator >
void deserialize (BinaryBuffer &in, TIterator begin, TIterator end)
 Calls deserialize on all elements between begin and end. More...
 
void read_infos (BinaryBuffer &in)
 calls read_info on all registered serializers More...
 
void serialize (BinaryBuffer &out, GridObjectCollection goc) const
 Calls serialize on all elements in the given geometric object collection. More...
 
template<class TIterator >
void serialize (BinaryBuffer &out, TIterator begin, TIterator end) const
 Calls serialize on all elements between begin and end. More...
 
void write_infos (BinaryBuffer &out) const
 calls write_info on all registered serializers More...
 
 ~GridDataSerializationHandler ()
 
void add (SPVertexDataSerializer cb)
 Adds a callback class for serialization and deserialization. More...
 
void add (SPEdgeDataSerializer cb)
 Adds a callback class for serialization and deserialization. More...
 
void add (SPFaceDataSerializer cb)
 Adds a callback class for serialization and deserialization. More...
 
void add (SPVolumeDataSerializer cb)
 Adds a callback class for serialization and deserialization. More...
 
void add (SPGridDataSerializer cb)
 Adds a callback class for serialization and deserialization. More...
 
void serialize (BinaryBuffer &out, Vertex *vrt) const
 Serializes data associated with the given object. More...
 
void serialize (BinaryBuffer &out, Edge *edge) const
 Serializes data associated with the given object. More...
 
void serialize (BinaryBuffer &out, Face *face) const
 Serializes data associated with the given object. More...
 
void serialize (BinaryBuffer &out, Volume *vol) const
 Serializes data associated with the given object. More...
 
void deserialize (BinaryBuffer &in, Vertex *vrt)
 Deserializes data associated with the given object. More...
 
void deserialize (BinaryBuffer &in, Edge *edge)
 Deserializes data associated with the given object. More...
 
void deserialize (BinaryBuffer &in, Face *face)
 Deserializes data associated with the given object. More...
 
void deserialize (BinaryBuffer &in, Volume *vol)
 Deserializes data associated with the given object. More...
 

Private Member Functions

template<class TSerializers >
void deserialization_done (TSerializers &serializers)
 
template<class TSerializers >
void deserialization_starts (TSerializers &serializers)
 
template<class TGeomObj , class TDeserializers >
void deserialize (BinaryBuffer &in, TGeomObj *o, TDeserializers &deserializers)
 performs deserialization on all given deserializers. More...
 
template<class TSerializers >
void read_info (BinaryBuffer &in, TSerializers &serializers)
 
template<class TGeomObj , class TSerializers >
void serialize (BinaryBuffer &out, TGeomObj *o, TSerializers &serializers) const
 performs serialization on all given serializers. More...
 
template<class TSerializers >
void write_info (BinaryBuffer &out, TSerializers &serializers) const
 

Private Attributes

std::vector< SPEdgeDataSerializerm_edgeSerializers
 
std::vector< SPFaceDataSerializerm_faceSerializers
 
std::vector< SPGridDataSerializerm_gridSerializers
 
std::vector< SPVolumeDataSerializerm_volSerializers
 
std::vector< SPVertexDataSerializerm_vrtSerializers
 

Detailed Description

Serialization of data associated with grid elements.

Through the add-method callback-classes can be registered, which will be called during serialization and deserialization to write data associated with the given elements into a binary stream.

Note when data for a given object-type not only registered callback classes for the type are called, but also registered instances of GridDataSerializer.

Note that this class performs both serialization and deserialization.

If you call the deserialize method directly, make sure to also call deserialization_done after your last call to deserialize for a given dezerialization.

Constructor & Destructor Documentation

◆ ~GridDataSerializationHandler()

ug::GridDataSerializationHandler::~GridDataSerializationHandler ( )
inline

Member Function Documentation

◆ add() [1/5]

void ug::GridDataSerializationHandler::add ( SPEdgeDataSerializer  cb)

Adds a callback class for serialization and deserialization.

◆ add() [2/5]

void ug::GridDataSerializationHandler::add ( SPFaceDataSerializer  cb)

Adds a callback class for serialization and deserialization.

◆ add() [3/5]

void ug::GridDataSerializationHandler::add ( SPGridDataSerializer  cb)

Adds a callback class for serialization and deserialization.

◆ add() [4/5]

◆ add() [5/5]

void ug::GridDataSerializationHandler::add ( SPVolumeDataSerializer  cb)

Adds a callback class for serialization and deserialization.

◆ deserialization_done() [1/2]

void ug::GridDataSerializationHandler::deserialization_done ( )

this method will be called after deserialize was called for the last time in a deserialization run.

Referenced by ug::DistributeGrid().

◆ deserialization_done() [2/2]

template<class TSerializers >
void ug::GridDataSerializationHandler::deserialization_done ( TSerializers &  serializers)
private

◆ deserialization_starts() [1/2]

void ug::GridDataSerializationHandler::deserialization_starts ( )

this method will be called before read_infos is called for the first time in a deserialization run.

Referenced by ug::DistributeGrid().

◆ deserialization_starts() [2/2]

template<class TSerializers >
void ug::GridDataSerializationHandler::deserialization_starts ( TSerializers &  serializers)
private

◆ deserialize() [1/7]

void ug::GridDataSerializationHandler::deserialize ( BinaryBuffer in,
Edge edge 
)
inline

Deserializes data associated with the given object.

References deserialize(), m_edgeSerializers, and m_gridSerializers.

◆ deserialize() [2/7]

void ug::GridDataSerializationHandler::deserialize ( BinaryBuffer in,
Face face 
)
inline

Deserializes data associated with the given object.

References deserialize(), m_faceSerializers, and m_gridSerializers.

◆ deserialize() [3/7]

void ug::GridDataSerializationHandler::deserialize ( BinaryBuffer in,
GridObjectCollection  goc 
)

Calls deserialize on all elements in the given geometric object collection.

References ug::GridObjectCollection::begin(), ug::GridObjectCollection::end(), and ug::GridObjectCollection::num_levels().

◆ deserialize() [4/7]

template<class TGeomObj , class TDeserializers >
void ug::GridDataSerializationHandler::deserialize ( BinaryBuffer in,
TGeomObj *  o,
TDeserializers &  deserializers 
)
private

performs deserialization on all given deserializers.

◆ deserialize() [5/7]

template<class TIterator >
void ug::GridDataSerializationHandler::deserialize ( BinaryBuffer in,
TIterator  begin,
TIterator  end 
)

Calls deserialize on all elements between begin and end.

Make sure that TIterator::value_type is compatible with either Vertex*, Edge*, Face*, Volume*.

References deserialize().

◆ deserialize() [6/7]

void ug::GridDataSerializationHandler::deserialize ( BinaryBuffer in,
Vertex vrt 
)
inline

Deserializes data associated with the given object.

References m_gridSerializers, and m_vrtSerializers.

Referenced by ug::AllGatherGrid(), ug::BroadcastGrid(), deserialize(), ug::DistributeGrid(), and ug::GatherGrid().

◆ deserialize() [7/7]

void ug::GridDataSerializationHandler::deserialize ( BinaryBuffer in,
Volume vol 
)
inline

Deserializes data associated with the given object.

References deserialize(), m_gridSerializers, and m_volSerializers.

◆ read_info()

template<class TSerializers >
void ug::GridDataSerializationHandler::read_info ( BinaryBuffer in,
TSerializers &  serializers 
)
private

◆ read_infos()

void ug::GridDataSerializationHandler::read_infos ( BinaryBuffer in)

calls read_info on all registered serializers

Referenced by ug::AllGatherGrid(), ug::BroadcastGrid(), ug::DistributeGrid(), and ug::GatherGrid().

◆ serialize() [1/7]

void ug::GridDataSerializationHandler::serialize ( BinaryBuffer out,
Edge edge 
) const
inline

Serializes data associated with the given object.

References m_edgeSerializers, m_gridSerializers, and serialize().

◆ serialize() [2/7]

void ug::GridDataSerializationHandler::serialize ( BinaryBuffer out,
Face face 
) const
inline

Serializes data associated with the given object.

References m_faceSerializers, m_gridSerializers, and serialize().

◆ serialize() [3/7]

void ug::GridDataSerializationHandler::serialize ( BinaryBuffer out,
GridObjectCollection  goc 
) const

Calls serialize on all elements in the given geometric object collection.

References ug::GridObjectCollection::begin(), ug::GridObjectCollection::end(), ug::GridObjectCollection::num_levels(), and boost::serialization::serialize().

◆ serialize() [4/7]

template<class TGeomObj , class TSerializers >
void ug::GridDataSerializationHandler::serialize ( BinaryBuffer out,
TGeomObj *  o,
TSerializers &  serializers 
) const
private

performs serialization on all given serializers.

◆ serialize() [5/7]

template<class TIterator >
void ug::GridDataSerializationHandler::serialize ( BinaryBuffer out,
TIterator  begin,
TIterator  end 
) const

Calls serialize on all elements between begin and end.

Make sure that TIterator::value_type is compatible with either Vertex*, Edge*, Face*, Volume*.

References serialize().

◆ serialize() [6/7]

void ug::GridDataSerializationHandler::serialize ( BinaryBuffer out,
Vertex vrt 
) const
inline

Serializes data associated with the given object.

References m_gridSerializers, and m_vrtSerializers.

Referenced by ug::AllGatherGrid(), ug::BroadcastGrid(), ug::DistributeGrid(), ug::GatherGrid(), and serialize().

◆ serialize() [7/7]

void ug::GridDataSerializationHandler::serialize ( BinaryBuffer out,
Volume vol 
) const
inline

Serializes data associated with the given object.

References m_gridSerializers, m_volSerializers, and serialize().

◆ write_info()

template<class TSerializers >
void ug::GridDataSerializationHandler::write_info ( BinaryBuffer out,
TSerializers &  serializers 
) const
private

◆ write_infos()

void ug::GridDataSerializationHandler::write_infos ( BinaryBuffer out) const

calls write_info on all registered serializers

Referenced by ug::AllGatherGrid(), ug::BroadcastGrid(), ug::DistributeGrid(), and ug::GatherGrid().

Member Data Documentation

◆ m_edgeSerializers

std::vector<SPEdgeDataSerializer> ug::GridDataSerializationHandler::m_edgeSerializers
private

Referenced by deserialize(), and serialize().

◆ m_faceSerializers

std::vector<SPFaceDataSerializer> ug::GridDataSerializationHandler::m_faceSerializers
private

Referenced by deserialize(), and serialize().

◆ m_gridSerializers

std::vector<SPGridDataSerializer> ug::GridDataSerializationHandler::m_gridSerializers
private

Referenced by deserialize(), and serialize().

◆ m_volSerializers

std::vector<SPVolumeDataSerializer> ug::GridDataSerializationHandler::m_volSerializers
private

Referenced by deserialize(), and serialize().

◆ m_vrtSerializers

std::vector<SPVertexDataSerializer> ug::GridDataSerializationHandler::m_vrtSerializers
private

Referenced by deserialize(), and serialize().


The documentation for this class was generated from the following files: