Puma Reference Manual Puma: Puma::CStructure Class Reference



Puma::CStructure Class Reference

#include <Puma/CStructure.h>

Inheritance diagram for Puma::CStructure:

Inheritance graph

List of all members.


Detailed Description

Base class of all semantic information classes for entities that can contain other entity declarations (like classes, namespaces, functions).


Public Types

typedef list< CObjectInfo * > ObjectInfoList
 List type for semantic objects.
typedef map< DString,
ObjectInfoList
ObjectsByName
 Map type for entity name to semantic object mapping.
typedef set< CObjectInfo * > ObjectInfoSet
 Set type for semantic objects.

Public Member Functions

 ~CStructure ()
 Destructor.
ObjectsByNameObjectInfoMap ()
 Get the entity name to semantic object map.
const ObjectInfoSetObjectInfos () const
 Get the entity name to semantic object map.
unsigned Objects () const
 Get the number of contained semantic objects.
unsigned Objects (const DString &name) const
 Get the number of contained semantic objects for entities with the given name.
unsigned Types () const
 Get the number of contained semantic objects for type declarations.
unsigned Types (const DString &name) const
 Get the number of contained semantic objects for declarations of types with the given name.
unsigned Attributes () const
 Get the number of contained semantic objects for object declarations.
unsigned Attributes (const DString &name) const
 Get the number of contained semantic objects for declarations of objects with the given name.
unsigned TemplateParams () const
 Get the number of contained semantic objects for template parameter declarations.
unsigned TemplateParams (const DString &name) const
 Get the number of contained semantic objects for declarations of template parameters with the given name.
unsigned Functions () const
 Get the number of contained semantic objects for function declarations.
unsigned Functions (const DString &name) const
 Get the number of contained semantic objects for declarations of functions with the given name.
unsigned Usings () const
 Get the number of contained semantic objects for used members.
unsigned Usings (const DString &name) const
 Get the number of contained semantic objects for used members with the given name.
unsigned Namespaces () const
 Get the number of contained semantic objects for namespace declarations.
unsigned Namespaces (const DString &name) const
 Get the number of contained semantic objects for declarations of namespaces with the given name.
unsigned Friends () const
 Get the number of contained semantic objects for friend declarations.
unsigned Friends (const DString &name) const
 Get the number of contained semantic objects for declarations of friends with the given name.
CObjectInfoObject (unsigned n) const
 Get the n-th contained semantic object.
CObjectInfoObject (const DString &name, unsigned n=0) const
 Get the n-th contained semantic object for entities with the given name.
CObjectInfoType (unsigned n) const
 Get the n-th contained semantic object for a type.
CObjectInfoType (const DString &name, unsigned n=0) const
 Get the n-th contained semantic object for types with the given name.
CUsingInfoUsing (unsigned n) const
 Get the n-th contained semantic object for a using-directive.
CUsingInfoUsing (const DString &name, unsigned n=0) const
 Get the n-th contained semantic object for used members with the given name.
CNamespaceInfoNamespace (unsigned n) const
 Get the n-th contained semantic object for a namespace.
CNamespaceInfoNamespace (const DString &name, unsigned n=0) const
 Get the n-th contained semantic object for namespaces with the given name.
CRecordFriend (unsigned n) const
 Get the n-th contained semantic object for a friend.
CRecordFriend (const DString &name, unsigned n=0) const
 Get the n-th contained semantic object for friends with the given name.
CAttributeInfoAttribute (unsigned n) const
 Get the n-th contained semantic object for an object.
CAttributeInfoAttribute (const DString &name, unsigned n=0) const
 Get the n-th contained semantic object for objects with the given name.
CTemplateParamInfoTemplateParam (unsigned n) const
 Get the n-th contained semantic object for a template parameter.
CTemplateParamInfoTemplateParam (const DString &name, unsigned n=0) const
 Get the n-th contained semantic object for template parameters with the given name.
CFunctionInfoFunction (unsigned n) const
 Get the n-th contained semantic object for a function.
CFunctionInfoFunction (const DString &name, unsigned n=0) const
 Get the n-th contained semantic object for functions with the given name.
CFunctionInfoFunction (const DString &name, CTypeInfo *type) const
 Get the contained semantic object for functions with the given name and type.
bool isMemberAlias (const CObjectInfo *info) const
 Check if an alias exists for the given entity in this scope.
CMemberAliasInfoMemberAlias (const CObjectInfo *info) const
 Get the member alias information for the aliased entity.
void setShared (CStructure *share)
 Set a common data object for the linked semantic objects.
void addObject (CObjectInfo *info)
 Add a semantic object.
void addAttribute (CAttributeInfo *info)
 Add a semantic object for an object.
