Puma::CClassDatabase Class Reference

#include <Puma/infos/CClassDatabase.h>

List of all members.


Detailed Description

A CClassDatabase object is a database of all semantic objects (infos) of a project.

Public Member Functions

 CClassDatabase (CProject &prj, int size=997)
virtual ~CClassDatabase ()
unsigned ObjectInfos () const
unsigned ClassInfos () const
unsigned UnionInfos () const
unsigned EnumInfos () const
unsigned TypedefInfos () const
unsigned FunctionInfos () const
unsigned FileInfos () const
CObjectInfo * ObjectInfo (unsigned n) const
CClassInfo * ClassInfo (unsigned n) const
CUnionInfo * UnionInfo (unsigned n) const
CEnumInfo * EnumInfo (unsigned n) const
CTypedefInfo * TypedefInfo (unsigned n) const
CFunctionInfo * FunctionInfo (unsigned n) const
CFileInfo * FileInfo (unsigned n) const
CObjectInfo * ObjectInfo (Token *pos) const
CObjectInfo * ObjectInfo (CT_Token *pos) const
void Insert (CObjectInfo *info)
void Remove (CObjectInfo *info)
CFunctionInfo * BuiltinOperator (const char *name, int tok, CTypeInfo *rtype, CTypeInfo *t0, CTypeInfo *t1)
void Dump (ostream &out, int depth=0) const
CProject * Project () const

Constructor & Destructor Documentation

Puma::CClassDatabase::CClassDatabase ( CProject &  prj,
int  size = 997 
) [inline]

Construct a class database object.

Parameters:
prj The corresponding project.
size Not used.

virtual Puma::CClassDatabase::~CClassDatabase (  )  [virtual]

Destruct the class database. Also destroys all infos in the database.


Member Function Documentation

unsigned Puma::CClassDatabase::ObjectInfos (  )  const [inline]

Get the number of semantic object infos.

unsigned Puma::CClassDatabase::ClassInfos (  )  const [inline]

Get the number of class infos.

unsigned Puma::CClassDatabase::UnionInfos (  )  const [inline]

Get the number of union infos.

unsigned Puma::CClassDatabase::EnumInfos (  )  const [inline]

Get the number of enumeration infos.

unsigned Puma::CClassDatabase::TypedefInfos (  )  const [inline]

Get the number of typedef infos.

unsigned Puma::CClassDatabase::FunctionInfos (  )  const [inline]

Get the number of function infos.

unsigned Puma::CClassDatabase::FileInfos (  )  const [inline]

Get the number of on-demand generated built-in operator functions.

CObjectInfo* Puma::CClassDatabase::ObjectInfo ( unsigned  n  )  const

Get the n-th semantic object info.

Parameters:
n The number of the info.
Returns:
The info or NULL if n is invalid.

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

Get the n-th class info.

Parameters:
n The number of the info.
Returns:
The info or NULL if n is invalid.

CUnionInfo * Puma::CClassDatabase::UnionInfo ( unsigned  n  )  const [inline]

Get the n-th union info.

Parameters:
n The number of the info.
Returns:
The info or NULL if n is invalid.

CEnumInfo * Puma::CClassDatabase::EnumInfo ( unsigned  n  )  const [inline]

Get the n-th enumeration info.

Parameters:
n The number of the info.
Returns:
The info or NULL if n is invalid.

CTypedefInfo * Puma::CClassDatabase::TypedefInfo ( unsigned  n  )  const [inline]

Get the n-th typedef info.

Parameters:
n The number of the info.
Returns:
The info or NULL if n is invalid.

CFunctionInfo * Puma::CClassDatabase::FunctionInfo ( unsigned  n  )  const [inline]

Get the n-th function info.

Parameters:
n The number of the info.
Returns:
The info or NULL if n is invalid.

CFileInfo * Puma::CClassDatabase::FileInfo ( unsigned  n  )  const [inline]

Get the n-th on-demand generated built-in operator info.

Parameters:
n The number of the info.
Returns:
The info or NULL if n is invalid.

CObjectInfo* Puma::CClassDatabase::ObjectInfo ( Token *  pos  )  const

Get the semantic object info identified by the given source code position.

Parameters:
pos The position in the source code.
Returns:
The info or NULL if the info could not be identified.

CObjectInfo* Puma::CClassDatabase::ObjectInfo ( CT_Token *  pos  )  const

Get the semantic object info identified by the given source code position.

Parameters:
pos The position in the source code.
Returns:
The info or NULL if the info could not be identified.

void Puma::CClassDatabase::Insert ( CObjectInfo *  info  ) 

Insert a new semantic object into the database.

Parameters:
info The semantic object info to insert.

void Puma::CClassDatabase::Remove ( CObjectInfo *  info  ) 

Remove the given semantic object from the database.

Parameters:
info The semantic object info to remove.

CFunctionInfo* Puma::CClassDatabase::BuiltinOperator ( const char *  name,
int  tok,
CTypeInfo *  rtype,
CTypeInfo *  t0,
CTypeInfo *  t1 
)

Get a function info object for a built-in operator.

Parameters:
name Operator name.
tok Operator token type, used as a key for fast lookup.
rtype result type of the operator. Not used for lookup, only for object creation.
t0 first argument type.
t1 second argument type or NULL.
Returns:
on-demand generated operator function object.

void Puma::CClassDatabase::Dump ( ostream &  out,
int  depth = 0 
) const

Dump the contents of the database. The dump is indented as tree corresponding to the nesting of the semantic objects.

Parameters:
out The output stream to dump to.
depth The max. depth in the tree to be dumped.

CProject * Puma::CClassDatabase::Project (  )  const [inline]

Get the project info delivered to the constructor of the database.


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