Graphite  Version 3
An experimental 3D geometry processing program
OGF::EnumSerializer Class Reference

Implementation of Serializer for enums. More...

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

Inheritance diagram for OGF::EnumSerializer:
OGF::Serializer GEO::Counted

Public Member Functions

 EnumSerializer (MetaEnum *meta_enum)
 EnumSerializer constructor. More...
 
bool serialize_read (std::istream &stream, void *addr) override
 Reads a value from a stream. More...
 
bool serialize_write (std::ostream &stream, void *addr) override
 Writes a value to a stream. More...
 
- Public Member Functions inherited from OGF::Serializer
 ~Serializer () override
 Serializer destructor.
 
- 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

Implementation of Serializer for enums.

Definition at line 170 of file serializer.h.

Constructor & Destructor Documentation

◆ EnumSerializer()

OGF::EnumSerializer::EnumSerializer ( MetaEnum meta_enum)
inlineexplicit

EnumSerializer constructor.

The symbolic names declared in the MetaEnum are written/read to the stream (instead of the numeric values).

Parameters
[in]meta_enuma pointer to the MetaEnum

Definition at line 179 of file serializer.h.

Member Function Documentation

◆ serialize_read()

bool OGF::EnumSerializer::serialize_read ( std::istream &  stream,
void *  addr 
)
overridevirtual

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

Implements OGF::Serializer.

◆ serialize_write()

bool OGF::EnumSerializer::serialize_write ( std::ostream &  stream,
void *  addr 
)
overridevirtual

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

Implements OGF::Serializer.


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