Puma Reference Manual Puma: Puma::CClassInfo Class Reference



Puma::CClassInfo Class Reference

#include <Puma/CClassInfo.h>

Inheritance diagram for Puma::CClassInfo:

Inheritance graph

List of all members.


Detailed Description

Semantic information about a class.

Note that 'struct's are ordinary classes where the member access type defaults to public. Note also that a 'union', although syntactically very similar, is not a class and thus not represented by CClassInfo.

Public Member Functions

 CClassInfo ()
 Constructor.
 ~CClassInfo ()
 Destructor.
CClassInfoDefObject () const
 Get the semantic object of the class definition.
CTypeClassTypeInfo () const
 Get the type information for the class.
unsigned BaseClasses () const
 Get the number of the base classes of the class.
unsigned DerivedClasses () const
 Get the number of classes derived from the class.
CBaseClassInfoBaseClass (unsigned n) const
 Get the n-th base class.
CBaseClassInfoBaseClass (const char *name) const
 Get the base class with the given name.
CClassInfoDerivedClass (unsigned n) const
 Get the n-th derived class.
CClassInfoDerivedClass (const char *name) const
 Get the derived class with the given name.
bool isBaseClass (const CClassInfo *base, bool recursive=false) const
 Check if the given class is a base class of this class.
bool isDerivedClass (const CClassInfo *dc, bool recursive=false) const
 Check if the given class is derived from this class.
void hasDepBaseClass (bool depends)
 Set that this class has a base class that depends on template parameters.
bool hasDepBaseClass () const
 Check if this class has a base class that depends on template parameters.
void addBaseClass (CBaseClassInfo *bc)
 Add a base class to this class.
void addDerivedClass (CClassInfo *dc)
 Add a derived class to this class.
void removeBaseClass (const CBaseClassInfo *bc)
 Remove the given base class from this class.
void removeBaseClass (const CClassInfo *bc)
 Remove the given base class from this class.
void removeDerivedClass (const CClassInfo *dc)
 Remove the given derived class from this class.
CBaseClassInfonewBaseClass (CClassInfo *bc=0)
 Create a new base class semantic object.
bool isStruct () const
 Check if the class is declared using keyword 'struct'.
CProtection::Type Accessibility (CObjectInfo *oi) const
 Get the accessibility of a particular member or base class member.
bool overridesVirtual (const CFunctionInfo *fi) const
 Check if the given function overrides any virtual function defined in this class or any of its base classes.
bool isAggregate () const
 Check if this class is an aggregate according to paragraph 8.5.1-1 of the ISO C++ standard.

Protected Member Functions

 CClassInfo (ObjectId id)
 Constructor.


Constructor & Destructor Documentation

Puma::CClassInfo::CClassInfo ( ObjectId  id  )  [inline, protected]

Constructor.

Parameters:
id The object type.

Puma::CClassInfo::CClassInfo (  )  [inline]

Constructor.

Puma::CClassInfo::~CClassInfo (  ) 

Destructor.

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


Member Function Documentation

CClassInfo* Puma::CClassInfo::DefObject (  )  const

Get the semantic object of the class definition.

See also:
CObjectInfo::DefObject()

Reimplemented from Puma::CObjectInfo.

CTypeClass * Puma::CClassInfo::TypeInfo (  )  const [inline]

Get the type information for the class.

Reimplemented from Puma::CObjectInfo.

unsigned Puma::CClassInfo::BaseClasses (  )  const [inline]

Get the number of the base classes of the class.

unsigned Puma::CClassInfo::DerivedClasses (  )  const [inline]

Get the number of classes derived from the class.

CBaseClassInfo * Puma::CClassInfo::BaseClass ( unsigned  n  )  const [inline]

Get the n-th base class.

Parameters:
n The index of the base class.
Returns:
The base class or if n is not valid.

CBaseClassInfo* Puma::CClassInfo::BaseClass ( const char *  name  )  const

Get the base class with the given name.

Parameters:
name The name of the base class.
Returns:
The base class or NULL if there is no base class with the given name.

CClassInfo * Puma::CClassInfo::DerivedClass ( unsigned  n  )  const [inline]

Get the n-th derived class.

Parameters:
n The index of the derived class.
Returns:
The derived class or NULL if n is not valid.

CClassInfo* Puma::CClassInfo::DerivedClass ( const char *  name  )  const

Get the derived class with the given name.

Parameters:
name The name of the derived class.
Returns:
The derived class or NULL if there is no derived class with the given name.

bool Puma::CClassInfo::isBaseClass ( const CClassInfo base,
bool  recursive = false 
) const

Check if the given class is a base class of this class.

Parameters:
base The base class.
recursive If false then only the direct base classes are considered.

bool Puma::CClassInfo::isDerivedClass ( const CClassInfo dc,
bool  recursive = false 
) const

Check if the given class is derived from this class.

Parameters:
dc The derived class.
recursive If false then only the directly derived classes are considered.

void Puma::CClassInfo::hasDepBaseClass ( bool  depends  )  [inline]

Set that this class has a base class that depends on template parameters.

Parameters:
depends true if there is a dependent base class.

bool Puma::CClassInfo::hasDepBaseClass (  )  const [inline]

Check if this class has a base class that depends on template parameters.

void Puma::CClassInfo::addBaseClass ( CBaseClassInfo bc  ) 

Add a base class to this class.

Parameters:
bc The base class.

void Puma::CClassInfo::addDerivedClass ( CClassInfo dc  ) 

Add a derived class to this class.

Parameters:
dc The derived class.

void Puma::CClassInfo::removeBaseClass ( const CBaseClassInfo bc  ) 

Remove the given base class from this class.

Parameters:
bc The base class.

void Puma::CClassInfo::removeBaseClass ( const CClassInfo bc  ) 

Remove the given base class from this class.

Parameters:
bc The base class.

void Puma::CClassInfo::removeDerivedClass ( const CClassInfo dc  ) 

Remove the given derived class from this class.

Parameters:
dc The derived class.

CBaseClassInfo* Puma::CClassInfo::newBaseClass ( CClassInfo bc = 0  ) 

Create a new base class semantic object.

Parameters:
bc The semantic information about the of the base class or NULL to create an empty base class semantic object.

bool Puma::CClassInfo::isStruct (  )  const

Check if the class is declared using keyword 'struct'.

CProtection::Type Puma::CClassInfo::Accessibility ( CObjectInfo oi  )  const

Get the accessibility of a particular member or base class member.

Parameters:
oi The semantic object for the member.

bool Puma::CClassInfo::overridesVirtual ( const CFunctionInfo fi  )  const

Check if the given function overrides any virtual function defined in this class or any of its base classes.

Parameters:
fi The function.

bool Puma::CClassInfo::isAggregate (  )  const

Check if this class is an aggregate according to paragraph 8.5.1-1 of the ISO C++ standard.




Puma Reference Manual. Created on 5 Nov 2008.