ALBA
Public Member Functions | Protected Attributes | List of all members
albaXMLElement Class Reference

#include <albaXMLElement.h>

Inheritance diagram for albaXMLElement:
Inheritance graph
[legend]
Collaboration diagram for albaXMLElement:
Collaboration graph
[legend]

Public Member Functions

 albaXMLElement (mmuXMLDOMElement *element, albaXMLElement *parent, albaXMLStorage *storage)
 
virtual ~albaXMLElement ()
 
virtual const char * GetName ()
 
virtual int StoreText (const char *name, const char *text)
 
virtual int StoreMatrix (const char *name, const albaMatrix *matrix)
 
virtual int StoreVectorN (const char *name, const std::vector< double > &comps, int num)
 
virtual int StoreVectorN (const char *name, double *comps, int num)
 
virtual int StoreVectorN (const char *name, const std::vector< int > &comps, int num)
 
virtual int StoreVectorN (const char *name, int *comps, int num)
 
virtual int StoreVectorN (const char *name, const std::vector< albaString > &comps, int num, const char *tag)
 
virtual int RestoreMatrix (albaMatrix *matrix)
 
virtual int RestoreVectorN (std::vector< double > &comps, unsigned int num)
 
virtual int RestoreVectorN (double *comps, unsigned int num)
 
virtual int RestoreVectorN (std::vector< int > &comps, unsigned int num)
 
virtual int RestoreVectorN (int *comps, unsigned int num)
 
virtual int RestoreVectorN (std::vector< albaString > &comps, unsigned int num, const char *tag)
 
virtual int RestoreText (albaString &buffer)
 
albaXMLStorageGetXMLStorage ()
 
albaXMLElementGetXMLParent ()
 
virtual ChildrenVectorGetChildren ()
 
virtual albaStorageElementAppendChild (const char *name)
 
albaXMLElementAppendXMLChild (const char *name)
 
albaXMLElementFindNestedXMLElement (const char *name)
 
mmuXMLDOMElementGetXMLElement ()
 
virtual void SetAttribute (const char *name, const char *value)
 
virtual bool GetAttribute (const char *name, albaString &value)
 
void WriteXMLText (const char *text)
 
int ParseData (std::vector< double > &vector, int size)
 
int ParseData (std::vector< int > &vector, int size)
 
int ParseData (double *vector, int size)
 
int ParseData (int *vector, int size)
 
bool ExistElement (const char *name)
 
- Public Member Functions inherited from albaStorageElement
virtual ~albaStorageElement ()
 
virtual const char * GetName ()=0
 
virtual void SetAttribute (const char *name, const char *value)=0
 
void SetAttribute (const char *name, const albaID value)
 
void SetAttribute (const char *name, const double value)
 
virtual bool GetAttribute (const char *name, albaString &value)=0
 
bool GetAttributeAsDouble (const char *name, double &value)
 
bool GetAttributeAsInteger (const char *name, albaID &value)
 
albaString UpgradeAttribute (const char *attribute)
 
virtual int StoreText (const char *name, const char *text)=0
 
virtual int StoreMatrix (const char *name, const albaMatrix *matrix)=0
 
virtual int StoreVectorN (const char *name, double *comps, int num)=0
 
virtual int StoreVectorN (const char *name, int *comps, int num)=0
 
virtual int StoreVectorN (const char *name, const std::vector< double > &comps, int num)=0
 
virtual int StoreVectorN (const char *name, const std::vector< int > &comps, int num)=0
 
virtual int StoreVectorN (const char *name, const std::vector< albaString > &comps, int num, const char *tag)=0
 
int RestoreMatrix (const char *name, albaMatrix *matrix)
 
int RestoreVectorN (const char *name, double *comps, unsigned int num)
 
int RestoreVectorN (const char *name, int *comps, unsigned int num)
 
int RestoreVectorN (const char *name, std::vector< double > &comps, unsigned int num)
 
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)
 
int RestoreText (const char *name, char *&buffer)
 
int RestoreText (const char *name, albaString &buffer)
 
virtual int RestoreMatrix (albaMatrix *matrix)=0
 
virtual int RestoreVectorN (double *comps, unsigned int num)=0
 
virtual int RestoreVectorN (int *comps, unsigned int num)=0
 
virtual int RestoreVectorN (std::vector< double > &comps, unsigned int num)=0
 
virtual int RestoreVectorN (std::vector< int > &comps, unsigned int num)=0
 
virtual int RestoreVectorN (std::vector< albaString > &comps, unsigned int num, const char *tag)=0
 
virtual int RestoreText (albaString &buffer)=0
 
virtual int RestoreText (char *&buffer)
 
int StoreDouble (const char *name, const double &value)
 