void addTemplateParam (CTemplateParamInfo *info)
 Add a semantic object for a template parameter.
void addFunction (CFunctionInfo *info)
 Add a semantic object for a function.
void addType (CObjectInfo *info)
 Add a semantic object for a type.
void addUsing (CUsingInfo *info)
 Add a semantic object for a using-directive.
void addNamespace (CNamespaceInfo *info)
 Add a semantic object for a namespace.
void addFriend (CRecord *info)
 Add a semantic object for a friend.
void removeObject (const CObjectInfo *info)
 Remove the semantic object.
void removeAttribute (const CAttributeInfo *info)
 Remove the semantic object for an object.
void removeTemplateParam (const CTemplateParamInfo *info)
 Remove the semantic object for a template parameter.
void removeFunction (const CFunctionInfo *info)
 Remove the semantic object for a function.
void removeType (const CObjectInfo *info)
 Remove the semantic object for a type.
void removeUsing (const CUsingInfo *info)
 Remove the semantic object for a using-directive.
void removeNamespace (const CNamespaceInfo *info)
 Remove the semantic object for a namespace.
void removeFriend (const CRecord *info)
 Remove the semantic object for a friend.
void removeMemberAlias (const CMemberAliasInfo *info)
 Remove the semantic object for a member alias.
void removeRegisterEntry ()
 Unregister this semantic object at all contained semantic objects.
void addObjectName (CObjectInfo *info)
 Add a semantic object to the name map.
void removeObjectName (const DString &name, CObjectInfo *info)
 Remove the given semantic object for the entity with the given name from the name map.
CAttributeInfonewAttribute ()
 Create a new semantic object for an object declaration.
CEnumInfonewEnum ()
 Create a new semantic object for an enumeration.
CUsingInfonewUsing ()
 Create a new semantic object for a using-directive.
CTypedefInfonewTypedef ()
 Create a new semantic object for a typedef.
CMemberAliasInfonewMemberAlias (CObjectInfo *member)
 Create a new semantic object for a member alias.
void deleteAttribute (const CAttributeInfo *info)
 Remove and destroy the given semantic object for an object.
void deleteEnum (const CEnumInfo *info)
 Remove and destroy the given semantic object for an enumeration.
void deleteUsing (const CUsingInfo *info)
 Remove and destroy the given semantic object for a using-directive.
void deleteTypedef (const CTypedefInfo *info)
 Remove and destroy the given semantic object for a typedef.
void deleteMemberAlias (const CMemberAliasInfo *info)
 Remove and destroy the given semantic object for a member alias.

Protected Member Functions

 CStructure (ObjectId id)
 Constructor.


Member Typedef Documentation

List type for semantic objects.

Map type for entity name to semantic object mapping.

Set type for semantic objects.


Constructor & Destructor Documentation

Puma::CStructure::CStructure ( CObjectInfo::ObjectId  id  )  [inline, protected]

Constructor.

Parameters:
id The object type.

Puma::CStructure::~CStructure (  ) 

Destructor.


Member Function Documentation

ObjectsByName& Puma::CStructure::ObjectInfoMap (  )  [inline]

Get the entity name to semantic object map.

const ObjectInfoSet& Puma::CStructure::ObjectInfos (  )  const [inline]

Get the entity name to semantic object map.

unsigned Puma::CStructure::Objects (  )  const [inline]

Get the number of contained semantic objects.

unsigned Puma::CStructure::Objects ( const DString name  )  const

Get the number of contained semantic objects for entities with the given name.

Parameters:
name The name of the entity.

unsigned Puma::CStructure::Types (  )  const [inline]

Get the number of contained semantic objects for type declarations.

unsigned Puma::CStructure::Types ( const DString name  )  const

Get the number of contained semantic objects for declarations of types with the given name.

Parameters:
name The name of the type.

unsigned Puma::CStructure::Attributes (  )  const [inline]

Get the number of contained semantic objects for object declarations.

unsigned Puma::CStructure::Attributes ( const DString name  )  const

Get the number of contained semantic objects for declarations of objects with the given name.

Parameters:
name The name of the object.

unsigned Puma::CStructure::TemplateParams (  )  const [inline]

Get the number of contained semantic objects for template parameter declarations.

unsigned Puma::CStructure::TemplateParams ( const DString name  )  const

Get the number of contained semantic objects for declarations of template parameters with the given name.

Parameters:
name The name of the template parameter.

unsigned Puma::CStructure::Functions (  )  const [inline]

Get the number of contained semantic objects for function declarations.

unsigned Puma::CStructure::Functions ( const DString name  )  const

Get the number of contained semantic objects for declarations of functions with the given name.

Parameters:
name The name of the function.

unsigned Puma::CStructure::Usings (  )  const [inline]

Get the number of contained semantic objects for used members.

