Puma Reference Manual | Puma: Puma::CClassInfo Class Reference |
Semantic information about a class. More...
#include <Puma/CClassInfo.h>
Public Member Functions | |
CClassInfo () | |
Constructor. | |
~CClassInfo () | |
Destructor. | |
CClassInfo * | DefObject () const |
Get the semantic object of the class definition. | |
CTypeClass * | TypeInfo () 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. | |
CBaseClassInfo * | BaseClass (unsigned n) const |
Get the n-th base class. | |
CBaseClassInfo * | BaseClass (const char *name) const |
Get the base class with the given name. | |
CClassInfo * | DerivedClass (unsigned n) const |
Get the n-th derived class. | |
CClassInfo * | DerivedClass (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. | |
CBaseClassInfo * | newBaseClass (CClassInfo *bc=0) |
Create a new base class semantic object. | |
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 | isStruct () const |
Check if the class is declared using keyword 'struct'. | |
bool | isAggregate () const |
Check if this class is an aggregate according to paragraph 8.5.1-1 of the ISO C++ standard. | |
bool | isEmpty () const |
Yields true if the class has no non-static data members other than bit-fields of length 0, no virtual member functions, no virtual base classes, and no base class B for which isEmpty() is false. | |
bool | isPolymorphic () const |
Yields true if the class declares or inherits a virtual function. | |
bool | isAbstract () const |
Yields true if the class has a pure virtual function. | |
bool | hasVirtualDtor () const |
Yields true if the class has a virtual destructor. | |
Protected Member Functions | |
CClassInfo (ObjectId id) | |
Constructor. |
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.
Puma::CClassInfo::CClassInfo | ( | ObjectId | id | ) | [inline, protected] |
Constructor.
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.
CProtection::Type Puma::CClassInfo::Accessibility | ( | CObjectInfo * | oi | ) | const |
Get the accessibility of a particular member or base class member.
oi | The semantic object for the member. |
void Puma::CClassInfo::addBaseClass | ( | CBaseClassInfo * | bc | ) |
Add a base class to this class.
bc | The base class. |
void Puma::CClassInfo::addDerivedClass | ( | CClassInfo * | dc | ) |
Add a derived class to this class.
dc | The derived class. |
CBaseClassInfo* Puma::CClassInfo::BaseClass | ( | const char * | name | ) | const |
Get the base class with the given name.
name | The name of the base class. |
CBaseClassInfo * Puma::CClassInfo::BaseClass | ( | unsigned | n | ) | const [inline] |
Get the n-th base class.
n | The index of the base class. |
unsigned Puma::CClassInfo::BaseClasses | ( | ) | const [inline] |
Get the number of the base classes of the class.
CClassInfo* Puma::CClassInfo::DefObject | ( | ) | const |
Get the semantic object of the class definition.
Reimplemented from Puma::CObjectInfo.
CClassInfo* Puma::CClassInfo::DerivedClass | ( | const char * | name | ) | const |
Get the derived class with the given name.
name | The name of the derived class. |
CClassInfo * Puma::CClassInfo::DerivedClass | ( | unsigned | n | ) | const [inline] |
Get the n-th derived class.
n | The index of the derived class. |
unsigned Puma::CClassInfo::DerivedClasses | ( | ) | const [inline] |
Get the number of classes derived from the class.
void Puma::CClassInfo::hasDepBaseClass | ( | bool | depends | ) | [inline] |
Set that this class has a base class that depends on template 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.
bool Puma::CClassInfo::hasVirtualDtor | ( | ) | const |
Yields true if the class has a virtual destructor.
bool Puma::CClassInfo::isAbstract | ( | ) | const |
Yields true if the class has a pure virtual 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.
bool Puma::CClassInfo::isBaseClass | ( | const CClassInfo * | base, |
bool | recursive = false |
||
) | const |
Check if the given class is a base class of this class.
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.
dc | The derived class. |
recursive | If false then only the directly derived classes are considered. |
bool Puma::CClassInfo::isEmpty | ( | ) | const |
Yields true if the class has no non-static data members other than bit-fields of length 0, no virtual member functions, no virtual base classes, and no base class B for which isEmpty() is false.
bool Puma::CClassInfo::isPolymorphic | ( | ) | const |
Yields true if the class declares or inherits a virtual function.
bool Puma::CClassInfo::isStruct | ( | ) | const |
Check if the class is declared using keyword 'struct'.
CBaseClassInfo* Puma::CClassInfo::newBaseClass | ( | CClassInfo * | bc = 0 | ) |
Create a new base class semantic object.
bc | The semantic information about the of the base class or NULL to create an empty base class semantic object. |
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.
fi | The function. |
void Puma::CClassInfo::removeBaseClass | ( | const CBaseClassInfo * | bc | ) |
Remove the given base class from this class.
bc | The base class. |
void Puma::CClassInfo::removeBaseClass | ( | const CClassInfo * | bc | ) |
Remove the given base class from this class.
bc | The base class. |
void Puma::CClassInfo::removeDerivedClass | ( | const CClassInfo * | dc | ) |
Remove the given derived class from this class.
dc | The derived class. |
CTypeClass * Puma::CClassInfo::TypeInfo | ( | ) | const [inline] |
Get the type information for the class.
Reimplemented from Puma::CObjectInfo.