Puma::CTemplateInstance Class Reference
Semantic information about a template instance.
More...
#include <Puma/CTemplateInstance.h>
List of all members.
Detailed Description
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.
template<class T1, class T2 = float>
struct Foo {
template<class T3, class T4>
T1 foo(T2,T3,T4*);
};
void bar(bool b, char* s) {
Foo<int> f;
f.foo(1,b,s);
}
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.
Constructor & Destructor Documentation
Puma::CTemplateInstance::CTemplateInstance |
( |
|
) |
[inline] |
Puma::CTemplateInstance::~CTemplateInstance |
( |
|
) |
[inline] |
Destructor.
Destroys the instantiation and deduced arguments. Optionally destroys the translation unit of the instance code.
Member Function Documentation
void Puma::CTemplateInstance::addDeducedArg |
( |
DeducedArgument * |
arg |
) |
[inline] |
Add a deduced template argument.
- Parameters:
-
| arg | The deduced template argument. |
void Puma::CTemplateInstance::addInstantiationArg |
( |
DeducedArgument * |
arg |
) |
[inline] |
Add an instantiation argument.
- Parameters:
-
| arg | The instantiation argument. |
void Puma::CTemplateInstance::canDelete |
( |
|
) |
[inline] |
Set that the translation unit containg the code of the template instance can be destroyed in the destructor of the template instance.
bool Puma::CTemplateInstance::canInstantiate |
( |
|
) |
[inline] |
Return true if the pseudo instance can be instantiated.
void Puma::CTemplateInstance::canInstantiate |
( |
bool |
can |
) |
[inline] |
Set that the pseudo instance can be instantiated.
void Puma::CTemplateInstance::clearDeducedArgs |
( |
|
) |
[inline] |
Discard the deduced template arguments.
DeducedArgument * Puma::CTemplateInstance::DeducedArg |
( |
unsigned |
n |
) |
const [inline] |
Get the n-th deduced template argument.
- Parameters:
-
| n | The index of the template argument. |
unsigned Puma::CTemplateInstance::DeducedArgs |
( |
|
) |
const [inline] |
Get the number of deduced arguments.
bool Puma::CTemplateInstance::instantiate |
( |
CStructure * |
scope |
) |
[inline] |
If this is a pseudo instance, instantiate the template.
- Parameters:
-
| scope | The scope in which to instantiate the template. |
- Returns:
- true if instantiation succeeded.
DeducedArgument * Puma::CTemplateInstance::InstantiationArg |
( |
unsigned |
n |
) |
const [inline] |
Get the n-th instantiation argument.
- Parameters:
-
| n | The index of the instantiation argument. |
unsigned Puma::CTemplateInstance::InstantiationArgs |
( |
|
) |
const [inline] |
Get the number of instantiation arguments.
bool Puma::CTemplateInstance::isInstantiated |
( |
|
) |
const [inline] |
Check if this template instance really is instantiated.
void Puma::CTemplateInstance::isInstantiated |
( |
bool |
is |
) |
[inline] |
Set whether this template instance really is instantiated.
- Parameters:
-
| is | True for yes, false for no. |
bool Puma::CTemplateInstance::isPseudoInstance |
( |
|
) |
const [inline] |
Check if this is a pseudo template instance.
void Puma::CTemplateInstance::isPseudoInstance |
( |
bool |
v |
) |
[inline] |
Set whether this is a pseudo template instance.
- Parameters:
-
| v | True for yes, false for no. |
void Puma::CTemplateInstance::Object |
( |
CObjectInfo * |
info |
) |
[inline] |
Set the semantic information about the instance.
- Parameters:
-
| info | The instance object. |
CObjectInfo * Puma::CTemplateInstance::Object |
( |
|
) |
const [inline] |
Get the semantic information about the class or function.
void Puma::CTemplateInstance::PointOfInstantiation |
( |
CTree * |
poi, |
|
|
CScopeInfo * |
scope | |
|
) |
| | [inline] |
Set the point of instantiation (e.g.
the template-id).
- Parameters:
-
| tplid | The template-id used to instantiate the template. |
| scope | The scope in which the template was instantiated. |
CTree * Puma::CTemplateInstance::PointOfInstantiation |
( |
|
) |
const [inline] |
Get the point of instantiation (e.g.
the template-id).
CScopeInfo * Puma::CTemplateInstance::PointOfInstantiationScope |
( |
|
) |
const [inline] |
Get the scope in which the template was instantiated.
void Puma::CTemplateInstance::Template |
( |
CTemplateInfo * |
info |
) |
[inline] |
Set the semantic information about the instantiated template.
- Parameters:
-
| info | The template that was instantiated. |
CTemplateInfo * Puma::CTemplateInstance::Template |
( |
|
) |
const [inline] |
Get the semantic information about the instantiated template.
Get the translation unit containing the code of the template instance.
void Puma::CTemplateInstance::TranslationUnit |
( |
CTranslationUnit * |
tu |
) |
[inline] |
Set the translation unit containing the code of the template instance.
- Parameters:
-
Member Data Documentation
True if this pseudo instance can be instantiated.
The list of deduced template arguments.
True if the template instance translation unit can be destroyed in the destructor of this class.
The translation unit containing the template instance code.
The list of instantiation arguments.
The semantic information about the instance.
The point of instantiation.
The scope in which the template was instantiated.
True if this is not a real template instance.
The semantic information about the template.
Puma Reference Manual. Created on 18 Sep 2009.