unsigned Puma::CStructure::Usings ( const DString name  )  const

Get the number of contained semantic objects for used members with the given name.

Parameters:
name The name of the member.

unsigned Puma::CStructure::Namespaces (  )  const [inline]

Get the number of contained semantic objects for namespace declarations.

unsigned Puma::CStructure::Namespaces ( const DString name  )  const

Get the number of contained semantic objects for declarations of namespaces with the given name.

Parameters:
name The name of the namespace.

unsigned Puma::CStructure::Friends (  )  const [inline]

Get the number of contained semantic objects for friend declarations.

unsigned Puma::CStructure::Friends ( const DString name  )  const

Get the number of contained semantic objects for declarations of friends with the given name.

Parameters:
name The name of the friend.

CObjectInfo * Puma::CStructure::Object ( unsigned  n  )  const [inline]

Get the n-th contained semantic object.

Parameters:
n The index of the semantic object.

CObjectInfo* Puma::CStructure::Object ( const DString name,
unsigned  n = 0 
) const

Get the n-th contained semantic object for entities with the given name.

Parameters:
name The name of the entity.
n Optional index of the semantic object (defaults to 0).

CObjectInfo * Puma::CStructure::Type ( unsigned  n  )  const [inline]

Get the n-th contained semantic object for a type.

Parameters:
n The index of the semantic object.

CObjectInfo* Puma::CStructure::Type ( const DString name,
unsigned  n = 0 
) const

Get the n-th contained semantic object for types with the given name.

Parameters:
name The name of the type.
n Optional index of the semantic object (defaults to 0).

CUsingInfo * Puma::CStructure::Using ( unsigned  n  )  const [inline]

Get the n-th contained semantic object for a using-directive.

Parameters:
n The index of the semantic object.

CUsingInfo* Puma::CStructure::Using ( const DString name,
unsigned  n = 0 
) const

Get the n-th contained semantic object for used members with the given name.

Parameters:
name The name of the member.
n Optional index of the semantic object (defaults to 0).

CNamespaceInfo * Puma::CStructure::Namespace ( unsigned  n  )  const [inline]

Get the n-th contained semantic object for a namespace.

Parameters:
n The index of the semantic object.

CNamespaceInfo* Puma::CStructure::Namespace ( const DString name,
unsigned  n = 0 
) const

Get the n-th contained semantic object for namespaces with the given name.

Parameters:
name The name of the namespace.
n Optional index of the semantic object (defaults to 0).

CRecord * Puma::CStructure::Friend ( unsigned  n  )  const [inline]

Get the n-th contained semantic object for a friend.

Parameters:
n The index of the semantic object.

CRecord* Puma::CStructure::Friend ( const DString name,
unsigned  n = 0 
) const

Get the n-th contained semantic object for friends with the given name.

Parameters:
name The name of the friend.
n Optional index of the semantic object (defaults to 0).

CAttributeInfo * Puma::CStructure::Attribute ( unsigned  n  )  const [inline]

Get the n-th contained semantic object for an object.

Parameters:
n The index of the semantic object.

CAttributeInfo* Puma::CStructure::Attribute ( const DString name,
unsigned  n = 0 
) const

Get the n-th contained semantic object for objects with the given name.

Parameters:
name The name of the object.
n Optional index of the semantic object (defaults to 0).

CTemplateParamInfo * Puma::CStructure::TemplateParam ( unsigned  n  )  const [inline]

Get the n-th contained semantic object for a template parameter.

Parameters:
n The index of the semantic object.

CTemplateParamInfo* Puma::CStructure::TemplateParam ( const DString name,
unsigned  n = 0 
) const

Get the n-th contained semantic object for template parameters with the given name.

Parameters:
name The name of the template parameter.
n Optional index of the semantic object (defaults to 0).

CFunctionInfo * Puma::CStructure::Function ( unsigned  n  )  const [inline]

Get the n-th contained semantic object for a function.

Parameters:
n The index of the semantic object.

CFunctionInfo* Puma::CStructure::Function ( const DString name,
unsigned  n = 0 
) const

Get the n-th contained semantic object for functions with the given name.

Parameters:
name The name of the function.
n Optional index of the semantic object (defaults to 0).

CFunctionInfo* Puma::CStructure::Function ( const DString name,
CTypeInfo type 
) const

Get the contained semantic object for functions with the given name and type.

Parameters:
name The name of the function.
type The type of the function.

bool Puma::CStructure::isMemberAlias ( const CObjectInfo info  )  const [inline]

Check if an alias exists for the given entity in this scope.

Parameters:
info The semantic object of the entity.

CMemberAliasInfo* Puma::CStructure::MemberAlias ( const CObjectInfo info  )  const

Get the member alias information for the aliased entity.

