PUMA Library Reference Manual
Puma::CObjectInfo Class Reference

#include <Puma/CObjectInfo.h>

+ Inheritance diagram for Puma::CObjectInfo:

Description

Abstract base class of all semantic information classes. Provides all semantic information about an entity (class, function, object, etc).

A semantic object is identified by its object ID. Semantic information objects for the same kind of entity have the same object ID (like object ID CObjectInfo::FUNCTION_INFO for all semantic objects of functions).

Example:

// check if sem_obj is a semantic object for a function
if (sem_obj.Id() == Puma::CObjectInfo::FUNCTION_INFO) {
...
}
// same check
if (sem_obj.FunctionInfo()) {
...
}

Semantic information objects are created by the semantic analysis component of Puma (see Puma::Semantic) during the parse process and are collected in the semantic information database (see Puma::CSemDatabase).

There are several relations between the semantic objects forming the semantic tree. There is one semantic tree for each translation unit.

The root of the semantic tree usually is the semantic object for the file scope (see Puma::CFileInfo). It contains all the other scopes of the analysed source file, such as namespaces and class definitions, function definitions, global variables, and so on. The semantic tree is destroyed by destroying the root object of the tree. This recursively destroys all sub-objects of the tree.

Public Types

enum  ObjectId {
  FILE_INFO,
  UNION_INFO,
  CLASS_INFO,
  BASECLASS_INFO,
  MEMBERALIAS_INFO,
  ENUM_INFO,
  TYPEDEF_INFO,
  FUNCTION_INFO,
  LABEL_INFO,
  ENUMERATOR_INFO,
  ATTRIBUTE_INFO,
  TEMPLATE_PARAM_INFO,
  TEMPLATE_INFO,
  CLASS_INSTANCE_INFO,
  UNION_INSTANCE_INFO,
  FCT_INSTANCE_INFO,
  ARGUMENT_INFO,
  LOCAL_INFO,
  NAMESPACE_INFO,
  USING_INFO
}
 Semantic information object types. More...
 

Public Member Functions

 ~CObjectInfo ()
 Destructor. More...
 
bool operator== (const CObjectInfo &) const
 Compare the addresses of this object and all objects linked to this object with the address of the given object. More...
 
bool operator!= (const CObjectInfo &) const
 Compare the addresses of this object and all objects linked to this object with the address of the given object. More...
 
CObjectInfoObjectInfo () const
 Get a pointer to CObjectInfo for any semantic object type. More...
 
CLabelInfoLabelInfo () const
 Return a pointer to CLabelInfo if the entity is a label. More...
 
CMemberAliasInfoMemberAliasInfo () const
 Return a pointer to CMemberAliasInfo if the entity is a member alias. More...
 
CBaseClassInfoBaseClassInfo () const
 Return a pointer to CBaseClassInfo if the entity is a base class specifier. More...
 
CUsingInfoUsingInfo () const
 Return a pointer to CUsingInfo if the entity is a using-directive. More...
 
CTypedefInfoTypedefInfo () const
 Return a pointer to CTypedefInfo if the entity is a typedef. More...
 
CArgumentInfoArgumentInfo () const
 Return a pointer to CArgumentInfo if the entity is a function parameter. More...
 
CAttributeInfoAttributeInfo () const
 Return a pointer to CAttributeInfo if the entity is an object or enumeration constant. More...
 
CTemplateParamInfoTemplateParamInfo () const
 Return a pointer to CTemplateParemInfo if the entity is a template parameter. More...
 
CStructureStructure () const
 Return a pointer to CStructure if the entity is a namespace, class, function, or any other construct that can contain other entities. More...
 
CFileInfoFileInfo () const
 Return a pointer to CFileInfo if this is the file scope. More...
 
CRecordRecord () const
 Return a pointer to CRecord if the entity is a class or union. More...
 
CLocalScopeLocalScope () const
 Return a pointer to CLocalScope if the entity is a local scope (block scope). More...
 