int RestoreDouble (const char *name, double &value)
 
int RestoreDouble (double &value)
 
int StoreInteger (const char *name, const int &value)
 
int RestoreInteger (const char *name, int &value)
 
int RestoreInteger (int &value)
 
int RestoreObject (const char *name, albaStorable *object)
 
albaObjectRestoreObject (const char *name)
 
albaObjectRestoreObject ()
 
albaStorageElementStoreObject (const char *name, albaObject *object)
 
virtual int StoreObjectVector (const char *name, const std::vector< albaObject * > &vector, const char *items_name="Item")
 
virtual int RestoreObjectVector (const char *name, std::vector< albaObject * > &vector, const char *items_name="Item")
 
virtual int RestoreObjectVector (albaStorageElement *element, std::vector< albaObject * > &vector, const char *items_name="Item")
 
albaStorageGetStorage ()
 
albaStorageElementGetParent ()
 
virtual albaStorageElementAppendChild (const char *name)=0
 
virtual albaStorageElementFindNestedElement (const char *name)
 
virtual ChildrenVectorGetChildren ()=0
 
virtual bool GetNestedElementsByName (const char *name, std::vector< albaStorageElement * > &list)
 

Protected Attributes

mmuXMLDOMElementm_DOMElement
 
albaXMLStringm_Name
 
- Protected Attributes inherited from albaStorageElement
albaStoragem_Storage
 
albaStorageElementm_Parent
 
std::vector< albaStorageElement * > * m_Children
 

Additional Inherited Members

- Public Types inherited from albaStorageElement
typedef std::vector< albaStorageElement * > ChildrenVector
 
- Protected Member Functions inherited from albaStorageElement
 albaStorageElement (albaStorageElement *parent, albaStorage *storage)
 
albaStorageElementStoreObject (const char *name, albaStorable *storable, const char *type_name)
 
void SetStorage (albaStorage *storage)
 
void SetParent (albaStorageElement *element)
 

Detailed Description

concrete implementation of albaStorageElement as an XML-DOM element This class represent a concrete implementation of a albaStorageElement in terms of a DOM-XML element.

The real DOM-XML element object is embedded in this wrapper object and can be retrieved with GetXMLElement(). Utility functions allow a albaStorable object to serialize itself independently from the the serialization format. While storing to file the albaXMLElement are created by attaching new children to existing nodes by means of AppendChild(). All the created elements are automatically destroyed at the end of the storing procedure by albaStorage object. During restoring, the DOM tree is created by DOMParser in the albaXMLStorage object, and the wrapping albaXMLElements are created by means of FindNestedElement() function. All the albaXMLElements so created during restoring are automatically destroyed by albaStorage object at the end of the restoring.

See also
albaXMLStorage

Definition at line 41 of file albaXMLElement.h.

Constructor & Destructor Documentation

◆ albaXMLElement()

albaXMLElement::albaXMLElement ( mmuXMLDOMElement element,
albaXMLElement parent,
albaXMLStorage storage 
)

◆ ~albaXMLElement()

virtual albaXMLElement::~albaXMLElement ( )
virtual

Member Function Documentation

◆ GetName()

virtual const char * albaXMLElement::GetName ( )
virtual

get the name of this XML element

Implements albaStorageElement.

◆ StoreText()

virtual int albaXMLElement::StoreText ( const char *  name,
const char *  text 
)
virtual

Store a generic text into an XML document.

Implements albaStorageElement.

◆ StoreMatrix()

virtual int albaXMLElement::StoreMatrix ( const char *  name,
const albaMatrix matrix 
)
virtual

Store a matrix into an XML document.

Implements albaStorageElement.

◆ StoreVectorN() [1/5]

virtual int albaXMLElement::StoreVectorN ( const char *  name,
const std::vector< double > &  comps,
int  num 
)
virtual

Store a vectorN into an XML document.

Implements albaStorageElement.

◆ StoreVectorN() [2/5]

virtual int albaXMLElement::StoreVectorN ( const char *  name,
double *  comps,
int  num 
)
virtual

Implements albaStorageElement.

◆ StoreVectorN() [3/5]

virtual int albaXMLElement::StoreVectorN ( const char *  name,
const std::vector< int > &  comps,
int  num 
)
virtual

Store a vectorN into an XML document.

Implements albaStorageElement.

◆ StoreVectorN() [4/5]

virtual int albaXMLElement::StoreVectorN ( const char *  name,
int *  comps,
int  num 
)
virtual

Implements albaStorageElement.

◆ StoreVectorN() [5/5]

virtual int albaXMLElement::StoreVectorN ( const char *  name,
const std::vector< albaString > &  comps,
int  num,
const char *  tag 
)
virtual

Store a vectorN into an XML document.

