AGX Dynamics 2.38.0.0
Loading...
Searching...
No Matches
agxStream::Serializable Class Referenceabstract

This class is an abstract base class for all classes that can be stored and retrieved from an Archive. More...

#include <Serializable.h>

+ Inheritance diagram for agxStream::Serializable:

Public Member Functions

virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Static Public Member Functions

static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 

Protected Member Functions

 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Detailed Description

This class is an abstract base class for all classes that can be stored and retrieved from an Archive.

Derive from this class and implement The two methods:

store - Stream an object to an archive restore - Restore an object from an archive

The two above methods are declared in the AGXSTREAM_DECLARE_SERIALIZABLE which must be part of any class that should be possible to serialize.

Also remember to create a storage object using the Storage struct: Storage<MyClass> myClassStorage.

Definition at line 44 of file Serializable.h.

Constructor & Destructor Documentation

◆ ~Serializable()

virtual agxStream::Serializable::~Serializable ( )
virtual

Destructor for normal C++ use but hidden from SWIG bindings.

◆ Serializable() [1/2]

agxStream::Serializable::Serializable ( )
protected

Default constructor.

◆ Serializable() [2/2]

agxStream::Serializable::Serializable ( const Serializable other)
protected

Copy constructor.

Member Function Documentation

◆ generateUuid()

void agxStream::Serializable::generateUuid ( )
protected

◆ getClassName()

◆ getEnableSerialization()

bool agxStream::Serializable::getEnableSerialization ( ) const
Returns
true if serialization is enabled for this object

Definition at line 295 of file Serializable.h.

◆ getEnableUuidGeneration()

bool agxStream::Serializable::getEnableUuidGeneration ( )
Returns
true if Uuid:s should be generated for each new Serializable object

◆ getIndex()

agx::UInt32 agxStream::Serializable::getIndex ( ) const

This index is given at creation of this object.

It is guaranteed to be unique for the lifetime of this library instance. As long as the application is running. This value is not serialized or restored. A new object will always get a new index no matter how it is created.

Returns
an instance index of this object. This is unique for the lifetime of this library instance.

Definition at line 269 of file Serializable.h.

◆ getStorageAgent()

◆ getUuid()

agx::Uuid agxStream::Serializable::getUuid ( ) const
Returns
a unique id for this instance.

Definition at line 290 of file Serializable.h.

◆ isFinished()

bool agxStream::Serializable::isFinished ( ) const
Returns
true if this class is restored correctly and should not be deleted during destruction of an Archive.

Definition at line 274 of file Serializable.h.

◆ setEnableSerialization()

void agxStream::Serializable::setEnableSerialization ( bool  flag)

Set to false to disable serialization of this object.

It will just be ignored during serialization (writing). It is still possible to restore TO this object.

◆ setEnableUuidGeneration()

static void agxStream::Serializable::setEnableUuidGeneration ( bool  flag)
static

Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.

◆ setFinished()

void agxStream::Serializable::setFinished ( )

Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.

◆ setUuid()

void agxStream::Serializable::setUuid ( const agx::Uuid uuid)

Explicitly set a Uuid on a serializable object.

Use this method with great care, as it can result in non-unique identifiers in the system!


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