Emulation of the CINT CallFunc class.
The CINT C++ interpreter provides an interface for calling functions through the generated wrappers in dictionaries with the CallFunc class. This class provides the same functionality, using an interface as close as possible to CallFunc but the function metadata and calling service comes from the Cling C++ interpreter and the Clang C++ compiler, not CINT.
Definition at line 59 of file TClingCallFunc.h.
Private Types | |
| enum | EReferenceType { kNotReference , kLValueReference , kRValueReference } |
| using | ExecWithRetFunc_t = std::function<void(void* address, cling::Value &ret)> |
Private Member Functions | |
| size_t | CalculateMinRequiredArguments () |
| void | collect_type_info (clang::QualType &QT, std::ostringstream &typedefbuf, std::ostringstream &callbuf, std::string &type_name, EReferenceType &refType, bool &isPointer, int indent_level, bool forArgument) |
| void * | compile_wrapper (const std::string &wrapper_name, const std::string &wrapper, bool withAccessControl=true) |
| void | EvaluateArgList (const std::string &ArgList) |
| void | exec (void *address, void *ret) |
| void | exec_with_valref_return (void *address, cling::Value &ret) |
| template<typename T > | |
| T | ExecT (void *address) |
| size_t | GetMinRequiredArguments () |
| void | make_narg_call (const std::string &return_type, const unsigned N, std::ostringstream &typedefbuf, std::ostringstream &callbuf, const std::string &class_name, int indent_level) |
| void | make_narg_call_with_return (const unsigned N, const std::string &class_name, std::ostringstream &buf, int indent_level) |
| void | make_narg_ctor (const unsigned N, std::ostringstream &typedefbuf, std::ostringstream &callbuf, const std::string &class_name, int indent_level) |
| void | make_narg_ctor_with_return (const unsigned N, const std::string &class_name, std::ostringstream &buf, int indent_level) |
| tcling_callfunc_Wrapper_t | make_wrapper () |
Private Attributes | |
| llvm::SmallVector< cling::Value, 8 > | fArgVals |
| Stored function arguments, we own. | |
| const clang::FunctionDecl * | fDecl = nullptr |
| Decl for the method. | |
| cling::Interpreter * | fInterp |
| Cling interpreter, we do not own. | |
| std::unique_ptr< TClingMethodInfo > | fMethod |
| Current method, we own. | |
| size_t | fMinRequiredArguments = -1 |
| Number of required arguments. | |
| std::atomic< tcling_callfunc_Wrapper_t > | fWrapper |
| Pointer to compiled wrapper, we do not own. | |
#include </github/home/ROOT-CI/src/core/metacling/src/TClingCallFunc.h>
|
private |
Definition at line 83 of file TClingCallFunc.h.
|
private |
| Enumerator | |
|---|---|
| kNotReference | |
| kLValueReference | |
| kRValueReference | |
Definition at line 77 of file TClingCallFunc.h.
|
default |
|
inlineexplicit |
Definition at line 134 of file TClingCallFunc.h.
|
inlineexplicit |
Definition at line 140 of file TClingCallFunc.h.
|
inline |
Definition at line 147 of file TClingCallFunc.h.
|
private |
Definition at line 130 of file TClingCallFunc.cxx.
|
private |
Definition at line 175 of file TClingCallFunc.cxx.
|
private |
Definition at line 136 of file TClingCallFunc.cxx.
|
private |
Definition at line 1141 of file TClingCallFunc.cxx.
| void TClingCallFunc::Exec | ( | void * | address, |
| TInterpreterValue * | interpVal = 0 ) |
Definition at line 1165 of file TClingCallFunc.cxx.
|
private |
Definition at line 1044 of file TClingCallFunc.cxx.
|
private |
Definition at line 1119 of file TClingCallFunc.cxx.
| void * TClingCallFunc::ExecDefaultConstructor | ( | const TClingClassInfo * | info, |
| ROOT::TMetaUtils::EIOCtorCategory | kind, | ||
| const std::string & | type_name, | ||
| void * | address = nullptr, | ||
| unsigned long | nary = 0UL ) |
Definition at line 1240 of file TClingCallFunc.cxx.
| void TClingCallFunc::ExecDestructor | ( | const TClingClassInfo * | info, |
| void * | address = nullptr, | ||
| unsigned long | nary = 0UL, | ||
| bool | withFree = true ) |
Definition at line 1266 of file TClingCallFunc.cxx.
| double TClingCallFunc::ExecDouble | ( | void * | address | ) |
Definition at line 1212 of file TClingCallFunc.cxx.
| Longptr_t TClingCallFunc::ExecInt | ( | void * | address | ) |
Definition at line 1202 of file TClingCallFunc.cxx.
| long long TClingCallFunc::ExecInt64 | ( | void * | address | ) |
Definition at line 1207 of file TClingCallFunc.cxx.
|
private |
Definition at line 1182 of file TClingCallFunc.cxx.
| void TClingCallFunc::ExecWithArgsAndReturn | ( | void * | address, |
| const void * | args[] = 0, | ||
| int | nargs = 0, | ||
| void * | ret = 0 ) |
Definition at line 1217 of file TClingCallFunc.cxx.
| void TClingCallFunc::ExecWithReturn | ( | void * | address, |
| void * | ret = nullptr ) |
Definition at line 1229 of file TClingCallFunc.cxx.
| TClingMethodInfo * TClingCallFunc::FactoryMethod | ( | ) | const |
Definition at line 1283 of file TClingCallFunc.cxx.
| int TClingCallFunc::get_wrapper_code | ( | std::string & | wrapper_name, |
| std::string & | wrapper ) |
Definition at line 532 of file TClingCallFunc.cxx.
|
inline |
Definition at line 183 of file TClingCallFunc.h.
|
inline |
Definition at line 189 of file TClingCallFunc.h.
| const clang::DeclContext * TClingCallFunc::GetDeclContext | ( | ) | const |
Definition at line 528 of file TClingCallFunc.cxx.
|
inline |
Definition at line 194 of file TClingCallFunc.h.
|
inlineprivate |
Definition at line 119 of file TClingCallFunc.h.
| TInterpreter::CallFuncIFacePtr_t TClingCallFunc::IFacePtr | ( | ) |
Definition at line 1329 of file TClingCallFunc.cxx.
|
inline |
Definition at line 171 of file TClingCallFunc.h.
| void TClingCallFunc::Init | ( | ) |
Definition at line 1288 of file TClingCallFunc.cxx.
| void TClingCallFunc::Init | ( | const TClingMethodInfo & | minfo | ) |
Definition at line 1297 of file TClingCallFunc.cxx.
| void TClingCallFunc::Init | ( | std::unique_ptr< TClingMethodInfo > | minfo | ) |
Definition at line 1303 of file TClingCallFunc.cxx.
| void * TClingCallFunc::InterfaceMethod | ( | ) |
Definition at line 1309 of file TClingCallFunc.cxx.
| void TClingCallFunc::Invoke | ( | cling::Value * | result = 0 | ) | const |
| bool TClingCallFunc::IsValid | ( | ) | const |
Definition at line 1321 of file TClingCallFunc.cxx.
|
private |
Definition at line 327 of file TClingCallFunc.cxx.
|
private |
Definition at line 903 of file TClingCallFunc.cxx.
|
private |
Definition at line 270 of file TClingCallFunc.cxx.
|
private |
Definition at line 452 of file TClingCallFunc.cxx.
|
private |
Definition at line 1012 of file TClingCallFunc.cxx.
|
delete |
| void TClingCallFunc::ResetArg | ( | ) |
Definition at line 1344 of file TClingCallFunc.cxx.
|
inline |
Definition at line 199 of file TClingCallFunc.h.
Definition at line 1349 of file TClingCallFunc.cxx.
| void TClingCallFunc::SetArgs | ( | const char * | args | ) |
Definition at line 1357 of file TClingCallFunc.cxx.
| void TClingCallFunc::SetFunc | ( | const TClingClassInfo * | info, |
| const char * | method, | ||
| const char * | arglist, | ||
| bool | objectIsConst, | ||
| Longptr_t * | poffset ) |
Definition at line 1369 of file TClingCallFunc.cxx.
| void TClingCallFunc::SetFunc | ( | const TClingClassInfo * | info, |
| const char * | method, | ||
| const char * | arglist, | ||
| Longptr_t * | poffset ) |
Definition at line 1363 of file TClingCallFunc.cxx.
| void TClingCallFunc::SetFunc | ( | const TClingMethodInfo * | info | ) |
Definition at line 1397 of file TClingCallFunc.cxx.
| void TClingCallFunc::SetFuncProto | ( | const TClingClassInfo * | info, |
| const char * | method, | ||
| const char * | proto, | ||
| bool | objectIsConst, | ||
| Longptr_t * | poffset, | ||
| ROOT::EFunctionMatchMode | mode = ROOT::kConversionMatch ) |
Definition at line 1413 of file TClingCallFunc.cxx.
| void TClingCallFunc::SetFuncProto | ( | const TClingClassInfo * | info, |
| const char * | method, | ||
| const char * | proto, | ||
| Longptr_t * | poffset, | ||
| ROOT::EFunctionMatchMode | mode = ROOT::kConversionMatch ) |
Definition at line 1406 of file TClingCallFunc.cxx.
| void TClingCallFunc::SetFuncProto | ( | const TClingClassInfo * | info, |
| const char * | method, | ||
| const llvm::SmallVectorImpl< clang::QualType > & | proto, | ||
| bool | objectIsConst, | ||
| Longptr_t * | poffset, | ||
| ROOT::EFunctionMatchMode | mode = ROOT::kConversionMatch ) |
Definition at line 1441 of file TClingCallFunc.cxx.
| void TClingCallFunc::SetFuncProto | ( | const TClingClassInfo * | info, |
| const char * | method, | ||
| const llvm::SmallVectorImpl< clang::QualType > & | proto, | ||
| Longptr_t * | poffset, | ||
| ROOT::EFunctionMatchMode | mode = ROOT::kConversionMatch ) |
Definition at line 1434 of file TClingCallFunc.cxx.
|
mutableprivate |
Stored function arguments, we own.
Definition at line 74 of file TClingCallFunc.h.
|
private |
Decl for the method.
Definition at line 68 of file TClingCallFunc.h.
|
private |
Cling interpreter, we do not own.
Definition at line 64 of file TClingCallFunc.h.
|
private |
Current method, we own.
Definition at line 66 of file TClingCallFunc.h.
|
private |
Number of required arguments.
Definition at line 70 of file TClingCallFunc.h.
|
private |
Pointer to compiled wrapper, we do not own.
Definition at line 72 of file TClingCallFunc.h.