ug4
|
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< SPEdgeDataSerializer > | m_edgeSerializers |
std::vector< SPFaceDataSerializer > | m_faceSerializers |
std::vector< SPGridDataSerializer > | m_gridSerializers |
std::vector< SPVolumeDataSerializer > | m_volSerializers |
std::vector< SPVertexDataSerializer > | m_vrtSerializers |
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.
|
inline |
void ug::GridDataSerializationHandler::add | ( | SPEdgeDataSerializer | cb | ) |
Adds a callback class for serialization and deserialization.
void ug::GridDataSerializationHandler::add | ( | SPFaceDataSerializer | cb | ) |
Adds a callback class for serialization and deserialization.
void ug::GridDataSerializationHandler::add | ( | SPGridDataSerializer | cb | ) |
Adds a callback class for serialization and deserialization.
void ug::GridDataSerializationHandler::add | ( | SPVertexDataSerializer | cb | ) |
Adds a callback class for serialization and deserialization.
Referenced by ug::GlobalAttachments::add_attachment_serializer(), ug::LoadBalancer::add_serializer(), ug::DistributeDomain(), ug::DistributeGrid(), ug::GridFunction< TDomain, TAlgebra >::grid_distribution_callback(), ug::OverlyingSubsetFinder< TDomain >::OverlyingSubsetFinder(), and ug::ZRayTracer< TDomain >::ZRayTracer().
void ug::GridDataSerializationHandler::add | ( | SPVolumeDataSerializer | cb | ) |
Adds a callback class for serialization and deserialization.
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().
|
private |
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().
|
private |
|
inline |
Deserializes data associated with the given object.
References deserialize(), m_edgeSerializers, and m_gridSerializers.
|
inline |
Deserializes data associated with the given object.
References deserialize(), m_faceSerializers, and m_gridSerializers.
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().
|
private |
performs deserialization on all given deserializers.
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().
|
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().
|
inline |
Deserializes data associated with the given object.
References deserialize(), m_gridSerializers, and m_volSerializers.
|
private |
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().
|
inline |
Serializes data associated with the given object.
References m_edgeSerializers, m_gridSerializers, and serialize().
|
inline |
Serializes data associated with the given object.
References m_faceSerializers, m_gridSerializers, and serialize().
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().
|
private |
performs serialization on all given serializers.
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().
|
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().
|
inline |
Serializes data associated with the given object.
References m_gridSerializers, m_volSerializers, and serialize().
|
private |
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().
|
private |
Referenced by deserialize(), and serialize().
|
private |
Referenced by deserialize(), and serialize().
|
private |
Referenced by deserialize(), and serialize().
|
private |
Referenced by deserialize(), and serialize().
|
private |
Referenced by deserialize(), and serialize().