CScopeInfoScopeInfo () const
 Return a pointer to CScopeInfo if the entity defines a scope. More...
 
CClassInfoClassInfo () const
 Return a pointer to CClassInfo if the entity is a class. More...
 
CUnionInfoUnionInfo () const
 Return a pointer to CUnionInfo if the entity is a union. More...
 
CEnumInfoEnumInfo () const
 Return a pointer to CEnumInfo if the entity is an enumeration. More...
 
CFunctionInfoFunctionInfo () const
 Return a pointer to CFunctionInfo if the entity is a function, method, or overloaded operator. More...
 
CNamespaceInfoNamespaceInfo () const
 Return a pointer to CNamespaceInfo if the entity is a namespace. More...
 
CEnumeratorInfoEnumeratorInfo () const
 Return a pointer to CEnumeratorInfo if the entity is an enumeration constant. More...
 
CTemplateInfoTemplateInfo () const
 Return a pointer to CTemplateInfo if the entity is a template. More...
 
CClassInstanceClassInstance () const
 Return a pointer to CClassInstance if the entity is an instance of a class template. More...
 
CFctInstanceFctInstance () const
 Return a pointer to CFctInstance if the entity is an instance of a function template. More...
 
CUnionInstanceUnionInstance () const
 Return a pointer to CUnionInstance if the entity is an instance of a union template. More...
 
CTemplateInfoTemplate () const
 Return a pointer to CTemplateInfo if the entity is a template. More...
 
CTemplateInstanceTemplateInstance () const
 Return a pointer to CTemplateInstance if the entity is an instance of a class or function template. More...
 
CScopeInfoScope () const
 Get the scope in which the entity was declared. More...
 
CStructureQualifiedScope () const
 Get the scope of qualified names. More...
 
CRecordClassScope () const
 Get the class containing the class member described by this object. More...
 
CStructureAssignedScope () const
 Get the scope of a friend class or function. More...
 
ObjectId Id () const
 Get the type of this semantic object. More...
 
const DStringName () const
 Get the name of entity described by this semantic object. More...
 
const char * QualName (bool abs=false, bool tdef=false, bool unnamed=false)
 Get the qualified name of the entity described by this semantic object. More...
 
CObjectInfoDefObject () const
 Get the semantic information object for the definition of an entity. More...
 
CTypeInfoTypeInfo () const
 Get the data type of the entity. More...
 
CSourceInfoSourceInfo () const
 Get the source file information. More...
 
CSemDatabaseClassDB () const
 Get the semantic information database object containing this semantic object. More...
 
CSemDatabaseSemDB () const
 Get the semantic information database object containing this semantic object. More...
 
CTreeTree () const
 Get the syntax tree node for the entity described by this semantic object. More...
 
CObjectInfoNextObject () const
 Get the next semantic object linked with this object. More...
 
CObjectInfoPrevObject () const
 Get the previous semantic object linked with this object. More...
 
CObjectInfoBaseObject () const
 Get the semantic object for the base class entity this entity is overloading. More...
 
CTreeInit () const
 Get the initializer of the entity. More...
 
CProtection::Type Protection () const
 Get the member protection of the entity, if it is a class member. More...
 
CLinkage::Type Linkage () const
 Get the linkage of the entity. More...
 
CStorage::Type Storage () const
 Get the storage class of the entity. More...
 
const CLanguageLanguage () const
 Get the entity encoding language. More...
 
CLanguageLanguage ()
 Get the entity encoding language. More...
 
const CSpecifiersSpecifiers () const
 Get the declaration specifiers. More...
 
bool isType () const
 Check if the entity is a type. More...
 
bool isObject () const
 Check if the entity is an object. More...
 
bool isAnonymous () const
 Check if the entity is anonymous (has no explicit name). More...
 
bool isTemplate () const
 Check if the entity is a class or function template, or a template template parameter. More...
 
bool isTemplateInstance () const
 Check if the entity is a class or function template instance. More...
 
bool isBuiltin () const
 Check if the entity describes a built-in type or function. More...
 
