anatomist  5.1.2
3D neuroimaging data viewer
anatomist::Serializer Class Reference

Serializer is a helper class for pointer serialization. More...

#include <anatomist/processor/Serializer.h>

Inheritance diagram for anatomist::Serializer:
Collaboration diagram for anatomist::Serializer:

Public Member Functions

Constructors and Destructor
 Serializer ()
 does nothing More...
 
virtual ~Serializer ()
 does nothing More...
 
Serialization
int serialize (void *ptr)
 Generate a unique ID to serialize a pointer. More...
 

Disable copy

std::map< void *, int > _ptr2id
 Pointer to ID lookup table. More...
 
int _id
 Current ID: begin from 0 and increment with every new pointer. More...
 

Detailed Description

Serializer is a helper class for pointer serialization.

Every pointer can be asociated with a unique integer ID that can be saved to a file and restored later.

Definition at line 54 of file Serializer.h.

Constructor & Destructor Documentation

◆ Serializer()

anatomist::Serializer::Serializer ( )
inline

does nothing

Definition at line 104 of file Serializer.h.

◆ ~Serializer()

virtual anatomist::Serializer::~Serializer ( )
virtual

does nothing

Member Function Documentation

◆ serialize()

int anatomist::Serializer::serialize ( void *  ptr)

Generate a unique ID to serialize a pointer.

Parameters
ptrpointer to serialize
Returns
unique id associated with the pointer to serialize

Member Data Documentation

◆ _id

int anatomist::Serializer::_id
protected

Current ID: begin from 0 and increment with every new pointer.

Definition at line 97 of file Serializer.h.

◆ _ptr2id

std::map<void*, int> anatomist::Serializer::_ptr2id
protected

Pointer to ID lookup table.

Definition at line 94 of file Serializer.h.


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