Puma Reference Manual Puma: Puma::CTemplateInfo Class Reference



Puma::CTemplateInfo Class Reference

#include <Puma/CTemplateInfo.h>

Inheritance diagram for Puma::CTemplateInfo:

Inheritance graph

List of all members.


Detailed Description

Semantic information about a template declaration.

Contains information about the parameters, specializations, and instances of the template.

Public Member Functions

 CTemplateInfo ()
 Constructor.
 ~CTemplateInfo ()
 Destructor.
void removeLinks ()
 Remove all links from other semantic objects to this semantic object.
bool isFunction () const
 Check if this is a function template definition.
bool isClass () const
 Check if this is a class template definition.
bool isAttribute () const
 Check if this is the definition of a static template class date member.
bool isBaseTemplate () const
 Check if this is a base template and not a specialization of another template.
bool isSpecialization () const
 Check if this is a specialization of another template.
void increaseDepth ()
 Increase the instantiation depth (for nested template instantiations).
void decreaseDepth ()
 Decrease the instantiation depth (for nested template instantiations).
unsigned Depth () const
 Get the current instantiation depth (for nested template instantiations).
CObjectInfoObjectInfo () const
 Get the semantic information for the entity.
CT_TemplateDeclTree () const
 Get the syntax tree node for the template declaration.
CTemplateInfoBaseTemplate () const
 Get the base template if this is template specialization.
CTemplateParamInfonewTemplateParam (bool add=true)
 Create a new template parameter.
unsigned Parameters () const
 Get the number of template parameters.
CTemplateParamInfoParameter (unsigned n) const
 Get the n-th template parameter.
CT_ExprListDefaultArgument (unsigned n) const
 Get the default argument of the n-th template parameter.
unsigned Instances () const
 Get the number of instances of this template.
CObjectInfoInstance (unsigned n)
 Get the n-th instance of this template.
void addInstance (CObjectInfo *info)
 Add the given instance to the template.
void addPseudoInstance (CObjectInfo *info)
 Add the given pseudo instance to the template.
void removeInstance (const CObjectInfo *info)
 Remove the given template instance.
unsigned Specializations () const
 Get the number of specializations of this template.
CTemplateInfoSpecialization (unsigned n)
 Get the n-th specialization of this template.
void addSpecialization (CTemplateInfo *info)
 Add the given specialization of the template.
void removeSpecialization (const CTemplateInfo *info)
 Remove the given specialization of the template.
void isSpecialization (bool v)
 Set whether this is a specialization of a template.
void SpecializationName (CT_TemplateName *name)
 Set the template specialization name (template id).
CT_TemplateNameSpecializationName () const
 Get the template specialization name.
void deleteTemplateParam (const CTemplateParamInfo *p)
 Remove and destroy the given template parameter.
void ObjectInfo (CObjectInfo *info)
 Set the semantic object of the entity (class, function, etc).
void BaseTemplate (CTemplateInfo *info)
 Set the base template if this is a template specialization.

Static Public Member Functions

static bool equalArguments (CTemplateInstance *i1, CTemplateInstance *i2)
 Check if the given template instances have the same instantiation arguments.


Constructor & Destructor Documentation

Puma::CTemplateInfo::CTemplateInfo (  )  [inline]

Constructor.

Puma::CTemplateInfo::~CTemplateInfo (  ) 

Destructor.

Unlinks itself from the specializations and instances of this template. If the object type is CObjectInfo::TEMPLATE_INFO, CObjectInfo::CleanUp() is called.


Member Function Documentation

void Puma::CTemplateInfo::removeLinks (  ) 

Remove all links from other semantic objects to this semantic object.

bool Puma::CTemplateInfo::isFunction (  )  const [inline]

Check if this is a function template definition.

Reimplemented from Puma::CScopeInfo.

bool Puma::CTemplateInfo::isClass (  )  const [inline]

Check if this is a class template definition.

Reimplemented from Puma::CScopeInfo.

bool Puma::CTemplateInfo::isAttribute (  )  const [inline]

Check if this is the definition of a static template class date member.

bool Puma::CTemplateInfo::isBaseTemplate (  )  const [inline]

Check if this is a base template and not a specialization of another template.

bool Puma::CTemplateInfo::isSpecialization (  )  const [inline]

Check if this is a specialization of another template.

void Puma::CTemplateInfo::increaseDepth (  )  [inline]

Increase the instantiation depth (for nested template instantiations).

