Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

EnumLink Class Reference
[Data classes]

Represents an element in an Enumeration set. More...

#include <Enum.h>

Inheritance diagram for EnumLink:

BaseType Enum< E > Enum< InterpolatedData< float >::Method > List of all members.

Public Methods

 EnumLink (Enumeration const &E)
 EnumLink (Enumeration const &E, int value)
 EnumLink (Enumeration const &E, std::string const &token)
virtual void serialize (Archive &)
 Serialize to or from a data archive.

virtual void parseXML (const char *cdata)
 For internal use by the XML parser.

virtual std::string typeString () const
 Return a type label.

virtual std::string asString () const
 Return a string representation.

 EnumLink (EnumLink const &e)
 copy constructor

void cycle (int n=1)
 Cyclically advance the index (default is by one).

void cycleBack (int n=1)
 Cyclically reduce the index (default is by one).

void set (std::string const &token)
 Set this enum by token.

void set (int value)
 Set this enum by integer index.

int getValue () const
 Get the integer index of this enum.

std::string getToken () const
std::string __repr__ () const
 Return a string representation (for SWIG/Python).

EnumLink next (int n=1) const
 Return a new Enum for the next item in the Enumeration (cyclic).

EnumLink prev (int n=1) const
 Return a new Enum for to the previous item in the Enumeration (cyclic).

EnumLink last () const
 Return the last item in the Enumeration.

EnumLink first () const
 Return the first item in the Enumeration.

Enumeration const & getEnumeration () const
 Return a reference to the associated Enumeration.

 operator int () const
 Coerce this enum to its integer index.

 operator std::string () const
 Coerce this enum to its token.

EnumLink const & operator= (int value)
 Directly assign by integer index.

EnumLink const & operator= (std::string const &token)
 Directly assign by token.

EnumLink const & operator= (EnumLink const &e)
 copy

bool operator> (std::string const &token) const
 Compare with the value of another Enumeration element.

bool operator< (std::string const &token) const
 Compare with the value of another Enumeration element.

bool operator>= (std::string const &token) const
 Compare with the value of another Enumeration element.

bool operator<= (std::string const &token) const
 Compare with the value of another Enumeration element.

bool operator== (std::string const &token) const
 Compare with the value of another Enumeration element.

bool operator!= (std::string const &token) const
 Compare with the value of another Enumeration element.

bool operator> (int value) const
 Compare with the value of another Enumeration element.

bool operator< (int value) const
 Compare with the value of another Enumeration element.

bool operator>= (int value) const
 Compare with the value of another Enumeration element.

bool operator<= (int value) const
 Compare with the value of another Enumeration element.

bool operator== (int value) const
 Compare with the value of another Enumeration element.

bool operator!= (int value) const
 Compare with the value of another Enumeration element.

bool operator> (EnumLink const &x) const
 Compare with the value of another Enumeration element.

bool operator< (EnumLink const &x) const
 Compare with the value of another Enumeration element.

bool operator>= (EnumLink const &x) const
 Compare with the value of another Enumeration element.

bool operator<= (EnumLink const &x) const
 Compare with the value of another EnumLinkeration element.

bool operator== (EnumLink const &x) const
 Compare with the value of another EnumLinkeration element.

bool operator!= (EnumLink const &x) const
 Compare with the value of another EnumLinkeration element.

virtual void convertXML ()
 Convert XML data to internal format prior to serialization.


Protected Methods

int __size () const
 Get the number of items in the associated Enumeration.

 EnumLink ()
 The default constructor creates an unbound EnumLink.

int getIndex () const
 Get the enumeration index of the enum.

 EnumLink (int idx, Enumeration const &E)
 Construct a new EnumLink bound to a given Enumeration.

EnumLink makeEnum (int idx) const
 Construct a new EnumLink bound to the current Enumeration.


Protected Attributes

int _idx
 the index of the enum


Friends

class Enumeration

Detailed Description

Represents an element in an Enumeration set.

This class is used internally to return Enum instances from an Enumeration, which is unable to directly create templated Enum instances. EnumLinks can also be used to create Enums on the fly by specifying an existing Enumeration in the constructor. EnumLink's and Enum templates can be used interchangeably.


Constructor & Destructor Documentation

EnumLink::EnumLink   [inline, protected]
 

The default constructor creates an unbound EnumLink.

EnumLink::EnumLink int    idx,
Enumeration const &    E
[inline, protected]
 

Construct a new EnumLink bound to a given Enumeration.

EnumLink::EnumLink Enumeration const &    E [inline]
 

EnumLink::EnumLink Enumeration const &    E,
int    value
[inline]
 

EnumLink::EnumLink Enumeration const &    E,
std::string const &    token
[inline]
 

EnumLink::EnumLink EnumLink const &    e [inline]
 

copy constructor


Member Function Documentation

std::string EnumLink::__repr__   const [inline]
 

Return a string representation (for SWIG/Python).

Reimplemented in Enum< E >, Enum< InterpolatedData< float >::Method >, and Enum< InterpolatedData< T >::Method >.

int EnumLink::__size   const [inline, protected]
 

Get the number of items in the associated Enumeration.