bool isClassMember () const
 Check if the entity is a method or data member of a class. More...
 
bool isVirtual () const
 Check if the entity is declared virtual. More...
 
bool isStatic () const
 Check if the entity is declared static. More...
 
bool isThreadLocal () const
 Check if the entity is declared __thread. More...
 
bool isExtern () const
 Check if the entity is declared extern. More...
 
bool isMutable () const
 Check if the entity is declared mutable. More...
 
bool isRegister () const
 Check if the entity is declared register. More...
 
bool isExplicit () const
 Check if the entity is declared explicit. More...
 
bool isInline () const
 Check if the entity is declared inline. More...
 
bool isAuto () const
 Check if the entity is declared auto. More...
 
bool isRegistered (const CStructure *s) const
 Check if the given semantic object is registered as being connected to this semantic object in any way. More...
 
bool isLocal () const
 Check if the entity is local. More...
 
void Name (const char *s)
 Set the name of the entity. More...
 
void Name (const DString &ds)
 Set the name of the entity. More...
 
void TypeInfo (CTypeInfo *type)
 Set the type of the entity. More...
 
void BaseObject (CObjectInfo *base)
 Set the base class object for the entity this entity overloads. More...
 
void Protection (CProtection::Type p)
 Set the member access protection of the entity. More...
 
void Linkage (CLinkage::Type l)
 Set the linkage of the entity. More...
 
void Storage (CStorage::Type s)
 Set the storage class of the entity. More...
 
void Specifiers (const CSpecifiers &)
 Set the declaration specifiers. More...
 
void FileInfo (CFileInfo *finfo)
 Set the source file information for the entity. More...
 
void Tree (CTree *tree)
 Set the syntax tree node of the entity. More...
 
void ClassDB (CSemDatabase *db)
 Set the semantic information database object containing this semantic object. More...
 
void SemDB (CSemDatabase *db)
 Set the semantic information database object containing this semantic object. More...
 
void NextObject (CObjectInfo *obj)
 Set the link to next semantic object. More...
 
void PrevObject (CObjectInfo *obj)
 Set the link to next semantic object. More...
 
void Unlink ()
 Unlink this semantic object. More...
 
void Register (CStructure *s)
 Register the given semantic object as being connected to this semantic object in any way. More...
 
void Unregister (CStructure *s)
 Unregister the given semantic object as being connected to this semantic object in any way. More...
 
void isVirtual (bool v)
 Set whether the entity was declared virtual. More...
 
void isStatic (bool v)
 Set whether the entity was declared static. More...
 
void isThreadLocal (bool v)
 Set whether the entity was declared __thread. More...
 
void isExtern (bool v)
 Set whether the entity was declared extern. More...
 
void isMutable (bool v)
 Set whether the entity was declared mutable. More...
 
void isRegister (bool v)
 Set whether the entity was declared register. More...
 
void isExplicit (bool v)
 Set whether the entity was declared explicit. More...
 
void isInline (bool v)
 Set whether the entity was declared inline. More...
 
void isAuto (bool v)
 Set whether the entity was declared auto. More...
 
void AssignedScope (CStructure *s)
 Set the assigned scope of the entity. More...
 

Protected Member Functions

 CObjectInfo (ObjectId id)
 Constructor. More...
 

Protected Attributes

CStructure_QualScope
 Qualified name scope. More...
 
CStructure_AssignedScope
 The scope of a friend class or function. More...
 
Array< CStructure * > _Registered
 Set of semantic objects connected to this object in any way. More...
 

Member Enumeration Documentation

◆ ObjectId

Semantic information object types.

Enumerator
FILE_INFO 

Semantic information about the file scope.

UNION_INFO 

Semantic information about a union.

CLASS_INFO 

Semantic information about a class.

BASECLASS_INFO 

Semantic information about a base class specifier.

MEMBERALIAS_INFO 

Semantic information about class/namespace member alias.

ENUM_INFO 

Semantic information about an enumeration.

TYPEDEF_INFO 

