![]() |
PUMA Library Reference Manual
|
#include <Puma/CTemplateInstance.h>
Semantic information about a template instance.
Contains the point of instantiation, the instantiated template, the instantiation arguments, and the deduced template arguments.
The point of instantiation (POI) is the corresponding template-id.
The instantiation arguments are the arguments of the template-id at the POI.
The deduced template arguments are calculated from the instantiation arguments and the template default arguments.
If a template instance is not yet created (maybe because real template instantiation is disabled or due to late template instantiation), then this template instance is called a pseudo instance.
Public Member Functions | |
| CTemplateInstance () | |
| Constructor. | |
| ~CTemplateInstance () | |
| Destructor. | |
| bool | instantiate (CStructure *scope) |
| If this is a pseudo instance, instantiate the template. | |
| CTemplateInfo * | Template () const |
| Get the semantic information about the instantiated template. | |
| CObjectInfo * | Object () const |
| Get the semantic information about the class or function. | |
| void | Template (CTemplateInfo *info) |
| Set the semantic information about the instantiated template. | |
| void | Object (CObjectInfo *info) |
| Set the semantic information about the instance. | |
| CTree * | PointOfInstantiation () const |
| Get the point of instantiation (e.g. | |
| CScopeInfo * | PointOfInstantiationScope () const |
| Get the scope in which the template was instantiated. | |
| void | PointOfInstantiation (CTree *poi, CScopeInfo *scope) |
| Set the point of instantiation (e.g. | |
| void | canInstantiate (bool can) |
| Set that the pseudo instance can be instantiated. | |
| bool | canInstantiate () |
| Return true if the pseudo instance can be instantiated. | |
| void | isPseudoInstance (bool v) |
| Set whether this is a pseudo template instance. | |
| bool | isPseudoInstance () const |
| Check if this is a pseudo template instance. | |
| void | isInstantiated (bool is) |
| Set whether this template instance really is instantiated. | |
| bool | isInstantiated () const |
| Check if this template instance really is instantiated. | |
| void | hasDelayedParseProblem (bool has) |
| Indicate a delayed parse problem during instantiation. | |
| bool | hasDelayedParseProblem () const |
| Check whether this instance had a delayed parse problem. | |
| unsigned | InstantiationArgs () const |
| Get the number of instantiation arguments. | |
| DeducedArgument * | InstantiationArg (unsigned n) const |
| Get the n-th instantiation argument. | |
| void | addInstantiationArg (DeducedArgument *arg) |
| Add an instantiation argument. | |
| unsigned | DeducedArgs () const |
| Get the number of deduced arguments. | |
| DeducedArgument * | DeducedArg (unsigned n) const |
| Get the n-th deduced template argument. | |
| void | addDeducedArg (DeducedArgument *arg) |
| Add a deduced template argument. | |
| void | clearDeducedArgs () |
| Discard the deduced template arguments. | |
Protected Attributes | |
| CTemplateInfo * | _TemplateInfo |
| The semantic information about the template. | |
| CObjectInfo * | _ObjectInfo |
| The semantic information about the instance. | |
| CTree * | _PointOfInstantiation |
| The point of instantiation. | |
| CScopeInfo * | _PointOfInstantiationScope |
| The scope in which the template was instantiated. | |
| Array< DeducedArgument * > | _DeducedArgs |
| The list of deduced template arguments. | |
| Array< DeducedArgument * > | _InstantiationArgs |
| The list of instantiation arguments. | |
| bool | _Pseudo |
| True if this is not a real template instance. | |
| bool | _CanInstantiate |
| True if this pseudo instance can be instantiated. | |
| bool | _IsInstantiated |
| True if instantiated. | |
| bool | _IsSpecialization |
| True if this is the instance of a template specialization. | |
| bool | _HasDelayedParseProblem |
| True if this node had a delayed parse problem. | |
|
inline |
Constructor.
| Puma::CTemplateInstance::~CTemplateInstance | ( | ) |
Destructor.
Destroys the instantiation and deduced arguments. Optionally destroys the translation unit of the instance code.
|
inline |
Add a deduced template argument.
| arg | The deduced template argument. |
|
inline |
Add an instantiation argument.
| arg | The instantiation argument. |
|
inline |
Return true if the pseudo instance can be instantiated.
|
inline |
Set that the pseudo instance can be instantiated.
|
inline |
Discard the deduced template arguments.
|
inline |
Get the n-th deduced template argument.
| n | The index of the template argument. |
|
inline |
Get the number of deduced arguments.
|
inline |
Check whether this instance had a delayed parse problem.
|
inline |
Indicate a delayed parse problem during instantiation.
| has | True for yes, false for no. |
| bool Puma::CTemplateInstance::instantiate | ( | CStructure * | scope | ) |
If this is a pseudo instance, instantiate the template.
| scope | The scope in which to instantiate the template. |
|
inline |
Get the n-th instantiation argument.
| n | The index of the instantiation argument. |
|
inline |
Get the number of instantiation arguments.
|
inline |
Check if this template instance really is instantiated.
|
inline |
Set whether this template instance really is instantiated.
| is | True for yes, false for no. |
|
inline |
Check if this is a pseudo template instance.
|
inline |
Set whether this is a pseudo template instance.
| v | True for yes, false for no. |
|
inline |
Get the semantic information about the class or function.
|
inline |
Set the semantic information about the instance.
| info | The instance object. |
|
inline |
Get the point of instantiation (e.g.
the template-id).
|
inline |
Set the point of instantiation (e.g.
the template-id).
| poi | The template-id used to instantiate the template. |
| scope | The scope in which the template was instantiated. |
|
inline |
Get the scope in which the template was instantiated.
|
inline |
Get the semantic information about the instantiated template.
|
inline |
Set the semantic information about the instantiated template.
| info | The template that was instantiated. |
|
protected |
True if this pseudo instance can be instantiated.
|
protected |
The list of deduced template arguments.
|
protected |
True if this node had a delayed parse problem.
|
protected |
The list of instantiation arguments.
|
protected |
True if instantiated.
|
protected |
True if this is the instance of a template specialization.
|
protected |
The semantic information about the instance.
|
protected |
The point of instantiation.
|
protected |
The scope in which the template was instantiated.
|
protected |
True if this is not a real template instance.
|
protected |
The semantic information about the template.