Puma Reference Manual Puma: Puma::CStructure Class Reference



Puma::CStructure Class Reference

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

#include <Puma/CStructure.h>

Inheritance diagram for Puma::CStructure:
Inheritance graph

List of all members.

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.
CTypedefInfoTypedef (const DString &name, unsigned n=0) const
 Get the n-th contained semantic object for typedefs 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 addNamedObject (CObjectInfo *info)
 Add a semantic object to the name map.
void removeNamedObject (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, bool direct_member=false)
 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.

Detailed Description

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


Member Typedef Documentation

List type for semantic objects.

Set type for semantic objects.

Map type for entity name to semantic object mapping.


Constructor & Destructor Documentation

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

Constructor.

Parameters:
idThe object type.
Puma::CStructure::~CStructure ( )

Destructor.


Member Function Documentation

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

Add a semantic object for an object.

Parameters:
infoThe semantic object.
void Puma::CStructure::addFriend ( CRecord info)

Add a semantic object for a friend.

Parameters:
infoThe semantic object.
void Puma::CStructure::addFunction ( CFunctionInfo info)

Add a semantic object for a function.

Parameters:
infoThe semantic object.
void Puma::CStructure::addNamedObject ( CObjectInfo info)

Add a semantic object to the name map.

Warning:
For internal use only!
Parameters:
infoThe semantic object.
void Puma::CStructure::addNamespace ( CNamespaceInfo info)

Add a semantic object for a namespace.

Parameters:
infoThe semantic object.
void Puma::CStructure::addObject ( CObjectInfo info)

Add a semantic object.

Parameters:
infoThe semantic object.
void Puma::CStructure::addTemplateParam ( CTemplateParamInfo info)

Add a semantic object for a template parameter.

Parameters:
infoThe semantic object.
void Puma::CStructure::addType ( CObjectInfo info)

Add a semantic object for a type.

Parameters:
infoThe semantic object.
void Puma::CStructure::addUsing ( CUsingInfo info)

Add a semantic object for a using-directive.

Parameters:
infoThe semantic object.
CAttributeInfo * Puma::CStructure::Attribute ( unsigned  n) const [inline]

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

Parameters:
nThe 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:
nameThe name of the object.
nOptional index of the semantic object (defaults to 0).
unsigned Puma::CStructure::Attributes ( const DString name) const

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

Parameters:
nameThe name of the object.
unsigned Puma::CStructure::Attributes ( ) const [inline]

Get the number of contained semantic objects for object declarations.

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

Remove and destroy the given semantic object for an object.

Parameters:
infoThe semantic object.
void Puma::CStructure::deleteEnum ( const CEnumInfo info)

Remove and destroy the given semantic object for an enumeration.

Parameters:
infoThe semantic object.
void Puma::CStructure::deleteMemberAlias ( const CMemberAliasInfo info)

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

Parameters:
infoThe semantic object.
void Puma::CStructure::deleteTypedef ( const CTypedefInfo info)

Remove and destroy the given semantic object for a typedef.

Parameters:
infoThe semantic object.
void Puma::CStructure::deleteUsing ( const CUsingInfo info)

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

Parameters:
infoThe semantic object.
CRecord * Puma::CStructure::Friend ( unsigned  n) const [inline]

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

Parameters:
nThe 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:
nameThe name of the friend.
nOptional index of the semantic object (defaults to 0).
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:
nameThe name of the friend.
CFunctionInfo* Puma::CStructure::Function ( const DString name,
CTypeInfo type 
) const

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

Parameters:
nameThe name of the function.
typeThe type of the function.
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:
nameThe name of the function.
nOptional 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:
nThe index of the semantic object.
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:
nameThe name 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:
infoThe semantic object of the entity.
CMemberAliasInfo* Puma::CStructure::MemberAlias ( const CObjectInfo info) const

Get the member alias information for the aliased entity.

Parameters:
infoThe semantic object of the entity.
CNamespaceInfo * Puma::CStructure::Namespace ( unsigned  n) const [inline]

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

Parameters:
nThe 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:
nameThe name of the namespace.
nOptional index of the semantic object (defaults to 0).
unsigned Puma::CStructure::Namespaces ( const DString name) const

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

Parameters:
nameThe name of the namespace.
unsigned Puma::CStructure::Namespaces ( ) const [inline]

Get the number of contained semantic objects for namespace declarations.

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.

CMemberAliasInfo* Puma::CStructure::newMemberAlias ( CObjectInfo member,
bool  direct_member = false 
)

Create a new semantic object for a member alias.

Parameters:
memberThe aliased member.
direct_memberAdd as direct member.
CTypedefInfo* Puma::CStructure::newTypedef ( )

Create a new semantic object for a typedef.

CUsingInfo* Puma::CStructure::newUsing ( )

Create a new semantic object for a using-directive.

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

Get the n-th contained semantic object.

Parameters:
nThe 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:
nameThe name of the entity.
nOptional index of the semantic object (defaults to 0).
CStructure::ObjectsByName & Puma::CStructure::ObjectInfoMap ( ) [inline]

Get the entity name to semantic object map.

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

Get the entity name to semantic object map.

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

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

Parameters:
nameThe name of the entity.
unsigned Puma::CStructure::Objects ( ) const [inline]

Get the number of contained semantic objects.

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

Remove the semantic object for an object.

Parameters:
infoThe semantic object.
void Puma::CStructure::removeFriend ( const CRecord info)

Remove the semantic object for a friend.

Parameters:
infoThe semantic object.
void Puma::CStructure::removeFunction ( const CFunctionInfo info)

Remove the semantic object for a function.

Parameters:
infoThe semantic object.
void Puma::CStructure::removeMemberAlias ( const CMemberAliasInfo info)

Remove the semantic object for a member alias.

Parameters:
infoThe semantic object.
void Puma::CStructure::removeNamedObject ( 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:
nameThe name of the entity.
infoThe semantic object.
void Puma::CStructure::removeNamespace ( const CNamespaceInfo info)

Remove the semantic object for a namespace.

Parameters:
infoThe semantic object.
void Puma::CStructure::removeObject ( const CObjectInfo info)

Remove the semantic object.

Parameters:
infoThe semantic object.
void Puma::CStructure::removeRegisterEntry ( )

Unregister this semantic object at all contained semantic objects.

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

Remove the semantic object for a template parameter.

Parameters:
infoThe semantic object.
void Puma::CStructure::removeType ( const CObjectInfo info)

Remove the semantic object for a type.

Parameters:
infoThe semantic object.
void Puma::CStructure::removeUsing ( const CUsingInfo info)

Remove the semantic object for a using-directive.

Parameters:
infoThe semantic object.
void Puma::CStructure::setShared ( CStructure share)

Set a common data object for the linked semantic objects.

Parameters:
shareThe common data 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:
nameThe name of the template parameter.
nOptional 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:
nThe index of the semantic 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:
nameThe name of the template parameter.
CObjectInfo * Puma::CStructure::Type ( unsigned  n) const [inline]

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

Parameters:
nThe 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:
nameThe name of the type.
nOptional index of the semantic object (defaults to 0).
CTypedefInfo* Puma::CStructure::Typedef ( const DString name,
unsigned  n = 0 
) const

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

Parameters:
nameThe name of the typedef.
nOptional index of the semantic object (defaults to 0).
unsigned Puma::CStructure::Types ( const DString name) const

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

Parameters:
nameThe name of the type.
unsigned Puma::CStructure::Types ( ) const [inline]

Get the number of contained semantic objects for type declarations.

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:
nameThe name of the member.
nOptional 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:
nThe index of the semantic object.
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:
nameThe name of the member.