Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
plist::NamedEnumeration< T > Class Template Reference#include <plist.h>
Inheritance diagram for plist::NamedEnumeration< T >: ![]() Detailed Descriptiontemplate<typename T>
Provides an interface for the use of enumerations in a plist -- you can specify values by either the string name or the corresponding integer value.
|
Public Member Functions | |
NamedEnumeration () | |
constructor | |
NamedEnumeration (const NamedEnumeration &ne) | |
copy constructor | |
NamedEnumeration (const T &v, const char *const *enumnames, unsigned int maxval) | |
constructor, pass initial value, array of strings (the names), and the one-plus-maximum enum value (i.e. the number of enumeration values if they run sequentially from 0) | |
NamedEnumeration (const T &v) | |
automatic casting from the enumeration | |
NamedEnumeration & | operator= (const T &v) |
assignment from enumeration value (numeric) | |
NamedEnumeration & | operator= (const std::string &v) |
assignment from string | |
NamedEnumeration & | operator= (const NamedEnumeration &ne) |
assignment | |
const T & | operator * () const |
value access | |
operator T () const | |
automatic casting to the enumeration value | |
void | setNames (const char *const *enumnames, unsigned int maxval) |
(re)set the array of names and one-plus-maximum enum value (i.e. the number of enumeration values if they run sequentially from 0) | |
const char *const * | getNames () const |
returns the array of names previously provided from constructor or setNames() | |
const char * | getName (unsigned int i) const |
returns the name for a particular index | |
unsigned int | getMax () const |
returns the one-past-maximum of enumeration values previously provided to constructor or setNames() | |
void | LoadXML (xmlNode *node) |
This is called when the subclass needs to update its values from those values in the parse tree. | |
void | SaveXML (xmlNode *node) const |
This is called when XMLLoadSave needs to have the subclass update values in the tree currently in memory -- may already be filled out by previous contents. | |
void | set (const std::string &str) |
assign a new value | |
std::string | get () const |
return current value as a string | |
Protected Member Functions | |
unsigned int | findName (const char *name) |
returns the enum corresponding to name | |
Protected Attributes | |
T | val |
storage of enum value | |
const char *const * | names |
pointer to array of names -- enum value must be able to serve as index for lookup | |
unsigned int | max |
one-plus-maximum enum value, i.e. the number of enum entries if they are ordered sequentially from 0 |
|
constructor
|
|
copy constructor
|
|
constructor, pass initial value, array of strings (the names), and the one-plus-maximum enum value (i.e. the number of enumeration values if they run sequentially from 0)
|
|
automatic casting from the enumeration
|
|
returns the enum corresponding to name
Definition at line 705 of file plist.h. Referenced by plist::NamedEnumeration< T >::LoadXML(), and plist::NamedEnumeration< T >::set(). |
|
return current value as a string
Implements plist::PrimitiveBase. Definition at line 696 of file plist.h. Referenced by plist::NamedEnumeration< T >::SaveXML(). |
|
returns the one-past-maximum of enumeration values previously provided to constructor or setNames()
|
|
returns the name for a particular index
|
|
returns the array of names previously provided from constructor or setNames()
|
|
This is called when the subclass needs to update its values from those values in the parse tree. node is the current node in the tree -- it may be the root, but it may also be a subnode within the tree if a recursive structure is used Implements XMLLoadSave. |
|
value access
|
|
automatic casting to the enumeration value
|
|
assignment
|
|
assignment from string
|
|
assignment from enumeration value (numeric)
|
|
This is called when XMLLoadSave needs to have the subclass update values in the tree currently in memory -- may already be filled out by previous contents. node is the current node in the tree -- it may be the root, but it may also be a subnode within the tree if a recursive structure is used Implements XMLLoadSave. |
|
assign a new value
Implements plist::PrimitiveBase. Definition at line 687 of file plist.h. Referenced by plist::NamedEnumeration< T >::LoadXML(), and plist::NamedEnumeration< T >::operator=(). |
|
(re)set the array of names and one-plus-maximum enum value (i.e. the number of enumeration values if they run sequentially from 0)
|
|
one-plus-maximum enum value, i.e. the number of enum entries if they are ordered sequentially from 0
Definition at line 715 of file plist.h. Referenced by plist::NamedEnumeration< T >::findName(), plist::NamedEnumeration< T >::get(), plist::NamedEnumeration< T >::getMax(), plist::NamedEnumeration< T >::SaveXML(), and plist::NamedEnumeration< T >::setNames(). |
|
pointer to array of names -- enum value must be able to serve as index for lookup
Definition at line 714 of file plist.h. Referenced by plist::NamedEnumeration< T >::findName(), plist::NamedEnumeration< T >::get(), plist::NamedEnumeration< T >::getName(), plist::NamedEnumeration< T >::getNames(), plist::NamedEnumeration< T >::SaveXML(), and plist::NamedEnumeration< T >::setNames(). |
|
storage of enum value
Definition at line 713 of file plist.h. Referenced by plist::NamedEnumeration< T >::get(), plist::NamedEnumeration< T >::LoadXML(), plist::NamedEnumeration< T >::operator *(), plist::NamedEnumeration< T >::operator T(), plist::NamedEnumeration< T >::operator=(), plist::NamedEnumeration< T >::SaveXML(), and plist::NamedEnumeration< T >::set(). |
Tekkotsu v2.4.1 |
Generated Tue Aug 16 16:35:14 2005 by Doxygen 1.4.4 |