Parameters:
info The semantic object of the entity.

void Puma::CStructure::setShared ( CStructure share  ) 

Set a common data object for the linked semantic objects.

Parameters:
share The common data object.

void Puma::CStructure::addObject ( CObjectInfo info  ) 

Add a semantic object.

Parameters:
info The semantic object.

void Puma::CStructure::addAttribute ( CAttributeInfo info  ) 

Add a semantic object for an object.

Parameters:
info The semantic object.

void Puma::CStructure::addTemplateParam ( CTemplateParamInfo info  ) 

Add a semantic object for a template parameter.

Parameters:
info The semantic object.

void Puma::CStructure::addFunction ( CFunctionInfo info  ) 

Add a semantic object for a function.

Parameters:
info The semantic object.

void Puma::CStructure::addType ( CObjectInfo info  ) 

Add a semantic object for a type.

Parameters:
info The semantic object.

void Puma::CStructure::addUsing ( CUsingInfo info  ) 

Add a semantic object for a using-directive.

Parameters:
info The semantic object.

void Puma::CStructure::addNamespace ( CNamespaceInfo info  ) 

Add a semantic object for a namespace.

Parameters:
info The semantic object.

void Puma::CStructure::addFriend ( CRecord info  ) 

Add a semantic object for a friend.

Parameters:
info The semantic object.

void Puma::CStructure::removeObject ( const CObjectInfo info  ) 

Remove the semantic object.

Parameters:
info The semantic object.

void Puma::CStructure::removeAttribute ( const CAttributeInfo info  ) 

Remove the semantic object for an object.

Parameters:
info The semantic object.

void Puma::CStructure::removeTemplateParam ( const CTemplateParamInfo info  ) 

Remove the semantic object for a template parameter.

Parameters:
info The semantic object.

void Puma::CStructure::removeFunction ( const CFunctionInfo info  ) 

Remove the semantic object for a function.

Parameters:
info The semantic object.

void Puma::CStructure::removeType ( const CObjectInfo info  ) 

Remove the semantic object for a type.

Parameters:
info The semantic object.

void Puma::CStructure::removeUsing ( const CUsingInfo info  ) 

Remove the semantic object for a using-directive.

Parameters:
info The semantic object.

void Puma::CStructure::removeNamespace ( const CNamespaceInfo info  ) 

Remove the semantic object for a namespace.

Parameters:
info The semantic object.

void Puma::CStructure::removeFriend ( const CRecord info  ) 

Remove the semantic object for a friend.

Parameters:
info The semantic object.

void Puma::CStructure::removeMemberAlias ( const CMemberAliasInfo info  ) 

Remove the semantic object for a member alias.

Parameters:
info The semantic object.

void Puma::CStructure::removeRegisterEntry (  ) 

Unregister this semantic object at all contained semantic objects.

void Puma::CStructure::addObjectName ( CObjectInfo info  ) 

Add a semantic object to the name map.

Warning:
For internal use only!
Parameters:
info The semantic object.

void Puma::CStructure::removeObjectName ( const DString name,
CObjectInfo info 
)

Remove the given semantic object for the entity with the given name from the name map.

Warning:
For internal use only!
Parameters:
name The name of the entity.
info The semantic object.

CAttributeInfo* Puma::CStructure::newAttribute (  ) 

Create a new semantic object for an object declaration.

CEnumInfo* Puma::CStructure::newEnum (  ) 

Create a new semantic object for an enumeration.

CUsingInfo* Puma::CStructure::newUsing (  ) 

Create a new semantic object for a using-directive.

CTypedefInfo* Puma::CStructure::newTypedef (  ) 

Create a new semantic object for a typedef.

CMemberAliasInfo* Puma::CStructure::newMemberAlias ( CObjectInfo member  ) 

Create a new semantic object for a member alias.

Parameters:
member The aliased member.

void Puma::CStructure::deleteAttribute ( const CAttributeInfo info  ) 

Remove and destroy the given semantic object for an object.

Parameters:
info The semantic object.

void Puma::CStructure::deleteEnum ( const CEnumInfo info  ) 

Remove and destroy the given semantic object for an enumeration.

Parameters:
info The semantic object.

void Puma::CStructure::deleteUsing ( const CUsingInfo info  ) 

Remove and destroy the given semantic object for a using-directive.

Parameters:
info The semantic object.

void Puma::CStructure::deleteTypedef ( const CTypedefInfo info  ) 

Remove and destroy the given semantic object for a typedef.

Parameters:
info The semantic object.

void Puma::CStructure::deleteMemberAlias ( const CMemberAliasInfo info  ) 

Remove and destroy the given semantic object for a member alias.

Parameters:
info The semantic object.




Puma Reference Manual. Created on 11 Jul 2008.