Semantic information about a typedef.

FUNCTION_INFO 

Semantic information about a function, method, or overloaded operator.

LABEL_INFO 

Semantic information about a label.

ENUMERATOR_INFO 

Semantic information about an enumerator constant.

ATTRIBUTE_INFO 

Semantic information about an object (variables etc).

TEMPLATE_PARAM_INFO 

Semantic information about a template parameter.

TEMPLATE_INFO 

Semantic information about a class or function template.

CLASS_INSTANCE_INFO 

Semantic information about an instance of a class template.

UNION_INSTANCE_INFO 

Semantic information about an instance of a union template.

FCT_INSTANCE_INFO 

Semantic information about an instance of a function template.

ARGUMENT_INFO 

Semantic information about a function parameter.

LOCAL_INFO 

Semantic information about a local scope (block scope).

NAMESPACE_INFO 

Semantic information about a named or anonymous namespace.

USING_INFO 

Semantic information about a using declaration.

Constructor & Destructor Documentation

◆ ~CObjectInfo()

Puma::CObjectInfo::~CObjectInfo ( )

Destructor.

◆ CObjectInfo()

Puma::CObjectInfo::CObjectInfo ( CObjectInfo::ObjectId  id)
inlineprotected

Constructor.

Parameters
idThe semantic object type.

Member Function Documentation

◆ ArgumentInfo()

CArgumentInfo * Puma::CObjectInfo::ArgumentInfo ( ) const
inline

Return a pointer to CArgumentInfo if the entity is a function parameter.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ AssignedScope() [1/2]

CStructure * Puma::CObjectInfo::AssignedScope ( ) const
inline

Get the scope of a friend class or function.

This is not the scope in which the friend class or function was declared. A friend function of a class may be declared first inside the scope of a class definition. But the declared function does not belong to this scope. In fact it belongs to the nearest non-class scope (usually the file scope). This is the assigned scope.

Returns
The assigned scope or NULL.

◆ AssignedScope() [2/2]

void Puma::CObjectInfo::AssignedScope ( CStructure s)
inline

Set the assigned scope of the entity.

This is the scope of a friend class or function. It is not the scope in which the friend class or function was declared. A friend function of a class may be declared first inside the scope of a class definition. But the declared function does not belong to this scope. In fact it belongs to the nearest non-class scope (usually the file scope). This is the assigned scope.

Parameters
sThe assigned scope.

◆ AttributeInfo()

CAttributeInfo * Puma::CObjectInfo::AttributeInfo ( ) const
inline

Return a pointer to CAttributeInfo if the entity is an object or enumeration constant.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ BaseClassInfo()

CBaseClassInfo * Puma::CObjectInfo::BaseClassInfo ( ) const
inline

Return a pointer to CBaseClassInfo if the entity is a base class specifier.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ BaseObject() [1/2]

CObjectInfo * Puma::CObjectInfo::BaseObject ( ) const
inline

Get the semantic object for the base class entity this entity is overloading.

Note
Not yet implemented!
Returns
Always returns NULL.

◆ BaseObject() [2/2]

void Puma::CObjectInfo::BaseObject ( CObjectInfo base)
inline

Set the base class object for the entity this entity overloads.

Parameters
baseThe base object.

◆ ClassDB() [1/2]

CSemDatabase * Puma::CObjectInfo::ClassDB ( ) const
inline

Get the semantic information database object containing this semantic object.

◆ ClassDB() [2/2]

void Puma::CObjectInfo::ClassDB ( CSemDatabase db)
inline

Set the semantic information database object containing this semantic object.

Parameters
dbThe semantic database.

◆ ClassInfo()

CClassInfo * Puma::CObjectInfo::ClassInfo ( ) const
inline

Return a pointer to CClassInfo if the entity is a class.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ ClassInstance()

CClassInstance * Puma::CObjectInfo::ClassInstance ( ) const
inline

Return a pointer to CClassInstance if the entity is an instance of a class template.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ ClassScope()

