Puma Reference Manual Puma: Puma::CEnumInfo Class Reference



Puma::CEnumInfo Class Reference

#include <Puma/CEnumInfo.h>

Inheritance diagram for Puma::CEnumInfo:

Inheritance graph

List of all members.


Detailed Description

Semantic information about an enumeration.


Public Member Functions

 CEnumInfo ()
 Constructor.
 ~CEnumInfo ()
 Destructor.
unsigned Enumerators () const
 Get the number of enumerators in this enumeration.
CEnumeratorInfo * Enumerator (unsigned n) const
 Get the n-th enumerator.
CEnumeratorInfo * Enumerator (const char *name) const
 Get the enumerator with the given name.
CEnumInfo * DefObject () 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.
CEnumeratorInfo * newEnumerator ()
 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.
CTypeInfo * UnderlyingType () const
 Return the underlying data type of the enumeration.
void UnderlyingType (CTypeInfo *type)
 Set the underlying data type of the enumeration.


Constructor & Destructor Documentation

Puma::CEnumInfo::CEnumInfo (  )  [inline]

Constructor.

Puma::CEnumInfo::~CEnumInfo (  ) 

Destructor.

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


Member Function Documentation

unsigned Puma::CEnumInfo::Enumerators (  )  const [inline]

Get the number of enumerators in this enumeration.

CEnumeratorInfo * Puma::CEnumInfo::Enumerator ( unsigned  n  )  const [inline]

Get the n-th enumerator.

Parameters:
n The 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:
name The name of the enumerator.
Returns:
The enumerator or NULL if no enumerator with that name.

CEnumInfo* Puma::CEnumInfo::DefObject (  )  const

Get the semantic object of the enumeration definition.

See also:
CObjectInfo::DefObject()

Reimplemented from Puma::CObjectInfo.

CTypeEnum * Puma::CEnumInfo::TypeInfo (  )  const [inline]

Get the type information for the enumeration.

Reimplemented from Puma::CObjectInfo.

void Puma::CEnumInfo::addEnumerator ( CEnumeratorInfo *  ei  ) 

Add a new enumerator to the enumeration.

Parameters:
ei The enumerator.

void Puma::CEnumInfo::removeEnumerator ( const CEnumeratorInfo *  ei  ) 

Remove the given enumerator from the enumeration.

Parameters:
ei The enumerator.

CEnumeratorInfo* Puma::CEnumInfo::newEnumerator (  ) 

Create a semantic object for an enumerator.

The new enumerator is added to the enumeration.

void Puma::CEnumInfo::deleteEnumerator ( const CEnumeratorInfo *  ei  ) 

Destroy the given enumerator.

The enumerator is removed from the enumeration.

Parameters:
ei The enumerator.

bool Puma::CEnumInfo::isDefined (  )  const

Check if the enumeration is defined.

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:
pos The source code position.

CTypeInfo * Puma::CEnumInfo::UnderlyingType (  )  const [inline]

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:
type The underlying type.




Puma Reference Manual. Created on 11 Jul 2008.