ALBA
|
#include <albaStorable.h>
Public Member Functions | |
albaStorable () | |
int | Store (albaStorageElement *element) |
int | Restore (albaStorageElement *element) |
albaObject * | CastToObject () |
bool | IsStorable () |
Static Public Member Functions | |
static albaStorable * | SafeCastToObject (albaObject *o) |
Protected Member Functions | |
virtual int | InternalStore (albaStorageElement *node)=0 |
virtual int | InternalRestore (albaStorageElement *node)=0 |
Protected Attributes | |
bool | m_Storable |
albaStorable is an interface for serializable objects.
The idea behind this class is to act as in interface to be inherited to become a serializable object. This is a abstract interface, since Store and Restore are not defined and should be implemented. When storing an element must be provided and the store will attach all necessary attributes, data and subnodes to that point. When restoring a correct element to start restoring from must be provided: the given node must have been serialized with the the corresponding store function. Beware, Restore() does not perform a search for the right subnode to be restore, but simply try to restore the given element into itself (the "this" object). On the other end, for subnodes to be restored, the restore implementation will probably implement a search mechanism. This happens for the specialized RestoreXX() functions of the albaStorageElement class, which search for the subnode of with the right name.
Definition at line 40 of file albaStorable.h.
|
inline |
Definition at line 43 of file albaStorable.h.
int albaStorable::Store | ( | albaStorageElement * | element | ) |
Storing this object as part of an XML document.
The element node must be passed as argument, which can eventually be the XML document root. The store function will append all the necessary data and attributes and new XML nodes as children of this node.
int albaStorable::Restore | ( | albaStorageElement * | element | ) |
Restore this object from an XML document.
The XML element from where starting the restoring must be passed as argument. Notice when restoring an element corresponding to this kind of object must be passed: restore is not going to search for a subnode of the right type. This means the calling restore loop should have identified the node passed as argument as of type to be restored by this object.
albaObject * albaStorable::CastToObject | ( | ) |
safe cast to albaObject, to be used with double inheritance from albaObject and albaStorable
|
static |
convenience function for dynamic casting
|
inline |
return true if the object should be stored
Definition at line 64 of file albaStorable.h.
|
protectedpure virtual |
This is called by Store() and must be reimplemented by subclasses.
The node element where the object should store itself is passed as argument.
Implemented in mmuMSFDocument, albaAction, albaAvatar, albaAvatar3D, albaDevice, albaDeviceButtonsPadTracker, albaDeviceManager, albaDeviceSet, albaInteractionManager, albaInteractorSER, albaAttribute, albaAttributeTraceability, albaStorableMaterialLibrary, albaTagArray, albaTagItem, albaVME, albaVMERoot, mmaApplicationLayout, mmaMaterial, mmaVolumeMaterial, and albaStorableDictionary.
|
protectedpure virtual |
This is called by Restore() and must be reimplemented by subclasses The element from which the object should restore itself is passed as argument.
Implemented in albaAttribute, albaAttributeTraceability, albaStorableMaterialLibrary, albaTagArray, albaTagItem, albaVME, albaVMERoot, mmuMSFDocument, mmaApplicationLayout, mmaMaterial, mmaVolumeMaterial, albaStorableDictionary, albaAction, albaAvatar, albaAvatar3D, albaDevice, albaDeviceButtonsPadTracker, albaDeviceManager, albaDeviceSet, albaInteractionManager, and albaInteractorSER.
|
protected |
if this flag is set to false the object does not store itself
Definition at line 76 of file albaStorable.h.