CRecord* Puma::CObjectInfo::ClassScope ( ) const

Get the class containing the class member described by this object.

The object type has to be one of:

Returns
The class or union, or NULL if not a member of a class or union.

◆ DefObject()

CObjectInfo* Puma::CObjectInfo::DefObject ( ) const

Get the semantic information object for the definition of an entity.

Some entities, like functions and classes, can be declared several times before a definition of the entity appears. The semantic objects for the definition and declarations are linked. This method searches the linked semantic objects for the semantic object of the definition of the entity.

Returns
The semantic object for the definition or this object if no definition found.

◆ EnumeratorInfo()

CEnumeratorInfo * Puma::CObjectInfo::EnumeratorInfo ( ) const
inline

Return a pointer to CEnumeratorInfo if the entity is an enumeration constant.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ EnumInfo()

CEnumInfo * Puma::CObjectInfo::EnumInfo ( ) const
inline

Return a pointer to CEnumInfo if the entity is an enumeration.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ FctInstance()

CFctInstance * Puma::CObjectInfo::FctInstance ( ) const
inline

Return a pointer to CFctInstance if the entity is an instance of a function template.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ FileInfo() [1/2]

CFileInfo * Puma::CObjectInfo::FileInfo ( ) const
inline

Return a pointer to CFileInfo if this is the file scope.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ FileInfo() [2/2]

void Puma::CObjectInfo::FileInfo ( CFileInfo finfo)

Set the source file information for the entity.

Parameters
finfoThe file information.

◆ FunctionInfo()

CFunctionInfo * Puma::CObjectInfo::FunctionInfo ( ) const
inline

Return a pointer to CFunctionInfo if the entity is a function, method, or overloaded operator.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ Id()

CObjectInfo::ObjectId Puma::CObjectInfo::Id ( ) const
inline

Get the type of this semantic object.

◆ Init()

CTree* Puma::CObjectInfo::Init ( ) const

Get the initializer of the entity.

Returns
The initializer expression or NULL if no initializer.

◆ isAnonymous()

bool Puma::CObjectInfo::isAnonymous ( ) const
inline

Check if the entity is anonymous (has no explicit name).

◆ isAuto() [1/2]

bool Puma::CObjectInfo::isAuto ( ) const
inline

Check if the entity is declared auto.

◆ isAuto() [2/2]

void Puma::CObjectInfo::isAuto ( bool  v)
inline

Set whether the entity was declared auto.

Parameters
vTrue for yes, false for no.

◆ isBuiltin()

bool Puma::CObjectInfo::isBuiltin ( ) const
inline

Check if the entity describes a built-in type or function.

In this case the entity has no syntax tree (Tree() returns NULL).

◆ isClassMember()

bool Puma::CObjectInfo::isClassMember ( ) const

Check if the entity is a method or data member of a class.

◆ isExplicit() [1/2]

bool Puma::CObjectInfo::isExplicit ( ) const
inline

Check if the entity is declared explicit.

◆ isExplicit() [2/2]

void Puma::CObjectInfo::isExplicit ( bool  v)
inline

Set whether the entity was declared explicit.

Parameters
vTrue for yes, false for no.

◆ isExtern() [1/2]

bool Puma::CObjectInfo::isExtern ( ) const
inline

Check if the entity is declared extern.

◆ isExtern() [2/2]

void Puma::CObjectInfo::isExtern ( bool  v)
inline

Set whether the entity was declared extern.

Parameters
vTrue for yes, false for no.

◆ isInline() [1/2]

bool Puma::CObjectInfo::isInline ( ) const
inline

Check if the entity is declared inline.

◆ isInline() [2/2]

void Puma::CObjectInfo::isInline ( bool  v)
inline

Set whether the entity was declared inline.

Parameters
vTrue for yes, false for no.

◆ isLocal()

bool Puma::CObjectInfo::isLocal ( ) const

Check if the entity is local.

An entity is local if it was declared in a local scope.

◆ isMutable() [1/2]

bool Puma::CObjectInfo::isMutable ( ) const
inline