std::string EnumLink::asString   [virtual]
 

Return a string representation.

Implements BaseType.

void BaseType::convertXML   [virtual, inherited]
 

Convert XML data to internal format prior to serialization.

This method is currently only called by the XML parser for Object classes. If another BaseType class requires this method, a call must be added to the appropriate XML handler in the parser.

void EnumLink::cycle int    n = 1 [inline]
 

Cyclically advance the index (default is by one).

void EnumLink::cycleBack int    n = 1 [inline]
 

Cyclically reduce the index (default is by one).

EnumLink EnumLink::first   const [inline]
 

Return the first item in the Enumeration.

Enumeration const& EnumLink::getEnumeration   const [inline]
 

Return a reference to the associated Enumeration.

int EnumLink::getIndex   const [inline, protected]
 

Get the enumeration index of the enum.

std::string EnumLink::getToken   const [inline]
 

int EnumLink::getValue   const [inline]
 

Get the integer index of this enum.

EnumLink EnumLink::last   const [inline]
 

Return the last item in the Enumeration.

EnumLink EnumLink::makeEnum int    idx const [inline, protected]
 

Construct a new EnumLink bound to the current Enumeration.

EnumLink EnumLink::next int    n = 1 const [inline]
 

Return a new Enum for the next item in the Enumeration (cyclic).

EnumLink::operator int   const [inline]
 

Coerce this enum to its integer index.

EnumLink::operator std::string   const [inline]
 

Coerce this enum to its token.

bool EnumLink::operator!= EnumLink const &    x const [inline]
 

Compare with the value of another EnumLinkeration element.

bool EnumLink::operator!= int    value const [inline]
 

Compare with the value of another Enumeration element.

bool EnumLink::operator!= std::string const &    token const [inline]
 

Compare with the value of another Enumeration element.

bool EnumLink::operator< EnumLink const &    x const [inline]
 

Compare with the value of another Enumeration element.

bool EnumLink::operator< int    value const [inline]
 

Compare with the value of another Enumeration element.

bool EnumLink::operator< std::string const &    token const [inline]
 

Compare with the value of another Enumeration element.

bool EnumLink::operator<= EnumLink const &    x const [inline]
 

Compare with the value of another EnumLinkeration element.

bool EnumLink::operator<= int    value const [inline]
 

Compare with the value of another Enumeration element.

bool EnumLink::operator<= std::string const &    token const [inline]
 

Compare with the value of another Enumeration element.

EnumLink const& EnumLink::operator= EnumLink const &    e [inline]
 

copy

Reimplemented in Enum< E >, Enum< InterpolatedData< float >::Method >, and Enum< InterpolatedData< T >::Method >.

EnumLink const& EnumLink::operator= std::string const &    token [inline]
 

Directly assign by token.

Reimplemented in Enum< E >, Enum< InterpolatedData< float >::Method >, and Enum< InterpolatedData< T >::Method >.

EnumLink const& EnumLink::operator= int    value [inline]
 

Directly assign by integer index.

Reimplemented in Enum< E >, Enum< InterpolatedData< float >::Method >, and Enum< InterpolatedData< T >::Method >.

bool EnumLink::operator== EnumLink const &    x const [inline]
 

Compare with the value of another EnumLinkeration element.

bool EnumLink::operator== int    value const [inline]
 

Compare with the value of another Enumeration element.

bool EnumLink::operator== std::string const &    token const [inline]
 

Compare with the value of another Enumeration element.

bool EnumLink::operator> EnumLink const &    x const [inline]
 

Compare with the value of another Enumeration element.

bool EnumLink::operator> int    value const [inline]
 

Compare with the value of another Enumeration element.

bool EnumLink::operator> std::string const &    token const [inline]
 

Compare with the value of another Enumeration element.

bool EnumLink::operator>= EnumLink const &    x const [inline]
 

Compare with the value of another Enumeration element.

bool EnumLink::operator>= int    value const [inline]
 

Compare with the value of another Enumeration element.

bool EnumLink::operator>= std::string const &    token const [inline]
 

Compare with the value of another Enumeration element.

void EnumLink::parseXML const char *    cdata [virtual]
 

For internal use by the XML parser.

Reimplemented from BaseType.

EnumLink EnumLink::prev int    n = 1 const [inline]
 

Return a new Enum for to the previous item in the Enumeration (cyclic).

NAMESPACE_SIMDATA void EnumLink::serialize Archive   [virtual]
 

Serialize to or from a data archive.

Reimplemented from BaseType.

void EnumLink::set int    value [inline]
 

Set this enum by integer index.

void EnumLink::set std::string const &    token [inline]
 

Set this enum by token.

std::string EnumLink::typeString   [virtual]
 

Return a type label.

Implements BaseType.


Friends And Related Function Documentation

friend class Enumeration [friend]
 


Member Data Documentation

int EnumLink::_idx [protected]
 

the index of the enum


The documentation for this class was generated from the following files:
SimData version pre-0.4.0. For more information on SimData, visit the SimData Homepage.

Generated on Tue Oct 14 12:06:40 2003, using Doxygen 1.2.18.

[SF.net]