anatomist 6.0.4
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

 Serializer ()
 
virtual ~Serializer ()
 
int serialize (void *ptr)
 Generate a unique ID to serialize a pointer.
 

Protected Attributes

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

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 55 of file Serializer.h.

Constructor & Destructor Documentation

◆ Serializer()

anatomist::Serializer::Serializer ( )
inline

Definition at line 88 of file Serializer.h.

References _id, and _mutex.

Referenced by serialize().

◆ ~Serializer()

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

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

References Serializer().

Member Data Documentation

◆ _id

int anatomist::Serializer::_id
protected

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

Definition at line 80 of file Serializer.h.

Referenced by Serializer().

◆ _mutex

carto::Mutex anatomist::Serializer::_mutex
protected

Definition at line 81 of file Serializer.h.

Referenced by Serializer().

◆ _ptr2id

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

Pointer to ID lookup table.

Definition at line 77 of file Serializer.h.


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