33 #ifndef __H__LIB_GRID__SERIALIZATION__
34 #define __H__LIB_GRID__SERIALIZATION__
84 template <
class TGeomObj>
214 template <
class TIterator>
234 template <
class TIterator>
250 template<
class TGeomObj,
class TSerializers>
252 TSerializers& serializers)
const;
255 template<
class TGeomObj,
class TDeserializers>
257 TDeserializers& deserializers);
259 template<
class TSerializers>
262 template<
class TSerializers>
265 template<
class TSerializers>
268 template<
class TSerializers>
287 template <
class TGeomObj,
class TAttachment>
395 bool readGridHeader =
true);
489 std::vector<Vertex*>* pvVrts = NULL,
490 std::vector<Edge*>* pvEdges = NULL,
491 std::vector<Face*>* pvFaces = NULL,
492 std::vector<Volume*>* pvVols = NULL,
509 template <
class TElem,
class TAttachment>
521 template <
class TElem,
class TAttachment>
535 template <
class TElem,
class TAttachment>
547 template <
class TElem,
class TAttachment>
583 bool readPropertyMap =
true);
599 bool readPropertyMap =
true);
Definition: smart_pointer.h:108
A Buffer for binary data.
Definition: binary_buffer.h:56
Base-class for edges.
Definition: grid_base_objects.h:397
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
Serialization callback for grid attachments.
Definition: serialization.h:290
Grid::AttachmentAccessor< TGeomObj, TAttachment > m_aa
Definition: serialization.h:308
static SmartPtr< GeomObjDataSerializer< TGeomObj > > create(Grid &g, TAttachment a)
Definition: serialization.h:293
virtual ~GeomObjAttachmentSerializer()
Definition: serialization.h:299
GeomObjAttachmentSerializer(Grid &g, TAttachment a)
Definition: serialization.h:296
virtual void write_data(BinaryBuffer &out, TGeomObj *o) const
write data associated with the given object. Pure virtual.
Definition: serialization.h:301
virtual void read_data(BinaryBuffer &in, TGeomObj *o)
read data associated with the given object. Pure virtual.
Definition: serialization.h:304
Interface for handling serialization and deserialization of data associated with geometric objects.
Definition: serialization.h:86
virtual ~GeomObjDataSerializer()
Definition: serialization.h:88
virtual void read_data(BinaryBuffer &in, TGeomObj *o)=0
read data associated with the given object. Pure virtual.
virtual void write_data(BinaryBuffer &out, TGeomObj *o) const =0
write data associated with the given object. Pure virtual.
virtual void write_info(BinaryBuffer &out) const
can be used to write arbitrary info to the file.
Definition: serialization.h:93
virtual void deserialization_done()
this method will be called after read_info has been called for all geometric objects.
Definition: serialization.h:106
virtual void deserialization_starts()
this method is called after read_info has been called for all geometric objects.
Definition: serialization.h:103
virtual void read_info(BinaryBuffer &in)
Read the info written during write_info here. Default: empty implementation.
Definition: serialization.h:98
Serialization of data associated with grid elements.
Definition: serialization.h:186
void read_infos(BinaryBuffer &in)
calls read_info on all registered serializers
Definition: serialization.cpp:119
void deserialization_starts()
Definition: serialization.cpp:163
void read_info(BinaryBuffer &in, TSerializers &serializers)
Definition: serialization.cpp:104
void deserialize(BinaryBuffer &in, Vertex *vrt)
Deserializes data associated with the given object.
Definition: serialization_impl.hpp:93
std::vector< SPVolumeDataSerializer > m_volSerializers
Definition: serialization.h:275
void write_infos(BinaryBuffer &out) const
calls write_info on all registered serializers
Definition: serialization.cpp:110
void add(SPVertexDataSerializer cb)
Adds a callback class for serialization and deserialization.
Definition: serialization.cpp:69
std::vector< SPFaceDataSerializer > m_faceSerializers
Definition: serialization.h:274
~GridDataSerializationHandler()
Definition: serialization.h:188
std::vector< SPGridDataSerializer > m_gridSerializers
Definition: serialization.h:276
void write_info(BinaryBuffer &out, TSerializers &serializers) const
Definition: serialization.cpp:96
std::vector< SPEdgeDataSerializer > m_edgeSerializers
Definition: serialization.h:273
void deserialization_done()
Definition: serialization.cpp:181
void serialize(BinaryBuffer &out, Vertex *vrt) const
Serializes data associated with the given object.
Definition: serialization_impl.hpp:44
std::vector< SPVertexDataSerializer > m_vrtSerializers
Definition: serialization.h:272
Interface for handling serialization and deserialization of data associated with all geometric object...
Definition: serialization.h:138
virtual void read_data(BinaryBuffer &in, Vertex *o)
Definition: serialization.h:155
virtual void write_data(BinaryBuffer &out, Vertex *o) const
Definition: serialization.h:150
virtual void deserialization_done()
this method is called after read_info has been called for all geometric objects.
Definition: serialization.h:164
virtual void deserialization_starts()
this method is called after read_info has been called for all geometric objects.
Definition: serialization.h:161
virtual void write_data(BinaryBuffer &out, Face *o) const
Definition: serialization.h:152
virtual void read_data(BinaryBuffer &in, Edge *o)
Definition: serialization.h:156
virtual void write_data(BinaryBuffer &out, Edge *o) const
Definition: serialization.h:151
virtual void read_data(BinaryBuffer &in, Face *o)
Definition: serialization.h:157
virtual void read_info(BinaryBuffer &in)
Read the info written during write_info here. Default: empty implementation.
Definition: serialization.h:148
virtual void write_data(BinaryBuffer &out, Volume *o) const
Definition: serialization.h:153
virtual void write_info(BinaryBuffer &out) const
can be used to write arbitrary info to the file.
Definition: serialization.h:145
virtual void read_data(BinaryBuffer &in, Volume *o)
Definition: serialization.h:158
virtual ~GridDataSerializer()
Definition: serialization.h:140
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
a helper class that holds a collection of possibly unconnected geometric-objects.
Definition: grid_object_collection.h:96
base-implementation of a selector
Definition: selector_interface.h:126
Definition: subset_handler_interface.h:223
Accesses attachements in different element types at the same time.
Definition: attachment_util.h:56
Definition: multi_grid.h:72
Definition: serialization.h:312
virtual void write_info(BinaryBuffer &out) const
writes subset-infos to the stream (subset names and colors)
Definition: serialization.cpp:198
virtual void read_data(BinaryBuffer &in, Vertex *o)
Definition: serialization.cpp:250
virtual void read_info(BinaryBuffer &in)
Read the info written during write_info here. Default: empty implementation.
Definition: serialization.cpp:211
ISubsetHandler & m_sh
Definition: serialization.h:336
SubsetHandlerSerializer(ISubsetHandler &sh)
Definition: serialization.cpp:192
virtual void write_data(BinaryBuffer &out, Vertex *o) const
Definition: serialization.cpp:226
static SPGridDataSerializer create(ISubsetHandler &sh)
Definition: serialization.h:314
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
Definition: grid_base_object_traits.h:68
GeomObjDataSerializer< Edge > EdgeDataSerializer
Definition: serialization.h:110
bool DeserializeSubsetHandler(Grid &grid, ISubsetHandler &sh, GridObjectCollection goc, BinaryBuffer &in, bool readPropertyMap)
assigns subset-indices to all elements in the goc from a stream.
Definition: serialization.cpp:2504
GeomObjDataSerializer< Face > FaceDataSerializer
Definition: serialization.h:111
GeomObjDataSerializer< Vertex > VertexDataSerializer
Definition: serialization.h:109
bool SerializeSubsetHandler(Grid &grid, ISubsetHandler &sh, GridObjectCollection goc, BinaryBuffer &out)
writes the subset-indices of all elements in the goc to a stream.
Definition: serialization.cpp:2417
bool SerializeAttachment(Grid &grid, TAttachment &attachment, BinaryBuffer &out)
Definition: serialization_impl.hpp:144
GeomObjDataSerializer< Volume > VolumeDataSerializer
Definition: serialization.h:112
bool SerializeSelector(Grid &grid, ISelector &sel, GridObjectCollection goc, BinaryBuffer &out)
writes the subset-indices of all elements in the goc to a stream.
Definition: serialization.cpp:2603
SmartPtr< GridDataSerializer > SPGridDataSerializer
Definition: serialization.h:167
SmartPtr< VolumeDataSerializer > SPVolumeDataSerializer
Definition: serialization.h:117
SmartPtr< VertexDataSerializer > SPVertexDataSerializer
Definition: serialization.h:114
SmartPtr< FaceDataSerializer > SPFaceDataSerializer
Definition: serialization.h:116
SmartPtr< EdgeDataSerializer > SPEdgeDataSerializer
Definition: serialization.h:115
bool DeserializeAttachment(Grid &grid, TAttachment &attachment, BinaryBuffer &in)
copies attached values from a binary stream
Definition: serialization_impl.hpp:192
bool DeserializeSelector(Grid &grid, ISelector &sel, GridObjectCollection goc, BinaryBuffer &in)
assigns subset-indices to all elements in the goc from a stream.
Definition: serialization.cpp:2666
bool SerializeGridElements(Grid &grid, BinaryBuffer &out)
Writes all grid elements into a binary-stream.
Definition: serialization.cpp:412
bool DeserializeGridElements(Grid &grid, BinaryBuffer &in, bool readGridHeader)
Creates grid elements from a binary stream.
Definition: serialization.cpp:652
bool SerializeMultiGridElements(MultiGrid &mg, GridObjectCollection mgoc, MultiElementAttachmentAccessor< AInt > &aaInt, BinaryBuffer &out, MultiElementAttachmentAccessor< AGeomObjID > *paaID)
writes a part of the elements of a MultiGrid to a binary stream.
Definition: serialization.cpp:873
bool DeserializeMultiGridElements(MultiGrid &mg, BinaryBuffer &in, std::vector< Vertex * > *pvVrts, std::vector< Edge * > *pvEdges, std::vector< Face * > *pvFaces, std::vector< Volume * > *pvVols, MultiElementAttachmentAccessor< AGeomObjID > *paaID)
Creates multi-grid elements from a binary stream.
Definition: serialization.cpp:1428
void Deserialize(TIStream &buf, ParallelVector< T > &v)
Deerialize for ParallelVector<T>
Definition: restart_bridge.cpp:112
void Serialize(TOStream &buf, const ParallelVector< T > &v)
Serialize for ParallelVector<T>
Definition: restart_bridge.cpp:103