Puma Reference Manual Puma: Puma::CClassInfo Class Reference



Puma::CClassInfo Class Reference

Semantic information about a class. More...

#include <Puma/CClassInfo.h>

Inherits Puma::CRecord.

Inherited by Puma::CClassInstance.

List of all members.

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

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.
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.
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.
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.
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.

See also:
CObjectInfo::DefObject()

Reimplemented from Puma::CObjectInfo.

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.
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.
unsigned Puma::CClassInfo::DerivedClasses (  )  const [inline]

Get the number of classes derived from the class.

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

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

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

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.
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.
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.

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

Parameters:
fi The function.
void Puma::CClassInfo::removeBaseClass ( const CClassInfo bc  ) 

Remove the given base class from this class.

Parameters:
bc The base class.
void Puma::CClassInfo::removeBaseClass ( const CBaseClassInfo 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.
CTypeClass * Puma::CClassInfo::TypeInfo (  )  const [inline]

Get the type information for the class.

Reimplemented from Puma::CObjectInfo.




Puma Reference Manual. Created on 11 Sep 2009.