hpp::util::parser::SequenceFactory< ValueType > Class Template Reference

Factory parsing sequence of values. More...

#include <hpp/util/factories/sequence.hh>

Inheritance diagram for hpp::util::parser::SequenceFactory< ValueType >:
[legend]
Collaboration diagram for hpp::util::parser::SequenceFactory< ValueType >:
[legend]

Public Types

typedef std::vector< ValueType > OutType
 
- Public Types inherited from hpp::util::parser::ObjectFactory
typedef std::list< ObjectFactory * > ObjectFactoryList
 

Public Member Functions

 SequenceFactory (ObjectFactory *parent, const XMLElement *element, const unsigned int nbValue=0)
 
virtual void addTextChild (const XMLText *text)
 Add Text child. More...
 
const OutTypevalues () const
 
 SequenceFactory (const std::string &tagName, ObjectFactory *parent=NULL)
 
void values (const OutType &v)
 
- Public Member Functions inherited from hpp::util::parser::ObjectFactory
 ObjectFactory (ObjectFactory *parent=NULL, const XMLElement *element=NULL)
 
virtual ~ObjectFactory ()
 
void name (const std::string &n)
 Set the name. More...
 
void name (const char *n)
 See name(const std::string&) More...
 
template<typename T >
T * as ()
 Cast this class to any child class. More...
 
virtual bool init ()
 Called when the object is created. More...
 
void setAttribute (const XMLAttribute *attr)
 Called for each attribute. More...
 
virtual bool finishAttributes ()
 Called when all the attributes have been processed. More...
 
virtual void finishTags ()
 Called when all the child tags have been processed. More...
 
virtual void finishFile ()
 Called when parsing is finished. More...
 
 ObjectFactory (const std::string &tagName, ObjectFactory *parent=NULL)
 Constructor for writing objects from scratch. More...
 
void addAttribute (const std::string &name, const std::string &value)
 Add an attribute. More...
 
XMLNodewrite (XMLNode *node) const
 Add this factory as child of the node argument. More...
 
std::string tagName () const
 Return tag name of the element is any. More...
 
std::string name () const
 Return the content of the attribute name, or an empty string. More...
 
bool hasAttribute (const std::string &attr) const
 Check if an attribute was set. More...
 
std::string getAttribute (const std::string &attr) const
 Return a given attributes. More...
 
ObjectFactoryList getChildrenOfType (std::string type)
 Get a list of ObjectFactory whose tag name is type. More...
 
bool getChildOfType (std::string type, ObjectFactory *&o)
 Get the ObjectFactory whose tag name is type. More...
 

Protected Member Functions

virtual void impl_write (XMLElement *element) const
 
- Protected Member Functions inherited from hpp::util::parser::ObjectFactory
 ObjectFactory (ObjectFactory *root)
 
ObjectFactoryparent ()
 
virtual ObjectFactoryroot ()
 
bool hasParent () const
 
const XMLElementXMLelement ()
 
virtual void impl_setAttribute (const XMLAttribute *attr)
 
void addChild (ObjectFactory *child)
 
virtual std::ostream & print (std::ostream &os) const
 

Detailed Description

template<typename ValueType>
class hpp::util::parser::SequenceFactory< ValueType >

Factory parsing sequence of values.

Template Parameters
ValueTypeone of (bool, int, unsigned int, double, float)

A std::vector is built from a sequence of values separeted by white spaces.

Member Typedef Documentation

template<typename ValueType >
typedef std::vector<ValueType> hpp::util::parser::SequenceFactory< ValueType >::OutType

Constructor & Destructor Documentation

template<typename ValueType >
hpp::util::parser::SequenceFactory< ValueType >::SequenceFactory ( ObjectFactory parent,
const XMLElement element,
const unsigned int  nbValue = 0 
)
inline
template<typename ValueType >
hpp::util::parser::SequenceFactory< ValueType >::SequenceFactory ( const std::string &  tagName,
ObjectFactory parent = NULL 
)
inline

Member Function Documentation

template<typename ValueType >
void hpp::util::parser::SequenceFactory< ValueType >::addTextChild ( const XMLText text)
virtual
template<typename ValueType >
void hpp::util::parser::SequenceFactory< ValueType >::impl_write ( XMLElement element) const
protectedvirtual
template<typename ValueType >
const OutType& hpp::util::parser::SequenceFactory< ValueType >::values ( ) const
inline
template<typename ValueType >
void hpp::util::parser::SequenceFactory< ValueType >::values ( const OutType v)
inline