This class adapts to the XMLable interface any STL like container of basic objects or CLAM::Component's. More...
#include <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. |
This class adapts to the XMLable interface any STL like container of basic objects or CLAM::Component's.
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 60 of file XMLIterableAdapter.hxx.
typedef TypeInfo<t_adapteeValues>::StorableAsLeaf CLAM::XMLIterableAdapter< T >::BasicIsStorableAsLeaf |
Definition at line 38 of file XMLIterableAdapter.hxx.
typedef BasicXMLable CLAM::XMLIterableAdapter< T >::super |
Definition at line 34 of file XMLIterableAdapter.hxx.
typedef T CLAM::XMLIterableAdapter< T >::t_adaptee |
Definition at line 35 of file XMLIterableAdapter.hxx.
typedef t_adaptee::iterator CLAM::XMLIterableAdapter< T >::t_adapteeIterator |
Definition at line 37 of file XMLIterableAdapter.hxx.
typedef t_adaptee::value_type CLAM::XMLIterableAdapter< T >::t_adapteeValues |
Definition at line 36 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 63 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 69 of file XMLIterableAdapter.hxx.
virtual CLAM::XMLIterableAdapter< T >::~XMLIterableAdapter | ( | ) | [inline, virtual] |
Definition at line 75 of file XMLIterableAdapter.hxx.
bool CLAM::XMLIterableAdapter< T >::FulfilsInvariant | ( | ) | [inline] |
Check the internal status for a class instance is valid.
Reimplemented from CLAM::BasicXMLable.
Definition at line 237 of file XMLIterableAdapter.hxx.
const char* CLAM::XMLIterableAdapter< T >::GetClassName | ( | ) | const [inline, virtual] |
Return the class name.
Implements CLAM::Component.
Definition at line 76 of file XMLIterableAdapter.hxx.
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 112 of file XMLIterableAdapter.hxx.
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 102 of file XMLIterableAdapter.hxx.
bool CLAM::XMLIterableAdapter< T >::XMLContent | ( | std::istream & | str | ) | [inline, virtual] |
Implements CLAM::XMLable.
Definition at line 90 of file XMLIterableAdapter.hxx.
std::string CLAM::XMLIterableAdapter< T >::XMLContent | ( | ) | const [inline, virtual] |
Implements CLAM::BasicXMLable.
Definition at line 84 of file XMLIterableAdapter.hxx.