#include <userinfo.h>
Static Public Member Functions | |
template<class T> | |
static T * | Assembly (DOMElement &element, const string tagName) |
template<class T> | |
static bool | Disassembly (T &instance, DOMElement &element, const string tagName, const string help) |
template<class T> | |
static bool | Disassembly (T &instance, DOMElement &element, const string tagName) |
Protected Member Functions | |
CompoundUserInfo (string userFriendlyTypeName) | |
string | XMLCh2str (const XMLCh *const XMLCh_str) |
function which transcodes Xerces' XMLCh-based strings into C++ strings | |
string | removeSpaces (const string &str) |
Static Protected Attributes | |
static const TypedUserInfo< T > & | instance |
Classes | |
class | BindedElement |
Templated class binding inner element with its XML tag and automating data transfers in both directions. More... |
To bind some inner element to its own userinfo class, and also to automate its assembling and disassembling, it is necessary to create a instance of an inner templated class BindedElement<T>. Those attributes have to be initialized in constructor of a new compound userinfo this way:
class BikeUI: public CompoundUserInfo<Bike> { private: BindedElement<int> year; BindedElement<bool> lights; BindedElement<string> manufacturer; public: BikeUI() :CompoundUserInfo<Bike>("bike"), year( this, "year", 0 ), lights( this, "electric lights", false ), manufacturer( this, "manufacturer", "unknown") { } ... }
static T* UserInfo::Assembly | ( | DOMElement & | element, | |
const string | tagName | |||
) | [inline, static, inherited] |
This methods tries to assembly a new instance of type T (or some of its descendant types) according to a data stored in a DOMNode named tagName within a child nodes of the passed element. If an error occurs, it returns a NULL pointer.
References Attribute::Get(), and Attribute::type.
static bool UserInfo::Disassembly | ( | T & | instance, | |
DOMElement & | element, | |||
const string | tagName, | |||
const string | help | |||
) | [inline, static, inherited] |
This methods tries to disassembly an instance of type T (or some of its descendant types) and build DOM tree accordingly. Then, it creates a new DOMNode named according tagName and connecti it to the passed DOMElement as a new child node (with a help attribute filled).
References Attribute::help, Attribute::Set(), and Attribute::type.
Referenced by UserInfo::Disassembly(), and CompoundUserInfo< T >::BindedElement< U >::DisassemblyComponentsToXML().
static bool UserInfo::Disassembly | ( | T & | instance, | |
DOMElement & | element, | |||
const string | tagName | |||
) | [inline, static, inherited] |
This methods tries to disassembly an instance of type T (or some of its descendant types) and build DOM tree accordingly. Then, it creates a new DOMNode named according tagName and connecti it to the passed DOMElement as a new child node.
References UserInfo::Disassembly().
const TypedUserInfo<T>& TypedUserInfo< T >::instance [static, protected, inherited] |
the only instance of this class (each type T has its own instance) which is used as a factory for processing related userinfos