Puma Reference Manual Puma::CEnumInfo Class Reference



Puma::CEnumInfo Class Reference

Semantic information about an enumeration. More...

#include <Puma/CEnumInfo.h>

Inheritance diagram for Puma::CEnumInfo:
Inheritance graph

List of all members.

Public Member Functions

 CEnumInfo ()
 Constructor.
 ~CEnumInfo ()
 Destructor.
unsigned Enumerators () const
 Get the number of enumerators in this enumeration.
CEnumeratorInfoEnumerator (unsigned n) const
 Get the n-th enumerator.
CEnumeratorInfoEnumerator (const char *name) const
 Get the enumerator with the given name.
CEnumInfoDefObject () const
 Get the semantic object of the enumeration definition.
CTypeEnum * TypeInfo () const
 Get the type information for the enumeration.
void addEnumerator (CEnumeratorInfo *ei)
 Add a new enumerator to the enumeration.
void removeEnumerator (const CEnumeratorInfo *ei)
 Remove the given enumerator from the enumeration.
CEnumeratorInfonewEnumerator ()
 Create a semantic object for an enumerator.
void deleteEnumerator (const CEnumeratorInfo *ei)
 Destroy the given enumerator.
bool isDefined () const
 Check if the enumeration is defined.
bool isComplete (unsigned long pos=0) const
 Check if the enumeration is complete (defined) at the given source code position.
CTypeInfoUnderlyingType () const
 Return the underlying data type of the enumeration.
void UnderlyingType (CTypeInfo *type)
 Set the underlying data type of the enumeration.

Detailed Description

Semantic information about an enumeration.


Constructor & Destructor Documentation

Constructor.

Destructor.

If the object type is CObjectInfo::ENUM_INFO, then CObjectInfo::CleanUp() is called.


Member Function Documentation

Add a new enumerator to the enumeration.

Parameters:
eiThe enumerator.

Get the semantic object of the enumeration definition.

See also:
CObjectInfo::DefObject()

Reimplemented from Puma::CObjectInfo.

Destroy the given enumerator.

The enumerator is removed from the enumeration.

Parameters:
eiThe enumerator.
CEnumeratorInfo * Puma::CEnumInfo::Enumerator ( unsigned  n) const [inline]

Get the n-th enumerator.

Parameters:
nThe index of the enumerator.
Returns:
The enumerator or NULL if n is invalid.
CEnumeratorInfo* Puma::CEnumInfo::Enumerator ( const char *  name) const

Get the enumerator with the given name.

Parameters:
nameThe name of the enumerator.
Returns:
The enumerator or NULL if no enumerator with that name.
unsigned Puma::CEnumInfo::Enumerators ( ) const [inline]

Get the number of enumerators in this enumeration.

bool Puma::CEnumInfo::isComplete ( unsigned long  pos = 0) const

Check if the enumeration is complete (defined) at the given source code position.

The position is specified by the unique number of the CT_Token tree node representing the name of the enumeration.

Parameters:
posThe source code position.

Check if the enumeration is defined.

Create a semantic object for an enumerator.

The new enumerator is added to the enumeration.

Remove the given enumerator from the enumeration.

Parameters:
eiThe enumerator.
CTypeEnum * Puma::CEnumInfo::TypeInfo ( ) const [inline]

Get the type information for the enumeration.

Reimplemented from Puma::CObjectInfo.

Return the underlying data type of the enumeration.

This is implementation-defined and defaults to int.

void Puma::CEnumInfo::UnderlyingType ( CTypeInfo type) [inline]

Set the underlying data type of the enumeration.

This is implementation-defined and defaults to int.

Parameters:
typeThe underlying type.