AGX Dynamics 2.38.0.0
|
This class is an abstract base class for all classes that can be stored and retrieved from an Archive. More...
#include <Serializable.h>
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 () |
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.
|
virtual |
Destructor for normal C++ use but hidden from SWIG bindings.
|
protected |
Default constructor.
|
protected |
Copy constructor.
|
protected |
|
virtual |
Reimplemented in agxPowerLine::detail::DimensionState1Dof< DimensionType >, agxPowerLine::detail::DimensionState3Dof< DimensionType >, agxPowerLine::detail::RigidBodyTranslationalAttachmentSentry, and agxPowerLine::detail::RigidBodyRotationalAttachmentSentry.
Referenced by agxStream::InputArchive::readRef().
bool agxStream::Serializable::getEnableSerialization | ( | ) | const |
Definition at line 295 of file Serializable.h.
bool agxStream::Serializable::getEnableUuidGeneration | ( | ) |
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.
Definition at line 269 of file Serializable.h.
|
pure virtual |
agx::Uuid agxStream::Serializable::getUuid | ( | ) | const |
Definition at line 290 of file Serializable.h.
bool agxStream::Serializable::isFinished | ( | ) | const |
Definition at line 274 of file Serializable.h.
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.
|
static |
Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
void agxStream::Serializable::setFinished | ( | ) |
Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
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!