YGP::AttributeList< T, L > Class Template Reference

Template for a list of attributes of a specific type. More...

Inherits YGP::IAttribute.

List of all members.

Public Member Functions

 AttributeList (const char *name, L &list)
 AttributeList (const std::string &name, L &list)
 ~AttributeList ()
virtual IAttributeclone ()
virtual bool assignFromString (const char *value) const
virtual bool assignFromString (unsigned int offset, const char *value) const
virtual bool assign (unsigned int offset, const char *value, unsigned int length) const
virtual bool assign (const char *value, unsigned int length) const
std::string getValue () const
bool isValidOffset (unsigned int offset) const
template<>
bool doAssignFromString (unsigned int offset, const char *value) const throw(std::out_of_range)
template<>
bool assign (unsigned int offset, const char *value, unsigned int length) const
template<>
bool doAssignFromString (unsigned int offset, const char *value) const throw(std::out_of_range)
template<>
bool doAssignFromString (unsigned int offset, const char *value) const throw(std::out_of_range)
template<>
bool doAssignFromString (unsigned int offset, const char *value) const throw(std::out_of_range)
template<>
bool doAssignFromString (unsigned int offset, const char *value) const throw(std::out_of_range)
template<>
bool doAssignFromString (unsigned int offset, const char *value) const throw(std::out_of_range)
template<>
bool doAssignFromString (unsigned int offset, const char *value) const throw(std::out_of_range)
template<>
bool doAssignFromString (unsigned int offset, const char *value) const throw(std::out_of_range)
template<>
bool doAssignFromString (unsigned int offset, const char *value) const throw(std::out_of_range)
template<>
bool doAssignFromString (unsigned int offset, const char *value) const throw(std::out_of_range)
template<>
bool assign (unsigned int offset, const char *value, unsigned int length) const


Detailed Description

template<class T, class L = std::vector<T>>
class YGP::AttributeList< T, L >

Template for a list of attributes of a specific type.

This class is designed to be used by AttributeValues (and derived types), but there exists specializations for:


Constructor & Destructor Documentation

template<class T , class L = std::vector<T>>
YGP::AttributeList< T, L >::AttributeList ( const char *  name,
L &  list 
) [inline]

Constructor; creates an attribute list with the specified name, referencing the (vector of) attribute values.

template<class T , class L = std::vector<T>>
YGP::AttributeList< T, L >::AttributeList ( const std::string &  name,
L &  list 
) [inline]

Constructor; creates an attribute list with the specified name, referencing the (vector of) attribute values.

template<class T , class L = std::vector<T>>
YGP::AttributeList< T, L >::~AttributeList (  )  [inline]

Destructor.


Member Function Documentation

template<>
bool YGP::AttributeList< std::string >::assign ( unsigned int  offset,
const char *  value,
unsigned int  length 
) const [inline]

Returns:
true on success; false otherwise

template<class T , class L = std::vector<T>>
virtual bool YGP::AttributeList< T, L >::assign ( const char *  value,
unsigned int  length 
) const [inline, virtual]

Method to assign a value from a character-pointer to the attribute list.

See assignFromString() for details.

Reimplemented from YGP::IAttribute.

template<class T , class L = std::vector<T>>
virtual bool YGP::AttributeList< T, L >::assign ( unsigned int  offset,
const char *  value,
unsigned int  length 
) const [inline, virtual]

Method to assign a value from a character-pointer to a single (specified) element of the list.

See See assignFromString() for details.

template<class T , class L = std::vector<T>>
virtual bool YGP::AttributeList< T, L >::assignFromString ( unsigned int  offset,
const char *  value 
) const [inline, virtual]

Method to assign a value from a character-pointer to a single (specified) element of the list.

Note:
The offset is not checked vor validity!

template<class T , class L = std::vector<T>>
virtual bool YGP::AttributeList< T, L >::assignFromString ( const char *  value  )  const [inline, virtual]

Method to assign a value from a character-pointer to the attribute list.

The character-array is supposed to be a sequence of offset=value entries, which are separated by a semicolon (;). In case of an error (invalid offset or value) the assigning is stopped; leaving the previously (valid) entries assigned.

Returns:
true on success; false otherwise

Implements YGP::IAttribute.

template<class T , class L = std::vector<T>>
virtual IAttribute* YGP::AttributeList< T, L >::clone (  )  [inline, virtual]

Returns a copy of the attribute.

Implements YGP::IAttribute.

template<>
bool YGP::AttributeList< std::string >::doAssignFromString ( unsigned int  offset,
const char *  value 
) const throw(std::out_of_range) [inline]

Returns:
true on success; false otherwise

template<class T , class L = std::vector<T>>
std::string YGP::AttributeList< T, L >::getValue (  )  const [inline, virtual]

Returns the value of the attribute list.

This is a string of [offset]=[value]; entries.

Implements YGP::IAttribute.

template<class T , class L = std::vector<T>>
bool YGP::AttributeList< T, L >::isValidOffset ( unsigned int  offset  )  const [inline]

Checks if the passed value specifies a valid offset.

Returns:
true, if the offset is valid


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

YGP Version 0.9.31 - Generated on Wed Nov 18 11:25:27 2009 by doxygen 1.5.8