PUMA Library Reference Manual
Loading...
Searching...
No Matches
Puma::CTemplateParamInfo Class Reference

#include <Puma/CTemplateParamInfo.h>

+ Inheritance diagram for Puma::CTemplateParamInfo:

Description

Semantic information about a template parameter.

There are three kinds of template parameter: type, non-type, and template template parameter.

// T is a type template parameter
// I is a non-type template parameter
// TT is a template template parameter
template<class T, int I, template<typename,int> class TT>
class X {
TT<T,I> x;
};

Public Member Functions

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

Additional Inherited Members

- Public Types inherited from Puma::CObjectInfo
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...
 
- Protected Member Functions inherited from Puma::CObjectInfo
 CObjectInfo (ObjectId id)
 Constructor.
 
- Protected Attributes inherited from Puma::CObjectInfo
CStructure_QualScope
 Qualified name scope.
 
CStructure_AssignedScope
 The scope of a friend class or function.
 
Array< CStructure * > _Registered
 Set of semantic objects connected to this object in any way.
 

Constructor & Destructor Documentation

◆ CTemplateParamInfo()

Puma::CTemplateParamInfo::CTemplateParamInfo ( )
inline

Constructor.

◆ ~CTemplateParamInfo()

Puma::CTemplateParamInfo::~CTemplateParamInfo ( )

Destructor.

If the object type is CObjectInfo::TEMPLATE_PARAM_INFO, then CObjectInfo::CleanUp() is called and the template instance information object of a template template parameter is destroyed.

Member Function Documentation

◆ DefaultArgument()

CTree * Puma::CTemplateParamInfo::DefaultArgument ( ) const

Get the default argument of the template parameter.

Returns
The default argument expression or NULL if no default argument.

◆ getPosition()

int Puma::CTemplateParamInfo::getPosition ( ) const

Get the position/index of this parameter in the template parameter list.

◆ isTemplate()

bool Puma::CTemplateParamInfo::isTemplate ( ) const
inline

Check if this is a template template parameter.

◆ isTypeParam() [1/2]

bool Puma::CTemplateParamInfo::isTypeParam ( ) const
inline

Check if this is a type template parameter.

◆ isTypeParam() [2/2]

void Puma::CTemplateParamInfo::isTypeParam ( bool v)
inline

Set whether this is a type template parameter.

Parameters
vTrue for yes, false for no.

◆ match()

bool Puma::CTemplateParamInfo::match ( const CTemplateParamInfo & tp) const

Check if this template parameter matches the given.

Must be same kind of parameter, same type and value.

◆ TemplateInfo() [1/2]

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

Get the template this parameter belongs to.

◆ TemplateInfo() [2/2]

void Puma::CTemplateParamInfo::TemplateInfo ( CTemplateInfo * info)
inline

Set the template parameter list information for a template template parameter.

Parameters
infoThe template parameter list information.

◆ TemplateInstance() [1/2]

CTemplateInstance * Puma::CTemplateParamInfo::TemplateInstance ( ) const
inline

Get the template instance information for an instantiated template template parameter.

◆ TemplateInstance() [2/2]

void Puma::CTemplateParamInfo::TemplateInstance ( CTemplateInstance * inst)
inline

Set the template instance information for an instantiated template template parameter.

Parameters
instThe template instance.

◆ TemplateTemplate() [1/2]

CTemplateInfo * Puma::CTemplateParamInfo::TemplateTemplate ( ) const
inline

Get the template information of a template template parameter.

◆ TemplateTemplate() [2/2]

void Puma::CTemplateParamInfo::TemplateTemplate ( CTemplateInfo * info)
inline

Set the template information for a template template parameter.

Parameters
infoThe template information.

◆ Tree()

CT_TemplateParamDecl * Puma::CTemplateParamInfo::Tree ( ) const
inline

Get the syntax tree node representing the template parameter.

◆ TypeInfo()

CTypeTemplateParam * Puma::CTemplateParamInfo::TypeInfo ( ) const
inline

Get the template parameter type.

◆ ValueType() [1/2]

CTypeInfo * Puma::CTemplateParamInfo::ValueType ( ) const
inline

Get the value type of a type template parameter.

◆ ValueType() [2/2]

void Puma::CTemplateParamInfo::ValueType ( CTypeInfo * type)
inline

Set the value type of a type template parameter.

Parameters
typeThe value type.