Puma::CClassInfo Class Reference

#include <Puma/infos/CClassInfo.h>

Inheritance diagram for Puma::CClassInfo:

Inheritance graph

List of all members.


Detailed Description

A CClassInfo object represents a C++ 'class' or 'struct'. Most of the functionality of CClassInfo inherited by Puma::CRecord. It mainly manages the list of base classes and the list of derived classes. Note that a 'union', although syntactically very similar, is not represented by a CClassInfo object.

Public Member Functions

 CClassInfo ()
 ~CClassInfo ()
CClassInfoBaseObject () const
CClassInfoDefObject () const
CTypeClassTypeInfo () const
unsigned BaseClasses () const
unsigned DerivedClasses () const
CBaseClassInfoBaseClass (unsigned n) const
CBaseClassInfoBaseClass (const char *name) const
CClassInfoDerivedClass (unsigned n) const
CClassInfoDerivedClass (const char *name) const
bool isBaseClass (const CClassInfo *ci, bool recursive=false) const
bool isDerivedClass (const CClassInfo *ci, bool recursive=false) const
void hasDepBaseClass (bool depends)
bool hasDepBaseClass () const
void addBaseClass (CBaseClassInfo *bc)
void addDerivedClass (CClassInfo *dc)
void removeBaseClass (const CBaseClassInfo *bc)
void removeBaseClass (const CClassInfo *bc)
void removeDerivedClass (const CClassInfo *dc)
CBaseClassInfonewBaseClass (CClassInfo *bc=0)
bool isStruct () const
CProtection::Type Accessibility (CObjectInfo *oi) const
bool overridesVirtual (const CFunctionInfo *fi) const
bool isAggregate () const

Protected Member Functions

 CClassInfo (ObjectId id)

Constructor & Destructor Documentation

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

This constructor is to be used by classes inherited from CClassInfo. It makes it possible to set another object id than CLASS_INFO for abstractions not representing a standard C++ class (e.g. CClassInstance).

Parameters:
id The object id to be used instead of CLASS_INFO.

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

Construct a new CClassInfo object.

Puma::CClassInfo::~CClassInfo (  ) 

Destroy the CClassInfo object. If the object id is CLASS_INFO, Puma::CObjectInfo::CleanUp() is called.


Member Function Documentation

CClassInfo * Puma::CClassInfo::BaseObject (  )  const [inline]

Get the base info object of the info object. The corresponding information is not yet set!

Returns:
This method always returns NULL.
Warning:
Do not use this method.

Reimplemented from Puma::CObjectInfo.

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

Get the info object of the class definition.

Returns:
The info or this if the class is not defined.

Reimplemented from Puma::CObjectInfo.

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

Get the type information object 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 number of the base class to return.
Returns:
The base class info or NULL 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 to return.
Returns:
The base class info 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 number of the derived class to return.
Returns:
The class info of 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 to return.
Returns:
The class info of the derived class or NULL if there is no derived class with the given name.

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

Return true if the given class is a base class of the class.

Parameters:
ci The class info of the possible base class.
recursive If false it is only checked whether ci is a direct base class.

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

Return true if the given class is a derived class of the class.

Parameters:
ci The class info of the possible base class.
recursive If false it is only checked whether ci is directly derived from the class.

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

Mark the class to have a base class that depends on template parameters.

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

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

Return true if the class has a base class that depends on template parameters.

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

Add a base class to the class.

Parameters:
bc The base class info object.

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

Add a derived class to the class.

Parameters:
dc The class info object of the derived class.

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

Remove the given base class from the class.

Parameters:
bc The base class info object to remove.

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

Remove the given base class from the class.

Parameters:
bc The class info object of the base class to remove.

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

Remove the given derived class from the class.

Parameters:
dc The class info object of the derived class to remove.

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

Create a new base class info object.

Parameters:
bc The class info of the base class or NULL to create an empty base class info object.
Returns:
The new base class info object.

bool Puma::CClassInfo::isStruct (  )  const

Return true if the class is declared using the keyword 'struct'.

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

Returns the accessibility of a particular member or base class member. For example, if the accessibility is "private", the object can be accessed by members of this class, but not by other classes.

Parameters:
oi The object info of the checked function/attribute/...
Returns:
The accessibility, i.e. private, public, protected, or none

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

Returns true if the argument function overrides any virtual function defined in this class or any of its base classes.

Parameters:
fi function info object of the checked function.

bool Puma::CClassInfo::isAggregate (  )  const

Returns true if this class is an aggregate according to 8.5.1-1.


Generated on Sat May 10 03:03:49 2008 for Puma by  doxygen 1.5.5