ALBA
albaStorable.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaStorable
5 Authors: Marco Petrone
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16#ifndef __albaStorable_h__
17#define __albaStorable_h__
18
19#include "albaConfigure.h"
20
21//----------------------------------------------------------------------------
22// forward declarations :
23//----------------------------------------------------------------------------
25class albaObject;
26
40class ALBA_EXPORT albaStorable
41{
42public:
43 albaStorable():m_Storable(true) {}
56
59
62
64 bool IsStorable() {return m_Storable;}
65protected:
69 virtual int InternalStore(albaStorageElement *node)=0;
70
74 virtual int InternalRestore(albaStorageElement *node)=0;
75
77};
78#endif // __albaStorable_h__
Abstract superclass for all ALBA classes implementing RTTI APIs.
Definition: albaObject.h:38
albaStorable is an interface for serializable objects.
Definition: albaStorable.h:41
virtual int InternalRestore(albaStorageElement *node)=0
This is called by Restore() and must be reimplemented by subclasses The element from which the object...
int Restore(albaStorageElement *element)
Restore this object from an XML document.
virtual int InternalStore(albaStorageElement *node)=0
This is called by Store() and must be reimplemented by subclasses.
bool IsStorable()
return true if the object should be stored
Definition: albaStorable.h:64
static albaStorable * SafeCastToObject(albaObject *o)
convenience function for dynamic casting
int Store(albaStorageElement *element)
Storing this object as part of an XML document.
albaObject * CastToObject()
safe cast to albaObject, to be used with double inheritance from albaObject and albaStorable
bool m_Storable
if this flag is set to false the object does not store itself
Definition: albaStorable.h:76
Abstract class representing the interface for the unit of information stored in the storage.