Puma Reference Manual Puma: Puma::CEnumInfo Class Reference



Puma::CEnumInfo Class Reference

Semantic information about an enumeration. More...

#include <Puma/CEnumInfo.h>

Inherits Puma::CScopeRequest.

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.
CTypeEnumTypeInfo () 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

Puma::CEnumInfo::CEnumInfo (  ) 

Constructor.

Puma::CEnumInfo::~CEnumInfo (  ) 

Destructor.

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


Member Function Documentation

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

Add a new enumerator to the enumeration.

Parameters:
ei The enumerator.
CEnumInfo* Puma::CEnumInfo::DefObject (  )  const

Get the semantic object of the enumeration definition.

See also:
CObjectInfo::DefObject()

Reimplemented from Puma::CObjectInfo.

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

Destroy the given enumerator.

The enumerator is removed from the enumeration.

Parameters:
ei The enumerator.
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.
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.
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:
pos The source code position.
bool Puma::CEnumInfo::isDefined (  )  const

Check if the enumeration is defined.

CEnumeratorInfo* Puma::CEnumInfo::newEnumerator (  ) 

Create a semantic object for an enumerator.

The new enumerator is added to the enumeration.

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

Remove the given enumerator from the enumeration.

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

Get the type information for the enumeration.

Reimplemented from Puma::CObjectInfo.

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.
CTypeInfo * Puma::CEnumInfo::UnderlyingType (  )  const [inline]

Return the underlying data type of the enumeration.

This is implementation-defined and defaults to int.




Puma Reference Manual. Created on 11 Sep 2009.