ValuedUserInfo< T > Class Template Reference

The main userinfo template class. It should be derived whenever you need a new userinfo of a class which does not contain any subelements. It is the case of basic classes(or types) like int, string, double, etc. More...

#include <userinfo.h>

Inheritance diagram for ValuedUserInfo< T >:

Inheritance graph
[legend]
Collaboration diagram for ValuedUserInfo< T >:

Collaboration graph
[legend]

List of all members.

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

 ValuedUserInfo (string userFriendlyTypeName)
string XMLCh2str (const XMLCh *const XMLCh_str)
 function which transcodes Xerces' XMLCh-based strings into C++ strings
string removeSpaces (const string &str)
virtual void ReleaseMemory ()
 A method for releasing memory allocated within the 'AssemblyComponentsFromXML()' method.

Protected Attributes

string value
 string variable which is automatically binded to a proper DOMElement attribute

Static Protected Attributes

static const TypedUserInfo< T > & instance


Detailed Description

template<typename T>
class ValuedUserInfo< T >

The main userinfo template class. It should be derived whenever you need a new userinfo of a class which does not contain any subelements. It is the case of basic classes(or types) like int, string, double, etc.

The only thing left is to translate its public string attribute 'value' into a value of type T and also implement conversion in the other way round. For that, an overloading of methods T* AssemblyInstance() / bool DisassemblyInstance(T &instance) is fruitful. See some valued userinfo below as an example.


Member Function Documentation

template<class T>
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.

template<class T>
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().

template<class T>
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().


Member Data Documentation

template<typename T>
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


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

Generated on Wed Oct 15 15:57:17 2008 for mixpp by  doxygen 1.5.6