Check if the entity is declared mutable.

◆ isMutable() [2/2]

void Puma::CObjectInfo::isMutable ( bool  v)
inline

Set whether the entity was declared mutable.

Parameters
vTrue for yes, false for no.

◆ isObject()

bool Puma::CObjectInfo::isObject ( ) const

Check if the entity is an object.

◆ isRegister() [1/2]

bool Puma::CObjectInfo::isRegister ( ) const
inline

Check if the entity is declared register.

◆ isRegister() [2/2]

void Puma::CObjectInfo::isRegister ( bool  v)
inline

Set whether the entity was declared register.

Parameters
vTrue for yes, false for no.

◆ isRegistered()

bool Puma::CObjectInfo::isRegistered ( const CStructure s) const

Check if the given semantic object is registered as being connected to this semantic object in any way.

Parameters
sThe semantic object.

◆ isStatic() [1/2]

bool Puma::CObjectInfo::isStatic ( ) const
inline

Check if the entity is declared static.

◆ isStatic() [2/2]

void Puma::CObjectInfo::isStatic ( bool  v)
inline

Set whether the entity was declared static.

Parameters
vTrue for yes, false for no.

◆ isTemplate()

bool Puma::CObjectInfo::isTemplate ( ) const

Check if the entity is a class or function template, or a template template parameter.

◆ isTemplateInstance()

bool Puma::CObjectInfo::isTemplateInstance ( ) const

Check if the entity is a class or function template instance.

◆ isThreadLocal() [1/2]

bool Puma::CObjectInfo::isThreadLocal ( ) const
inline

Check if the entity is declared __thread.

◆ isThreadLocal() [2/2]

void Puma::CObjectInfo::isThreadLocal ( bool  v)
inline

Set whether the entity was declared __thread.

Parameters
vTrue for yes, false for no.

◆ isType()

bool Puma::CObjectInfo::isType ( ) const

Check if the entity is a type.

◆ isVirtual() [1/2]

bool Puma::CObjectInfo::isVirtual ( ) const
inline

Check if the entity is declared virtual.

◆ isVirtual() [2/2]

void Puma::CObjectInfo::isVirtual ( bool  v)
inline

Set whether the entity was declared virtual.

Parameters
vTrue for yes, false for no.

◆ LabelInfo()

CLabelInfo * Puma::CObjectInfo::LabelInfo ( ) const
inline

Return a pointer to CLabelInfo if the entity is a label.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ Language() [1/2]

CLanguage & Puma::CObjectInfo::Language ( )
inline

Get the entity encoding language.

◆ Language() [2/2]

const CLanguage & Puma::CObjectInfo::Language ( ) const
inline

Get the entity encoding language.

◆ Linkage() [1/2]

CLinkage::Type Puma::CObjectInfo::Linkage ( ) const
inline

Get the linkage of the entity.

◆ Linkage() [2/2]

void Puma::CObjectInfo::Linkage ( CLinkage::Type  l)
inline

Set the linkage of the entity.

Parameters
lThe linkage.

◆ LocalScope()

CLocalScope * Puma::CObjectInfo::LocalScope ( ) const
inline

Return a pointer to CLocalScope if the entity is a local scope (block scope).

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ MemberAliasInfo()

CMemberAliasInfo * Puma::CObjectInfo::MemberAliasInfo ( ) const
inline

Return a pointer to CMemberAliasInfo if the entity is a member alias.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ Name() [1/3]

const DString & Puma::CObjectInfo::Name ( ) const
inline

Get the name of entity described by this semantic object.

◆ Name() [2/3]

void Puma::CObjectInfo::Name ( const char *  s)
inline

Set the name of the entity.

Parameters
sThe name.

◆ Name() [3/3]

void Puma::CObjectInfo::Name ( const DString ds)

Set the name of the entity.

Parameters
dsThe name.

◆ NamespaceInfo()

CNamespaceInfo * Puma::CObjectInfo::NamespaceInfo ( ) const
inline