void Puma::CTemplateInfo::decreaseDepth (  )  [inline]

Decrease the instantiation depth (for nested template instantiations).

unsigned Puma::CTemplateInfo::Depth (  )  const [inline]

Get the current instantiation depth (for nested template instantiations).

CObjectInfo * Puma::CTemplateInfo::ObjectInfo (  )  const [inline]

Get the semantic information for the entity.

Reimplemented from Puma::CObjectInfo.

CT_TemplateDecl * Puma::CTemplateInfo::Tree (  )  const [inline]

Get the syntax tree node for the template declaration.

Reimplemented from Puma::CObjectInfo.

CTemplateInfo * Puma::CTemplateInfo::BaseTemplate (  )  const [inline]

Get the base template if this is template specialization.

CTemplateParamInfo* Puma::CTemplateInfo::newTemplateParam ( bool  add = true  ) 

Create a new template parameter.

Parameters:
add If true, add the created parameter to the template.

unsigned Puma::CTemplateInfo::Parameters (  )  const [inline]

Get the number of template parameters.

CTemplateParamInfo * Puma::CTemplateInfo::Parameter ( unsigned  n  )  const [inline]

Get the n-th template parameter.

Parameters:
n The index of the template parameter.
Returns:
The template parameter or NULL if n is invalid.

CT_ExprList* Puma::CTemplateInfo::DefaultArgument ( unsigned  n  )  const

Get the default argument of the n-th template parameter.

Parameters:
n The index of the template parameter.
Returns:
The default argument expression or NULL if the parameter has no default argument.

unsigned Puma::CTemplateInfo::Instances (  )  const [inline]

Get the number of instances of this template.

CObjectInfo * Puma::CTemplateInfo::Instance ( unsigned  n  )  [inline]

Get the n-th instance of this template.

Parameters:
n The index of the instance.
Returns:
The template instance or NULL if n is invalid.

void Puma::CTemplateInfo::addInstance ( CObjectInfo info  )  [inline]

Add the given instance to the template.

Parameters:
info The semantic object of the template instance.

void Puma::CTemplateInfo::addPseudoInstance ( CObjectInfo info  )  [inline]

Add the given pseudo instance to the template.

Parameters:
info The pseudo template instance.

void Puma::CTemplateInfo::removeInstance ( const CObjectInfo info  ) 

Remove the given template instance.

Parameters:
info The template instance.

unsigned Puma::CTemplateInfo::Specializations (  )  const [inline]

Get the number of specializations of this template.

CTemplateInfo * Puma::CTemplateInfo::Specialization ( unsigned  n  )  [inline]

Get the n-th specialization of this template.

Parameters:
n The index of the specialization.
Returns:
The specialization or NULL if n is invalid.

void Puma::CTemplateInfo::addSpecialization ( CTemplateInfo info  ) 

Add the given specialization of the template.

Parameters:
info The semantic object of the specialization.

void Puma::CTemplateInfo::removeSpecialization ( const CTemplateInfo info  ) 

Remove the given specialization of the template.

Parameters:
info The template specialization.

void Puma::CTemplateInfo::isSpecialization ( bool  v  )  [inline]

Set whether this is a specialization of a template.

Parameters:
v true if this is a specialization.

void Puma::CTemplateInfo::SpecializationName ( CT_TemplateName name  )  [inline]

Set the template specialization name (template id).

Parameters:
name The template specialization name.

CT_TemplateName * Puma::CTemplateInfo::SpecializationName (  )  const [inline]

Get the template specialization name.

Returns:
The template specialization name or NULL if not a specialization.

void Puma::CTemplateInfo::deleteTemplateParam ( const CTemplateParamInfo p  ) 

Remove and destroy the given template parameter.

Parameters:
p The template parameter.

void Puma::CTemplateInfo::ObjectInfo ( CObjectInfo info  )  [inline]

Set the semantic object of the entity (class, function, etc).

Parameters:
info The semantic object.

void Puma::CTemplateInfo::BaseTemplate ( CTemplateInfo info  ) 

Set the base template if this is a template specialization.

Parameters:
info The base template.

static bool Puma::CTemplateInfo::equalArguments ( CTemplateInstance i1,
CTemplateInstance i2 
) [static]

Check if the given template instances have the same instantiation arguments.

Parameters:
i1 A template instance.
i2 Another template instance.




Puma Reference Manual. Created on 11 Jul 2008.