Instantiator
Generate c++ template instantiations
|
Struct for the collection of all relevant data for a template instantiation which needs to be inserted somewhere. More...
#include <Injection.hpp>
Public Types | |
typedef std::string | StringType |
Public Member Functions | |
std::string | getInstantiation () const |
bool | match (const Injection &other) const |
Static Public Member Functions | |
static Injection | createFromMFS (const clang::CXXMethodDecl *MFS, clang::PrintingPolicy pp) |
static Injection | createFromFS (const clang::FunctionDecl *FS, clang::PrintingPolicy pp) |
Public Attributes | |
StringType | func_name = "" |
StringType | nested_namespace = "" |
StringType | class_name = "" |
std::string | return_type = "" |
std::vector< std::string > | func_Ttypes |
std::vector< Instantiator::TemplateArgument > | class_Targs |
std::vector< Param > | params |
std::vector< Param > | nonresolved_params |
bool | is_const = false |
bool | is_member = false |
bool | is_constructor = false |
StringType | guess_injection_place |
Struct for the collection of all relevant data for a template instantiation which needs to be inserted somewhere.
Definition at line 20 of file Injection.hpp.
typedef std::string Injection::StringType |
Definition at line 22 of file Injection.hpp.
|
static |
Function to load all needed data from a clang::FunctionDecl.
FS | Pointer to a clang::FunctionDecl . |
pp | clang::PrintingPolicy which controls how strings are created. |
The following data is parsed:
Definition at line 30 of file Injection.cpp.
|
static |
Function to load all needed data from a clang::CXXMethodDecl.
MFS | Pointer to a clang::CXXMethodDecl . |
pp | clang::PrintingPolicy which controls how strings are created. |
Calls createFromFS() and loads the following member function information:
Definition at line 52 of file Injection.cpp.
std::string Injection::getInstantiation | ( | ) | const |
Definition at line 95 of file Injection.cpp.
bool Injection::match | ( | const Injection & | other | ) | const |
Checks whether other
does exactly match this
entry. I.e.:
Definition at line 15 of file Injection.cpp.
StringType Injection::class_name = "" |
For member functions, this is the name of the parent class. For free functions it is empty. E.g.
the class name would be "Bar"
.
Definition at line 40 of file Injection.hpp.
std::vector<Instantiator::TemplateArgument> Injection::class_Targs |
The concrete types of the class template parameters (for class template member functions only). E.g.
it would be {"double", "int"}
Definition at line 57 of file Injection.hpp.
StringType Injection::func_name = "" |
Name of the function without namespace and template parameters. For
the name would be "Foo"
.
Definition at line 27 of file Injection.hpp.
std::vector<std::string> Injection::func_Ttypes |
The concrete types of the function template parameters. E.g.
it would be {"double", "int"}
Definition at line 51 of file Injection.hpp.
StringType Injection::guess_injection_place |
Unused so far. Intended for more efficiency in the lookup step.
Definition at line 85 of file Injection.hpp.
bool Injection::is_const = false |
Whether this member function is const qualified.
Definition at line 73 of file Injection.hpp.
bool Injection::is_constructor = false |
Whether this a class constructor.
Definition at line 82 of file Injection.hpp.
bool Injection::is_member = false |
Whether this is a member function of some class.
Definition at line 76 of file Injection.hpp.
StringType Injection::nested_namespace = "" |
Nested namespace of the function. For For
the nested namespace would be "My::Nested::Namespace"
.
Definition at line 34 of file Injection.hpp.
std::vector<Param> Injection::nonresolved_params |
A vector of the function parameters where the parameters are not resolved with concrete types. If all of the parameter are nondependent on template parameters its the same as params. This information is needed to compare this Injection with possible candidates which provide the appropriate definition.
Definition at line 70 of file Injection.hpp.
std::vector<Param> Injection::params |
A vector of the function parameters where each parameter is fully resolved with the concrete types. This information is needed to create the explicit instantiation.
Definition at line 63 of file Injection.hpp.
std::string Injection::return_type = "" |
The return type of the function.
Definition at line 45 of file Injection.hpp.