Graphite  Version 3
An experimental 3D geometry processing program
OGF::Serializer Class Referenceabstract

Abstract base class for reading and writing values from/to streams. More...

#include <OGF/gom/services/serializer.h>

Inheritance diagram for OGF::Serializer:
GEO::Counted OGF::BoolSerializer OGF::EnumSerializer OGF::GenericSerializer< T > OGF::GenericSerializer< ArgList > OGF::PointerSerializer OGF::StringSerializer

Public Member Functions

 ~Serializer () override
 Serializer destructor.
 
virtual bool serialize_read (std::istream &stream, void *addr)=0
 Reads a value from a stream. More...
 
virtual bool serialize_write (std::ostream &stream, void *addr)=0
 Writes a value to a stream. More...
 
- Public Member Functions inherited from GEO::Counted
void ref () const
 Increments the reference count. More...
 
void unref () const
 Decrements the reference count. More...
 
bool is_shared () const
 Check if the object is shared. More...
 
int nb_refs () const
 Gets the number of references that point to this object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from GEO::Counted
static void ref (const Counted *counted)
 Increments the reference count. More...
 
static void unref (const Counted *counted)
 Decrements the reference count. More...
 
- Protected Member Functions inherited from GEO::Counted
 Counted ()
 Creates a reference counted object. More...
 
virtual ~Counted ()
 Destroys a reference counted object. More...
 

Detailed Description

Abstract base class for reading and writing values from/to streams.

Definition at line 58 of file serializer.h.

Member Function Documentation

◆ serialize_read()

virtual bool OGF::Serializer::serialize_read ( std::istream &  stream,
void *  addr 
)
pure virtual

Reads a value from a stream.

Parameters
[in]streamthe input stream
[out]addran untyped pointer where to store the result
Return values
trueif the value could be successfully read
falseotherwise

Implemented in OGF::GenericSerializer< T >, OGF::EnumSerializer, OGF::PointerSerializer, OGF::BoolSerializer, and OGF::StringSerializer.

◆ serialize_write()

virtual bool OGF::Serializer::serialize_write ( std::ostream &  stream,
void *  addr 
)
pure virtual

Writes a value to a stream.

Parameters
[out]streamthe output stream
[in]addran untyped pointer where to read the value from
Return values
trueif the value could be successfully written
falseotherwise

Implemented in OGF::GenericSerializer< T >, OGF::EnumSerializer, OGF::PointerSerializer, OGF::BoolSerializer, and OGF::StringSerializer.


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