ug4
ug::GeomObjDataSerializer< TGeomObj > Class Template Referenceabstract

Interface for handling serialization and deserialization of data associated with geometric objects. More...

#include <serialization.h>

+ Inheritance diagram for ug::GeomObjDataSerializer< TGeomObj >:

Public Member Functions

virtual void deserialization_done ()
 this method will be called after read_info has been called for all geometric objects. More...
 
virtual void deserialization_starts ()
 this method is called after read_info has been called for all geometric objects. More...
 
virtual void read_data (BinaryBuffer &in, TGeomObj *o)=0
 read data associated with the given object. Pure virtual. More...
 
virtual void read_info (BinaryBuffer &in)
 Read the info written during write_info here. Default: empty implementation. More...
 
virtual void write_data (BinaryBuffer &out, TGeomObj *o) const =0
 write data associated with the given object. Pure virtual. More...
 
virtual void write_info (BinaryBuffer &out) const
 can be used to write arbitrary info to the file. More...
 
virtual ~GeomObjDataSerializer ()
 

Detailed Description

template<class TGeomObj>
class ug::GeomObjDataSerializer< TGeomObj >

Interface for handling serialization and deserialization of data associated with geometric objects.

The GeomObjDataSerializer allows to serialize data associated with geometric objects. Before the data will be serialized, write_info is called. Accordingly read_info is called before data is deserialized.

Note that this class handles serialization and deserialization at once.

Make sure to completely read all data written by the associated write calls.

Note that the following typedefs exist: VertexDataSerializer, EdgeDataSerializer, FaceDataSerializer, VolumeDataSerializer.

If one wants to serialize data of all objects in a grid, he should take a look at GridDataSerializer.

If you call read_info and/or read_data directly, make sure to also call deserialization_done after deserialization has been performed for all geometric objects.

Constructor & Destructor Documentation

◆ ~GeomObjDataSerializer()

template<class TGeomObj >
virtual ug::GeomObjDataSerializer< TGeomObj >::~GeomObjDataSerializer ( )
inlinevirtual

Member Function Documentation

◆ deserialization_done()

template<class TGeomObj >
virtual void ug::GeomObjDataSerializer< TGeomObj >::deserialization_done ( )
inlinevirtual

this method will be called after read_info has been called for all geometric objects.

◆ deserialization_starts()

template<class TGeomObj >
virtual void ug::GeomObjDataSerializer< TGeomObj >::deserialization_starts ( )
inlinevirtual

this method is called after read_info has been called for all geometric objects.

◆ read_data()

template<class TGeomObj >
virtual void ug::GeomObjDataSerializer< TGeomObj >::read_data ( BinaryBuffer in,
TGeomObj *  o 
)
pure virtual

read data associated with the given object. Pure virtual.

Implemented in ug::GeomObjAttachmentSerializer< TGeomObj, TAttachment >.

◆ read_info()

template<class TGeomObj >
virtual void ug::GeomObjDataSerializer< TGeomObj >::read_info ( BinaryBuffer in)
inlinevirtual

Read the info written during write_info here. Default: empty implementation.

◆ write_data()

template<class TGeomObj >
virtual void ug::GeomObjDataSerializer< TGeomObj >::write_data ( BinaryBuffer out,
TGeomObj *  o 
) const
pure virtual

write data associated with the given object. Pure virtual.

Implemented in ug::GeomObjAttachmentSerializer< TGeomObj, TAttachment >.

◆ write_info()

template<class TGeomObj >
virtual void ug::GeomObjDataSerializer< TGeomObj >::write_info ( BinaryBuffer out) const
inlinevirtual

can be used to write arbitrary info to the file.

Make sure to read everything you've written during read_data. Default implementation is empty.


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