Puma Reference Manual Puma::CClassInfo Class Reference



Puma::CClassInfo Class Reference

Semantic information about a class. More...

#include <Puma/CClassInfo.h>

Inheritance diagram for Puma::CClassInfo:
Inheritance graph

List of all members.

Public Member Functions

 CClassInfo ()
 Constructor.
 ~CClassInfo ()
 Destructor.
CClassInfoDefObject () 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.
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.
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.

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.


Constructor & Destructor Documentation

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

Constructor.

Parameters:
idThe object type.

Constructor.

Destructor.

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


Member Function Documentation

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

Parameters:
oiThe semantic object for the member.

Add a base class to this class.

Parameters:
bcThe base class.

Add a derived class to this class.

Parameters:
dcThe derived class.
CBaseClassInfo * Puma::CClassInfo::BaseClass ( unsigned  n) const [inline]

Get the n-th base class.

Parameters:
nThe 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:
nameThe name of the base class.
Returns:
The base class or NULL if there is no base class with the given name.
unsigned Puma::CClassInfo::BaseClasses ( ) const [inline]

Get the number of the base classes of the class.

Get the semantic object of the class definition.

See also:
CObjectInfo::DefObject()

Reimplemented from Puma::CObjectInfo.

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

Get the n-th derived class.

Parameters:
nThe 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:
nameThe name of the derived class.
Returns:
The derived class or NULL if there is no derived class with the given name.
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.

Parameters:
dependstrue 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.

Yields true if the class has a virtual destructor.

Yields true if the class has a pure virtual function.

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.

Parameters:
baseThe base class.
recursiveIf 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:
dcThe derived class.
recursiveIf 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.

Returns:
true if empty class.

Yields true if the class declares or inherits a virtual function.

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

Create a new base class semantic object.

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

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

Parameters:
fiThe function.

Remove the given base class from this class.

Parameters:
bcThe base class.

Remove the given base class from this class.

Parameters:
bcThe base class.

Remove the given derived class from this class.

Parameters:
dcThe derived class.
CTypeClass * Puma::CClassInfo::TypeInfo ( ) const [inline]

Get the type information for the class.

Reimplemented from Puma::CObjectInfo.