16#ifndef __albaStorageElement_h__
17#define __albaStorageElement_h__
76 virtual int StoreText(
const char *name,
const char *text)=0;
78 virtual int StoreVectorN(
const char *name,
double *comps,
int num)=0;
80 virtual int StoreVectorN(
const char *name,
const std::vector<double> &comps,
int num)=0;
81 virtual int StoreVectorN(
const char *name,
const std::vector<int> &comps,
int num)=0;
83 virtual int StoreVectorN(
const char *name,
const std::vector<albaString> &comps,
int num,
const char *tag)=0;
102 int RestoreVectorN(
const char *name,std::vector<double> &comps,
unsigned int num);
105 int RestoreVectorN(
const char *name,std::vector<albaString> &comps,
unsigned int num,
const char *tag);
116 virtual int RestoreVectorN(std::vector<albaString> &comps,
unsigned int num,
const char *tag)=0;
153 virtual int StoreObjectVector(
const char *name,
const std::vector<albaObject *> &vector,
const char *items_name=
"Item");
156 virtual int RestoreObjectVector(
const char *name,std::vector<albaObject *> &vector,
const char *items_name=
"Item");
long albaID
type for IDs inside ALBA
albaMatrix - Time stamped 4x4 Matrix.
Abstract superclass for all ALBA classes implementing RTTI APIs.
albaStorable is an interface for serializable objects.
Abstract class representing the interface for the unit of information stored in the storage.
virtual int RestoreText(char *&buffer)
albaStorageElement(albaStorageElement *parent, albaStorage *storage)
elements can be created only by means of AppendChild() or FindNestedElement()
virtual void SetAttribute(const char *name, const char *value)=0
Set an attribute of this element.
virtual int RestoreVectorN(std::vector< double > &comps, unsigned int num)=0
int RestoreVectorN(const char *name, std::vector< int > &comps, unsigned int num)
int RestoreVectorN(const char *name, std::vector< albaString > &comps, unsigned int num, const char *tag)
restore a vector of strings from an XML element, where single items are stored in "tag" sub elements
albaStorageElement * m_Parent
the parent element in the hierarchy
void SetParent(albaStorageElement *element)
albaStorage * m_Storage
storage who created this element
int RestoreDouble(const char *name, double &value)
virtual albaStorageElement * AppendChild(const char *name)=0
Create a new child element and return its pointer.
std::vector< albaStorageElement * > * m_Children
children elements
virtual int StoreVectorN(const char *name, double *comps, int num)=0
int RestoreVectorN(const char *name, int *comps, unsigned int num)
virtual ChildrenVector & GetChildren()=0
Return the list of children.
int RestoreVectorN(const char *name, std::vector< double > &comps, unsigned int num)
virtual int StoreVectorN(const char *name, const std::vector< albaString > &comps, int num, const char *tag)=0
store a vector of strings into an XML element, and stores single items in "tag" sub elements
int RestoreVectorN(const char *name, double *comps, unsigned int num)
virtual int StoreVectorN(const char *name, const std::vector< int > &comps, int num)=0
virtual bool GetNestedElementsByName(const char *name, std::vector< albaStorageElement * > &list)
Return the list of all children with a given name.
int RestoreInteger(const char *name, int &value)
albaStorageElement * GetParent()
return a pointer to the parent element, i.e.
virtual bool GetAttribute(const char *name, albaString &value)=0
Return an attribute value given its name.
virtual int RestoreVectorN(int *comps, unsigned int num)=0
int RestoreInteger(int &value)
int RestoreText(const char *name, char *&buffer)
std::vector< albaStorageElement * > ChildrenVector
int StoreInteger(const char *name, const int &value)
albaStorageElement * StoreObject(const char *name, albaObject *object)
Used for storing a albaObjects.
virtual int StoreVectorN(const char *name, int *comps, int num)=0
bool GetAttributeAsDouble(const char *name, double &value)
Return an attribute value given its name, converting it to double.
int RestoreObject(const char *name, albaStorable *object)
Function to try restoring a albaObject from a albaStorageElement.
albaStorageElement * StoreObject(const char *name, albaStorable *storable, const char *type_name)
commodity function to store a storable object creating on the fly the element to store it inside.
virtual int RestoreVectorN(std::vector< int > &comps, unsigned int num)=0
virtual int StoreText(const char *name, const char *text)=0
virtual int RestoreMatrix(albaMatrix *matrix)=0
virtual int RestoreObjectVector(const char *name, std::vector< albaObject * > &vector, const char *items_name="Item")
Restore a vector of objects.
albaObject * RestoreObject()
Restore object from given element.
int RestoreDouble(double &value)
virtual const char * GetName()=0
get the name of this element.
bool GetAttributeAsInteger(const char *name, albaID &value)
Return an attribute value given its name, converting it to integer.
virtual int StoreMatrix(const char *name, const albaMatrix *matrix)=0
int RestoreText(const char *name, albaString &buffer)
virtual int StoreObjectVector(const char *name, const std::vector< albaObject * > &vector, const char *items_name="Item")
Store a vector of objects.
virtual int RestoreText(albaString &buffer)=0
albaString UpgradeAttribute(const char *attribute)
Used to upgrade attribute value from previous MSF file version.
int StoreDouble(const char *name, const double &value)
void SetStorage(albaStorage *storage)
virtual int RestoreObjectVector(albaStorageElement *element, std::vector< albaObject * > &vector, const char *items_name="Item")
Restore a vector of objects.
albaObject * RestoreObject(const char *name)
Restore object from given element.
virtual int StoreVectorN(const char *name, const std::vector< double > &comps, int num)=0
virtual int RestoreVectorN(double *comps, unsigned int num)=0
virtual albaStorageElement * FindNestedElement(const char *name)
Find a nested element by Name.
int RestoreMatrix(const char *name, albaMatrix *matrix)
Store 8bit binary data.
virtual ~albaStorageElement()
void SetAttribute(const char *name, const albaID value)
void SetAttribute(const char *name, const double value)
albaStorage * GetStorage()
return a pointer to the storage who created this element
virtual int RestoreVectorN(std::vector< albaString > &comps, unsigned int num, const char *tag)=0
restore a vector of strings from an XML element, where single items are stored in "tag" sub elements
Abstract class for an abject mastering the storing/restoring of objects This is an abstract class pro...
albaString - performs common string operations on c-strings.