#include <XMLIterableAdapter.hxx>
It supports both kind of subitems: Components and Basic Types. Depending on the kind of subitem it calculates the XML content with such extraction operator operator when subitems are basic objects or it stores recursivelly when they are components. The content is the same one which the insertion operator generates inserting an space between elements.
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 CLAM::BasicXMLable).
Definition at line 66 of file XMLIterableAdapter.hxx.
Public Types | |
typedef BasicXMLable | super |
typedef T | t_adaptee |
typedef t_adaptee::value_type | t_adapteeValues |
typedef t_adaptee::iterator | t_adapteeIterator |
typedef TypeInfo < t_adapteeValues > ::StorableAsLeaf | BasicIsStorableAsLeaf |
Public Member Functions | |
XMLIterableAdapter (T &anAdaptee, const char *elementName, const char *name=NULL, bool isXMLElement=false) | |
Constructs a XMLIterableAdapter. | |
XMLIterableAdapter (const T &anAdaptee, const char *elementName, const char *name=NULL, bool isXMLElement=false) | |
virtual | ~XMLIterableAdapter () |
const char * | GetClassName () const |
Return the class name. | |
std::string | XMLContent () const |
bool | XMLContent (std::istream &str) |
virtual void | StoreOn (Storage &store) const |
Stores subitems on the given Storage. | |
virtual void | LoadFrom (Storage &store) |
Loads component's subitems from the given Storage. | |
bool | FulfilsInvariant () |
Check the internal status for a class instance is valid. |
typedef BasicXMLable CLAM::XMLIterableAdapter< T >::super |
Definition at line 69 of file XMLIterableAdapter.hxx.
typedef T CLAM::XMLIterableAdapter< T >::t_adaptee |
Definition at line 70 of file XMLIterableAdapter.hxx.
typedef t_adaptee::value_type CLAM::XMLIterableAdapter< T >::t_adapteeValues |
Definition at line 71 of file XMLIterableAdapter.hxx.
typedef t_adaptee::iterator CLAM::XMLIterableAdapter< T >::t_adapteeIterator |
Definition at line 72 of file XMLIterableAdapter.hxx.
typedef TypeInfo<t_adapteeValues>::StorableAsLeaf CLAM::XMLIterableAdapter< T >::BasicIsStorableAsLeaf |
Definition at line 73 of file XMLIterableAdapter.hxx.
CLAM::XMLIterableAdapter< T >::XMLIterableAdapter | ( | T & | anAdaptee, | |
const char * | elementName, | |||
const char * | name = NULL , |
|||
bool | isXMLElement = false | |||
) | [inline] |
Constructs a XMLIterableAdapter.
anAdaptee | The object to be adapted (where the XML content will be extracted from) | |
elementName | The XML tag that will be open for every element on the iterable. Only apliable when elements are not basics. | |
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 ( |
isXMLElement | Tells whether the object is an element or an attribute when the name is defined. |
Definition at line 98 of file XMLIterableAdapter.hxx.
CLAM::XMLIterableAdapter< T >::XMLIterableAdapter | ( | const T & | anAdaptee, | |
const char * | elementName, | |||
const char * | name = NULL , |
|||
bool | isXMLElement = false | |||
) | [inline] |
Definition at line 104 of file XMLIterableAdapter.hxx.
virtual CLAM::XMLIterableAdapter< T >::~XMLIterableAdapter | ( | ) | [inline, virtual] |
Definition at line 110 of file XMLIterableAdapter.hxx.
const char* CLAM::XMLIterableAdapter< T >::GetClassName | ( | ) | const [inline, virtual] |
Return the class name.
Implements CLAM::Component.
Definition at line 111 of file XMLIterableAdapter.hxx.
References CLAM_ASSERT.
std::string CLAM::XMLIterableAdapter< T >::XMLContent | ( | ) | const [inline, virtual] |
Implements CLAM::BasicXMLable.
Definition at line 119 of file XMLIterableAdapter.hxx.
References NULL.
bool CLAM::XMLIterableAdapter< T >::XMLContent | ( | std::istream & | str | ) | [inline, virtual] |
virtual void CLAM::XMLIterableAdapter< T >::StoreOn | ( | Storage & | store | ) | const [inline, virtual] |
Stores subitems on the given Storage.
store | The given storage where the subitem will be stored |
Implements CLAM::Component.
Definition at line 137 of file XMLIterableAdapter.hxx.
References NULL.
virtual void CLAM::XMLIterableAdapter< T >::LoadFrom | ( | Storage & | store | ) | [inline, virtual] |
Loads component's subitems from the given Storage.
store | The given storage where the subitem will be loaded from |
Implements CLAM::Component.
Definition at line 147 of file XMLIterableAdapter.hxx.
References NULL.
bool CLAM::XMLIterableAdapter< T >::FulfilsInvariant | ( | ) | [inline] |
Check the internal status for a class instance is valid.
Reimplemented from CLAM::BasicXMLable.
Definition at line 243 of file XMLIterableAdapter.hxx.
References CLAM::BasicXMLable::FulfilsInvariant().