Return a pointer to CNamespaceInfo if the entity is a namespace.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ NextObject() [1/2]

CObjectInfo * Puma::CObjectInfo::NextObject ( ) const
inline

Get the next semantic object linked with this object.

Usually the definition and the declarations of an entity are linked.

◆ NextObject() [2/2]

void Puma::CObjectInfo::NextObject ( CObjectInfo obj)

Set the link to next semantic object.

Usually the semantic objects for the definition and declaration of an entity are linked.

Parameters
objThe next object in the chain.

◆ ObjectInfo()

CObjectInfo * Puma::CObjectInfo::ObjectInfo ( ) const
inline

Get a pointer to CObjectInfo for any semantic object type.

◆ operator!=()

bool Puma::CObjectInfo::operator!= ( const CObjectInfo info) const
inline

Compare the addresses of this object and all objects linked to this object with the address of the given object.

Returns
True if the addresses are different and thus the given object does not describe the same entity.

◆ operator==()

bool Puma::CObjectInfo::operator== ( const CObjectInfo ) const

Compare the addresses of this object and all objects linked to this object with the address of the given object.

Returns
True if the addresses are the same and thus the given object describes the same entity.

◆ PrevObject() [1/2]

CObjectInfo * Puma::CObjectInfo::PrevObject ( ) const
inline

Get the previous semantic object linked with this object.

Usually the definition and the declarations of an entity are linked.

◆ PrevObject() [2/2]

void Puma::CObjectInfo::PrevObject ( CObjectInfo obj)

Set the link to next semantic object.

Usually the semantic objects for the definition and declaration of an entity are linked.

Parameters
objThe previous object in the chain.

◆ Protection() [1/2]

CProtection::Type Puma::CObjectInfo::Protection ( ) const
inline

Get the member protection of the entity, if it is a class member.

◆ Protection() [2/2]

void Puma::CObjectInfo::Protection ( CProtection::Type  p)
inline

Set the member access protection of the entity.

Parameters
pThe protection.

◆ QualifiedScope()

CStructure * Puma::CObjectInfo::QualifiedScope ( ) const
inline

Get the scope of qualified names.

The scope of a class member for instance is the corresponding class. If a function is declared in a namespace, then the qualified scope is that namespace.

◆ QualName()

const char* Puma::CObjectInfo::QualName ( bool  abs = false,
bool  tdef = false,
bool  unnamed = false 
)

Get the qualified name of the entity described by this semantic object.

Parameters
absCreate root qualified name (like ::X::Y::Z).
tdefInsert the name of a typedef instead of the named type.
unnamedDon't ignore unnamed namespaces (like <unnamed>::foo).

◆ Record()

CRecord * Puma::CObjectInfo::Record ( ) const
inline

Return a pointer to CRecord if the entity is a class or union.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ Register()

void Puma::CObjectInfo::Register ( CStructure s)
inline

Register the given semantic object as being connected to this semantic object in any way.

Parameters
sThe semantic object.

◆ Scope()

CScopeInfo* Puma::CObjectInfo::Scope ( ) const

Get the scope in which the entity was declared.

◆ ScopeInfo()

◆ SemDB() [1/2]

CSemDatabase * Puma::CObjectInfo::SemDB ( ) const
inline

Get the semantic information database object containing this semantic object.

◆ SemDB() [2/2]

void Puma::CObjectInfo::SemDB ( CSemDatabase db)
inline

Set the semantic information database object containing this semantic object.

Parameters
dbThe semantic database.

◆ SourceInfo()

CSourceInfo * Puma::CObjectInfo::SourceInfo ( ) const
inline

Get the source file information.

Contains the position and token of the entity in the source file.

◆ Specifiers() [1/2]

const CSpecifiers & Puma::CObjectInfo::Specifiers ( ) const
inline

Get the declaration specifiers.

◆ Specifiers() [2/2]

void Puma::CObjectInfo::Specifiers ( const CSpecifiers specs)
inline

Set the declaration specifiers.