Implements albaStorageElement.

◆ RestoreMatrix()

virtual int albaXMLElement::RestoreMatrix ( albaMatrix matrix)
virtual

Store 8bit binary data.

Not yet supported. Store 16bit binary data. Not yet supported. Store 32bit binary data. Not yet supported. Store 8bit binary data. Not yet supported. Store 16bit binary data. Not yet supported. Store 32bit binary data. Not yet supported. Restore a matrix from an XML document

Implements albaStorageElement.

◆ RestoreVectorN() [1/5]

virtual int albaXMLElement::RestoreVectorN ( std::vector< double > &  comps,
unsigned int  num 
)
virtual

Restore a vectorN from an XML document.

Implements albaStorageElement.

◆ RestoreVectorN() [2/5]

virtual int albaXMLElement::RestoreVectorN ( double *  comps,
unsigned int  num 
)
virtual

Implements albaStorageElement.

◆ RestoreVectorN() [3/5]

virtual int albaXMLElement::RestoreVectorN ( std::vector< int > &  comps,
unsigned int  num 
)
virtual

Restore a vectorN from an XML document.

Implements albaStorageElement.

◆ RestoreVectorN() [4/5]

virtual int albaXMLElement::RestoreVectorN ( int *  comps,
unsigned int  num 
)
virtual

Implements albaStorageElement.

◆ RestoreVectorN() [5/5]

virtual int albaXMLElement::RestoreVectorN ( std::vector< albaString > &  comps,
unsigned int  num,
const char *  tag 
)
virtual

Restore a vectorN from an XML document.

Implements albaStorageElement.

◆ RestoreText()

virtual int albaXMLElement::RestoreText ( albaString buffer)
virtual

Restore a generic text string from an XML document.

Implements albaStorageElement.

◆ GetXMLStorage()

albaXMLStorage * albaXMLElement::GetXMLStorage ( )

return a pointer to the storage who created this element

◆ GetXMLParent()

albaXMLElement * albaXMLElement::GetXMLParent ( )

return a pointer to the parent element, i.e.

the element upper in the hierarchy

◆ GetChildren()

virtual ChildrenVector & albaXMLElement::GetChildren ( )
virtual

Return the list of children.

The list is created from DOM-Tree at the first access during restoring.

Implements albaStorageElement.

◆ AppendChild()

virtual albaStorageElement * albaXMLElement::AppendChild ( const char *  name)
virtual

Create a new XML child element and return its pointer.

This is the only way to create a new XML element. The first element (the root) is automatically created by storage object and is the DOM document root element

Implements albaStorageElement.

◆ AppendXMLChild()

albaXMLElement * albaXMLElement::AppendXMLChild ( const char *  name)

◆ FindNestedXMLElement()

albaXMLElement * albaXMLElement::FindNestedXMLElement ( const char *  name)

Find a nested XML element by Name.

◆ GetXMLElement()

mmuXMLDOMElement * albaXMLElement::GetXMLElement ( )

return DOM-XML element stored inside this albaXMLElement

◆ SetAttribute()

virtual void albaXMLElement::SetAttribute ( const char *  name,
const char *  value 
)
virtual

Append an XML attribute to this element.

Attribute 'name' and 'value' must be passed as argument. This utility function takes care of string conversion problems.

Implements albaStorageElement.

◆ GetAttribute()

virtual bool albaXMLElement::GetAttribute ( const char *  name,
albaString value 
)
virtual

Return find an attribute given its name and return its value.

Return false if not found. This function takes care of string conversion problems.

Implements albaStorageElement.

◆ WriteXMLText()

void albaXMLElement::WriteXMLText ( const char *  text)

this writes text inside a DOM-XML element

◆ ParseData() [1/4]

int albaXMLElement::ParseData ( std::vector< double > &  vector,
int  size 
)

Internally used to extract vector values from Text data.

◆ ParseData() [2/4]

int albaXMLElement::ParseData ( std::vector< int > &  vector,
int  size 
)

◆ ParseData() [3/4]

int albaXMLElement::ParseData ( double *  vector,
int  size 
)

◆ ParseData() [4/4]

int albaXMLElement::ParseData ( int *  vector,
int  size 
)

◆ ExistElement()

bool albaXMLElement::ExistElement ( const char *  name)

return true if an element with that name exists

Member Data Documentation

◆ m_DOMElement

mmuXMLDOMElement* albaXMLElement::m_DOMElement
protected

XML element wrapped by this object (USING PIMPL due to Internal Compile errors of VS7)

Definition at line 152 of file albaXMLElement.h.

◆ m_Name

albaXMLString* albaXMLElement::m_Name
protected

Convenient copy of etagName.

Definition at line 153 of file albaXMLElement.h.


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