This class adapts to the XMLable interface any array of basic objects. More...
#include <XMLArrayAdapter.hxx>
Public Types | |
typedef BasicXMLable | super |
typedef T | t_adaptee |
Public Member Functions | |
XMLArrayAdapter (t_adaptee *anAdaptee, unsigned int nElements, const char *name=NULL, bool isXMLElement=false) | |
Constructs a XMLArrayAdapter. | |
XMLArrayAdapter (const t_adaptee *anAdaptee, unsigned int nElements, const char *name=NULL, bool isXMLElement=false) | |
virtual | ~XMLArrayAdapter () |
std::string | XMLContent () const |
bool | XMLContent (std::istream &str) |
bool | FulfilsInvariant () |
This class adapts to the XMLable interface any array of basic objects.
A basic object is that one that has the insertion (<<) and extractor (>>) operators defined to streams and there exists a TypeInfo struct for it (see CLAM_TYPE_INFO_GROUP). The adapter uses such operators to calculate the XML content on writing and reconstruct the object on reading.
During the construction, the adapter stores a reference to the adaptee. The content string extracted on demand when the adapter is stored on a XMLStorage, so the adapter is sensitive to the adaptee changes after the construction.
Important: At storage time, the adaptee must exist in order to follow the reference.
Pay attention to the management of the name memory (see BasicXMLable).
Definition at line 59 of file XMLArrayAdapter.hxx.
typedef BasicXMLable CLAM::XMLArrayAdapter< T >::super |
Definition at line 62 of file XMLArrayAdapter.hxx.
typedef T CLAM::XMLArrayAdapter< T >::t_adaptee |
Definition at line 63 of file XMLArrayAdapter.hxx.
CLAM::XMLArrayAdapter< T >::XMLArrayAdapter | ( | t_adaptee * | anAdaptee, | |
unsigned int | nElements, | |||
const char * | name = NULL , |
|||
bool | isXMLElement = false | |||
) | [inline] |
Constructs a XMLArrayAdapter.
anAdaptee | The object to be adapted (where the XML content will be extracted from) | |
name | A pointer to a 0 terminated string containing the xml name (for elements and attributes) or 0 (the default) if the element is neither an element nor an attribute ( |
nElements | The number of elements on the array. | |
isXMLElement | Tells whether the object is an element or an attribute when the name is defined. |
Definition at line 86 of file XMLArrayAdapter.hxx.
CLAM::XMLArrayAdapter< T >::XMLArrayAdapter | ( | const t_adaptee * | anAdaptee, | |
unsigned int | nElements, | |||
const char * | name = NULL , |
|||
bool | isXMLElement = false | |||
) | [inline] |
Definition at line 91 of file XMLArrayAdapter.hxx.
virtual CLAM::XMLArrayAdapter< T >::~XMLArrayAdapter | ( | ) | [inline, virtual] |
Definition at line 97 of file XMLArrayAdapter.hxx.
bool CLAM::XMLArrayAdapter< T >::FulfilsInvariant | ( | ) | [inline] |
Reimplemented from CLAM::BasicXMLable.
Definition at line 127 of file XMLArrayAdapter.hxx.
References CLAM::BasicXMLable::FulfilsInvariant().
bool CLAM::XMLArrayAdapter< T >::XMLContent | ( | std::istream & | str | ) | [inline, virtual] |
Implements CLAM::XMLable.
Definition at line 116 of file XMLArrayAdapter.hxx.
std::string CLAM::XMLArrayAdapter< T >::XMLContent | ( | ) | const [inline, virtual] |
Implements CLAM::BasicXMLable.
Definition at line 102 of file XMLArrayAdapter.hxx.