◆ Storage() [1/2]

CStorage::Type Puma::CObjectInfo::Storage ( ) const
inline

Get the storage class of the entity.

◆ Storage() [2/2]

void Puma::CObjectInfo::Storage ( CStorage::Type  s)
inline

Set the storage class of the entity.

Parameters
sThe storage class.

◆ Structure()

CStructure * Puma::CObjectInfo::Structure ( ) const
inline

Return a pointer to CStructure if the entity is a namespace, class, function, or any other construct that can contain other entities.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ Template()

CTemplateInfo* Puma::CObjectInfo::Template ( ) const

Return a pointer to CTemplateInfo if the entity is a template.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ TemplateInfo()

CTemplateInfo * Puma::CObjectInfo::TemplateInfo ( ) const
inline

Return a pointer to CTemplateInfo if the entity is a template.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ TemplateInstance()

CTemplateInstance* Puma::CObjectInfo::TemplateInstance ( ) const

Return a pointer to CTemplateInstance if the entity is an instance of a class or function template.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ TemplateParamInfo()

CTemplateParamInfo * Puma::CObjectInfo::TemplateParamInfo ( ) const
inline

Return a pointer to CTemplateParemInfo if the entity is a template parameter.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ Tree() [1/2]

CTree * Puma::CObjectInfo::Tree ( ) const
inline

Get the syntax tree node for the entity described by this semantic object.

◆ Tree() [2/2]

void Puma::CObjectInfo::Tree ( CTree tree)
inline

Set the syntax tree node of the entity.

Parameters
treeThe syntax tree node.

◆ TypedefInfo()

CTypedefInfo * Puma::CObjectInfo::TypedefInfo ( ) const
inline

Return a pointer to CTypedefInfo if the entity is a typedef.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ TypeInfo() [1/2]

CTypeInfo * Puma::CObjectInfo::TypeInfo ( ) const
inline

Get the data type of the entity.

◆ TypeInfo() [2/2]

void Puma::CObjectInfo::TypeInfo ( CTypeInfo type)

Set the type of the entity.

Parameters
typeThe type information.

◆ UnionInfo()

CUnionInfo * Puma::CObjectInfo::UnionInfo ( ) const
inline

Return a pointer to CUnionInfo if the entity is a union.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ UnionInstance()

CUnionInstance * Puma::CObjectInfo::UnionInstance ( ) const
inline

Return a pointer to CUnionInstance if the entity is an instance of a union template.

The object type has to be one of:

Returns
The valid pointer or NULL.

◆ Unlink()

void Puma::CObjectInfo::Unlink ( )

Unlink this semantic object.

Usually the semantic objects for the definition and declaration of an entity are linked. This method removes this object from the chain.

◆ Unregister()

void Puma::CObjectInfo::Unregister ( CStructure s)

Unregister the given semantic object as being connected to this semantic object in any way.

Parameters
sThe semantic object.

◆ UsingInfo()

CUsingInfo * Puma::CObjectInfo::UsingInfo ( ) const
inline

Return a pointer to CUsingInfo if the entity is a using-directive.

The object type has to be one of:

Returns
The valid pointer or NULL.

Member Data Documentation

◆ _AssignedScope

CStructure* Puma::CObjectInfo::_AssignedScope
protected

The scope of a friend class or function.

This is not the scope in which the friend class or function was declared. A friend function of a class may be declared first inside the scope of a class definition. But the declared function does not belong to this scope. In fact it belongs to the nearest non-class scope (usually the file scope). This is the assigned scope.

◆ _QualScope

CStructure* Puma::CObjectInfo::_QualScope
protected

Qualified name scope.

Set only for CAttributeInfo, CFunctionInfo, and CRecord.

◆ _Registered

Array<CStructure*> Puma::CObjectInfo::_Registered
protected

Set of semantic objects connected to this object in any way.

Puma::CObjectInfo::FUNCTION_INFO
Semantic information about a function, method, or overloaded operator.
Definition: CObjectInfo.h:125