2#ifndef _CRT_SECURE_NO_WARNINGS
4#define _CRT_SECURE_NO_WARNINGS
65#define DIRECT_CALL ((size_t)1 << (8 * sizeof(size_t) - 1))
67 return nargs & ~DIRECT_CALL;
92std::string find_memoized_resolved_name(
const std::string&
name)
109 typedef const void* DeclId_t;
113 CallWrapper(DeclId_t fid,
const std::string&
n) : fDecl(fid), fName(
n), fTF(
nullptr) {}
132 CallWrapper* wrap =
new CallWrapper(
f);
140 CallWrapper* wrap =
new CallWrapper(fid,
n);
160 {
"bool",
"char",
"signed char",
"unsigned char",
"wchar_t",
"short",
"unsigned short",
161 "int",
"unsigned int",
"long",
"unsigned long",
"long long",
"unsigned long long",
162 "float",
"double",
"long double",
"void",
163 "allocator",
"array",
"basic_string",
"complex",
"initializer_list",
"less",
"list",
164 "map",
"pair",
"set",
"vector"};
168 {
"auto_ptr",
"std::auto_ptr",
"shared_ptr",
"std::shared_ptr",
169 "unique_ptr",
"std::unique_ptr",
"weak_ptr",
"std::weak_ptr"};
186const int SIGPIPE = 0;
187const int SIGQUIT = 0;
188const int SIGWINCH = 0;
189const int SIGALRM = 0;
190const int SIGCHLD = 0;
192const int SIGUSR1 = 0;
193const int SIGUSR2 = 0;
200 { SIGBUS,
"bus error" },
201 { SIGSEGV,
"segmentation violation" },
202 { SIGSYS,
"bad argument to system call" },
203 { SIGPIPE,
"write on a pipe with no one to read it" },
204 { SIGILL,
"illegal instruction" },
205 { SIGABRT,
"abort" },
207 { SIGINT,
"interrupt" },
208 { SIGWINCH,
"window size change" },
209 { SIGALRM,
"alarm clock" },
210 { SIGCHLD,
"death of a child" },
211 { SIGURG,
"urgent data arrived on an I/O channel" },
212 { SIGFPE,
"floating point exception" },
213 { SIGTERM,
"termination signal" },
214 { SIGUSR1,
"user-defined signal 1" },
215 { SIGUSR2,
"user-defined signal 2" }
218static void inline do_trace(
int sig) {
225 void HandleException(
Int_t sig)
override {
232 if (!std::getenv(
"CPPYY_CRASH_QUIET"))
244class ApplicationStarter {
246 ApplicationStarter() {
269 const char* stl_names[] = {
"allocator",
"auto_ptr",
"bad_alloc",
"bad_cast",
270 "bad_exception",
"bad_typeid",
"basic_filebuf",
"basic_fstream",
"basic_ifstream",
271 "basic_ios",
"basic_iostream",
"basic_istream",
"basic_istringstream",
272 "basic_ofstream",
"basic_ostream",
"basic_ostringstream",
"basic_streambuf",
273 "basic_string",
"basic_stringbuf",
"basic_stringstream",
"binary_function",
274 "binary_negate",
"bitset",
"byte",
"char_traits",
"codecvt_byname",
"codecvt",
"collate",
275 "collate_byname",
"compare",
"complex",
"ctype_byname",
"ctype",
"default_delete",
276 "deque",
"divides",
"domain_error",
"equal_to",
"exception",
"forward_list",
"fpos",
277 "function",
"greater_equal",
"greater",
"gslice_array",
"gslice",
"hash",
"indirect_array",
278 "integer_sequence",
"invalid_argument",
"ios_base",
"istream_iterator",
"istreambuf_iterator",
279 "istrstream",
"iterator_traits",
"iterator",
"length_error",
"less_equal",
"less",
280 "list",
"locale",
"localedef utility",
"locale utility",
"logic_error",
"logical_and",
281 "logical_not",
"logical_or",
"map",
"mask_array",
"mem_fun",
"mem_fun_ref",
"messages",
282 "messages_byname",
"minus",
"modulus",
"money_get",
"money_put",
"moneypunct",
283 "moneypunct_byname",
"multimap",
"multiplies",
"multiset",
"negate",
"not_equal_to",
284 "num_get",
"num_put",
"numeric_limits",
"numpunct",
"numpunct_byname",
285 "ostream_iterator",
"ostreambuf_iterator",
"ostrstream",
"out_of_range",
286 "overflow_error",
"pair",
"plus",
"pointer_to_binary_function",
287 "pointer_to_unary_function",
"priority_queue",
"queue",
"range_error",
288 "raw_storage_iterator",
"reverse_iterator",
"runtime_error",
"set",
"shared_ptr",
289 "slice_array",
"slice",
"stack",
"string",
"strstream",
"strstreambuf",
290 "time_get_byname",
"time_get",
"time_put_byname",
"time_put",
"unary_function",
291 "unary_negate",
"unique_ptr",
"underflow_error",
"unordered_map",
"unordered_multimap",
292 "unordered_multiset",
"unordered_set",
"valarray",
"vector",
"weak_ptr",
"wstring",
293 "__hash_not_enabled"};
294 for (
auto&
name : stl_names)
299 if (std::getenv(
"CPPYY_OPT_LEVEL")) optLevel = atoi(std::getenv(
"CPPYY_OPT_LEVEL"));
301 std::ostringstream s;
302 s <<
"#pragma cling optimize " << optLevel;
308 "#include <iostream>\n"
309 "#include <string>\n"
310 "#include <DllImport.h>\n"
311 "#include <vector>\n"
312 "#include <utility>";
317 "namespace __cppyy_internal { template<class C1, class C2>"
318 " bool is_equal(const C1& c1, const C2& c2) { return (bool)(c1 == c2); } }");
320 "namespace __cppyy_internal { template<class C1, class C2>"
321 " bool is_not_equal(const C1& c1, const C2& c2) { return (bool)(c1 != c2); } }");
324 gInterpreter->Declare(
"namespace __cppyy_internal { struct Sep; }");
327 if (!std::getenv(
"CPPYY_NO_ROOT_FILTER")) {
328 gROOT->GetListOfGlobals(
true);
329 gROOT->GetListOfGlobalFunctions(
true);
330 std::set<std::string> initial;
343 gRootSOs.insert(
"libMathCore.dll ");
354 ~ApplicationStarter() {
359} _applicationStarter;
368 assert((ClassRefs_t::size_type)scope <
g_classrefs.size());
374 CallWrapper* wrap = ((CallWrapper*)method);
376 MethodInfo_t* mi =
gInterpreter->MethodInfo_Factory(wrap->fDecl);
397 char* cstr = (
char*)
malloc(cppstr.size()+1);
398 memcpy(cstr, cppstr.c_str(), cppstr.size()+1);
403bool match_name(
const std::string& tname,
const std::string fname)
406 if (fname.rfind(tname, 0) == 0) {
407 if ((tname.size() == fname.size()) ||
408 (tname.size() < fname.size() && fname[tname.size()] ==
'<'))
417 std::string::size_type pos =
name.find(
'<');
418 if (pos != std::string::npos)
444 std::string memoized = find_memoized_resolved_name(cppitem_name);
445 if (!memoized.empty())
return memoized;
448 std::string tclean = cppitem_name.compare(0, 2,
"::") == 0 ?
449 cppitem_name.substr(2, std::string::npos) : cppitem_name;
453 if (tclean.empty() )
return cppitem_name;
456 if (tclean[tclean.size()-1] ==
']')
457 tclean = tclean.substr(0, tclean.rfind(
'[')) +
"[]";
459 if (tclean.rfind(
"byte", 0) == 0 || tclean.rfind(
"std::byte", 0) == 0)
463 auto pos = tclean.rfind(
"__restrict");
464 if (pos != std::string::npos)
465 tclean = tclean.substr(0, pos);
467 if (tclean.compare(0, 9,
"std::byte") == 0)
479 pos = cppitem_name.size() > 20 ? \
480 cppitem_name.rfind(
"__type_pack_element", 5) : std::string::npos;
481 if (pos != std::string::npos) {
485 const char* str = cppitem_name.c_str();
486 char* endptr =
nullptr;
487 unsigned long index = strtoul(str+20+pos, &endptr, 0);
489 std::string tmplvars{endptr};
490 auto start = tmplvars.find(
',') + 1;
491 auto end = tmplvars.find(
',', start);
494 end = tmplvars.find(
',', start);
495 if (end == std::string::npos) end = tmplvars.rfind(
'>');
499 std::string resolved = tmplvars.substr(start, end-start);
500 auto cpd = tmplvars.rfind(
'>');
501 if (cpd != std::string::npos && cpd+1 != tmplvars.size())
502 return resolved + tmplvars.substr(cpd+1, std::string::npos);
510 while ((pos = tclean.find(
"::::", pos)) != std::string::npos) {
511 tclean.replace(pos, 4,
"::");
515 if (tclean.compare(0, 6,
"const ") != 0)
532 if (et_short.find(
"(unnamed") == std::string::npos) {
533 std::ostringstream decl;
535 for (
auto& itype : {
"unsigned int"}) {
536 decl <<
"std::is_same<"
538 <<
", std::underlying_type<"
540 <<
">::type>::value;";
544 std::string resugared;
545 if (et_short.size() != enum_type.size()) {
546 auto pos = enum_type.find(et_short);
547 if (pos != std::string::npos) {
548 resugared = enum_type.substr(0, pos) + itype;
549 if (pos+et_short.size() < enum_type.size())
550 resugared += enum_type.substr(pos+et_short.size(), std::string::npos);
553 if (resugared.empty()) resugared = itype;
561 int ipos = (
int)enum_type.size()-1;
562 for (; 0 <= ipos; --ipos) {
563 char c = enum_type[ipos];
564 if (isspace(
c))
continue;
565 if (isalnum(
c) ||
c ==
'_' ||
c ==
'>' ||
c ==
')')
break;
567 bool isConst = enum_type.find(
"const ", 6) != std::string::npos;
568 std::string restype = isConst ?
"const " :
"";
569 restype +=
"internal_enum_type_t"+enum_type.substr((std::string::size_type)ipos+1, std::string::npos);
588 bool bHasAlias1 = sname != scope_name;
590 result = find_memoized_scope(scope_name);
599 if (b_scope_name_missclassified) {
600 result = find_memoized_scope(
"std::"+scope_name);
604 if (b_sname_missclassified) {
605 if (!
result)
result = find_memoized_scope(
"std::"+sname);
619 bool bHasAlias2 = cr->
GetName() != scope_name;
634 if (b_scope_name_missclassified)
636 if (b_sname_missclassified)
646 return (
bool)
gInterpreter->CheckClassTemplate(template_name.c_str());
652 virtual ~AutoCastRTTI() {}
659 if (!cr.
GetClass() || !obj)
return klass;
668 std::string clName = cr->
GetName();
669 if (clName.find(
"std::", 0, 5) == 0 && clName.find(
"stream") != std::string::npos)
677 volatile const char* raw =
nullptr;
680 AutoCastRTTI* pcst = (AutoCastRTTI*)obj;
681 raw =
typeid(*pcst).raw_name();
684 void* vfptr = *(
void**)((intptr_t)obj);
685 void* meta = (
void*)((intptr_t)*((
void**)((intptr_t)vfptr-
sizeof(
void*))));
686 if (*(intptr_t*)meta == 2) {
688 void* ptdescr = (
void*)((intptr_t)meta + 4*
sizeof(
unsigned long)+
sizeof(
void*));
689 if (ptdescr && *(
void**)ptdescr) {
690 auto rtti = *(std::type_info**)ptdescr;
691 raw = rtti->raw_name();
692 if (raw && raw[0] !=
'\0')
704 }
catch (std::bad_typeid) {
732 if (dt)
return dt->
Size();
746 if (strstr(tclean.c_str(),
"std::complex"))
763 ClassInfo_t* ci =
gInterpreter->ClassInfo_Factory(type_name.c_str());
819 CallWrapper* wrap = (CallWrapper*)method;
822 MethodInfo_t* meth =
gInterpreter->MethodInfo_Factory(wrap->fDecl);
826 if (!(callf &&
gInterpreter->CallFunc_IsValid(callf))) {
832 std::cerr <<
"TODO: report unresolved function error to Python\n";
842 wrap->fFaceptr =
gInterpreter->CallFunc_IFacePtr(callf);
846 return wrap->fFaceptr;
852 bool runRelease =
false;
853 for (
size_t i = 0; i < nargs; ++i) {
854 switch (args[i].fTypeCode) {
861 vargs[i] = args[i].
fRef;
864 vargs[i] = (
void*)&args[i].fValue.fVoidp;
873 for (
size_t i = 0; i < nargs; ++i) {
874 if (args[i].fTypeCode ==
'X')
875 free(args[i].fValue.fVoidp);
885 CallWrapper* wrap = (CallWrapper*)method;
891 bool runRelease =
false;
894 if (nargs) runRelease =
copy_args(args, nargs, smallbuf);
897 std::vector<void*> buf(nargs);
898 runRelease =
copy_args(args, nargs, buf.data());
906 bool runRelease =
false;
909 if (nargs) runRelease =
copy_args(args, nargs, (
void**)smallbuf);
910 faceptr.
fCtor((
void**)smallbuf,
result, (
unsigned long)nargs);
912 std::vector<void*> buf(nargs);
913 runRelease =
copy_args(args, nargs, buf.data());
914 faceptr.
fCtor(buf.data(),
result, (
unsigned long)nargs);
921 std::cerr <<
" DESTRUCTOR NOT IMPLEMENTED YET! " << std::endl;
933 if (
WrapperCall(method, nargs, args, (
void*)self, &t))
938#define CPPYY_IMP_CALL(typecode, rtype) \
939rtype Cppyy::Call##typecode(TCppMethod_t method, TCppObject_t self, size_t nargs, void* args)\
941 return CallT<rtype>(method, self, nargs, args); \
946 if (!
WrapperCall(method, nargs, args, (
void*)self,
nullptr))
971 char* cstr =
nullptr;
973 std::string* cppresult = (std::string*)
malloc(
sizeof(std::string));
974 if (
WrapperCall(method, nargs, args, self, (
void*)cppresult)) {
976 *
length = cppresult->size();
977 cppresult->std::string::~basic_string();
980 free((
void*)cppresult);
988 if (
WrapperCall(method, nargs, args,
nullptr, &obj))
1006 ::operator
delete(obj);
1025 if (strstr(
f->GetName(),
"<")) {
1027 std::ostringstream sig;
1028 sig <<
"template " << fn <<
";";
1031 std::ostringstream sig;
1033 std::string sfn = fn;
1034 std::string::size_type pos = sfn.find(
'(');
1035 if (pos != std::string::npos) sfn = sfn.substr(0, pos);
1038 sig <<
'(' <<
f->GetReturnTypeName() <<
" (";
1041 pos = sfn.rfind(
':');
1042 if (pos != std::string::npos) {
1043 std::string scope_name = sfn.substr(0, pos-1);
1046 sig << scope_name <<
"::";
1108 if (type_name.empty())
return false;
1110 if (tn_short.empty())
return false;
1111 return gInterpreter->ClassInfo_IsEnum(tn_short.c_str());
1138 for (std::string::size_type pos = 0; pos <
name.size(); ++pos) {
1139 std::string::value_type
c =
name[pos];
1148 else if (tpl_open == 0 && \
1149 c ==
':' && pos+1 <
name.size() &&
name[pos+1] ==
':') {
1151 return name.substr(0, pos-1);
1163 std::string::size_type first_scope =
name.find(
':');
1164 if (first_scope == std::string::npos)
1165 return name.substr(0,
name.find(
'<'));
1166 std::string::size_type first_templ =
name.find(
'<');
1167 if (first_templ == std::string::npos)
1168 return name.substr(0, first_scope);
1169 return name.substr(0, std::min(first_templ, first_scope));
1172#define FILL_COLL(type, filter) { \
1174 type* obj = nullptr; \
1175 while ((obj = (type*)itr.Next())) { \
1176 const char* nm = obj->GetName(); \
1177 if (nm && nm[0] != '_' && !(obj->Property() & (filter))) { \
1178 if (gInitialNames.find(nm) == gInitialNames.end()) \
1179 cppnames.insert(nm); \
1184 std::set<std::string>& cppnames,
const char*
name,
bool nofilter =
false)
1186 if (!
name ||
name[0] ==
'_' || strstr(
name,
".h") != 0 || strncmp(
name,
"operator", 8) == 0)
1194 if (strncmp(
name,
"std::", 5) == 0) {
1197 if (strncmp(
name,
"__1::", 5) == 0)
name += 5;
1203 if (strncmp(
name, ns_scope.c_str(), ns_scope.size()) == 0)
1225 while ((ev = (
TEnvRec*)itr.Next())) {
1242 coll =
gROOT->GetListOfTypes();
1259 while ((obj = (
TFunction*)itr.Next())) {
1260 const char* nm = obj->
GetName();
1262 if (nm && nm[0] !=
'_' && strstr(nm,
"<") == 0 && strncmp(nm,
"operator", 8) != 0) {
1264 cppnames.insert(nm);
1276 coll =
gROOT->GetListOfGlobals();
1302 std::vector<Cppyy::TCppScope_t> res;
1318 res.reserve(
v.size());
1319 for (
const auto& uid :
v) {
1321 if (uscope) res.push_back(uscope);
1334 std::string clName = cr->
GetName();
1336 std::string::size_type pos = clName.substr(0, clName.find(
'<')).rfind(
"::");
1337 if (pos != std::string::npos)
1338 return clName.substr(pos+2, std::string::npos);
1350 return std::string(
"std::")+cr->
GetName();
1380 else if (nbases == 0)
1431 auto ndirectbases = directbases->
GetSize();
1432 if (ndirectbases == 0) {
1437 std::vector<Cppyy::TCppIndex_t> nbases_branches;
1438 nbases_branches.reserve(ndirectbases);
1499 const std::string&
tn =
cr->GetName();
1510 if (!raw && !
deref)
return true;
1513 if (
cr.GetClass()) {
1514 TFunction* func =
cr->GetMethod(
"operator->",
"");
1517 func =
cr->GetMethod(
"operator->",
"");
1550 return (ptrdiff_t)0;
1556 return (ptrdiff_t)0;
1565 std::ostringstream
msg;
1566 msg <<
"failed offset calculation between " << cb->
GetName() <<
" and " << cd->
GetName();
1569 std::cerr <<
"Warning: " <<
msg.str() <<
'\n';
1592 return gROOT->GetListOfGlobalFunctions(
true)->GetSize();
1595 if (
cr.GetClass() &&
cr->GetListOfMethods(
true)) {
1599 if (
clName.find(
'<') != std::string::npos) {
1602 std::ostringstream
stmt;
1619 std::vector<TCppIndex_t> indices;
1621 if (
cr.GetClass()) {
1625 TIter next(
cr->GetListOfMethods());
1657 if (
cr.GetClass()) {
1670 const std::string&
name = ((CallWrapper*)
method)->fName;
1672 if (
name.compare(0, 8,
"operator") != 0)
1674 return name.substr(0,
name.find(
'<'));
1683 std::string
name = ((CallWrapper*)
method)->fName;
1702 return "constructor";
1703 std::string
restype =
f->GetReturnTypeName();
1710 if (
restype.find(
"int8_t") != std::string::npos)
1712 restype =
f->GetReturnTypeNormalizedName();
1714 std::ostringstream s;
1716 s <<
"__cling_internal::FT<decltype("
1719 if (i != 0) s <<
", ";
1764 if (
ft.rfind(
"enum ", 0) != std::string::npos) {
1766 return arg_type.insert(
arg_type.rfind(
"const ", 0) == std::string::npos ? 0 : 6,
"enum ");
1822 std::ostringstream sig;
1824 int nArgs =
f->GetNargs();
1848 std::ostringstream sig;
1849 sig <<
f->GetReturnTypeName() <<
" "
1850 <<
scName <<
"::" <<
f->GetName();
1876 if (
cr.GetClass()) {
1893 return cr->GetListOfFunctionTemplates(
false)->At((
int)
imeth)->GetName();
1897 assert(!
"should not be called unless GetNumTemplatedMethods() succeeded");
1907 if (
cr.GetClass()) {
1918 return (
bool)
gROOT->GetFunctionTemplate(
name.c_str());
1922 return (
bool)
cr->GetFunctionTemplate(
name.c_str());
1937 tf =
cr->GetFunctionTemplate(
name.c_str());
1940 if (!
tf)
return false;
1948 if (
cr.GetClass()) {
1950 if (
f &&
strstr(
f->GetName(),
"<"))
return true;
1955 if (((CallWrapper*)idx)->fName.find(
'<') != std::string::npos)
return true;
1965 n.erase(pos,
n.
end());
1970 if (
n1.back() ==
'>')
n1 =
n1.substr(0,
n1.size()-1);
1973 return n2.compare(0,
n1.size(),
n1) == 0;
1987 func =
gROOT->GetGlobalFunctionWithPrototype(
name.c_str(),
proto.c_str());
1988 if (func &&
name.back() ==
'>') {
1996 if (
cr.GetClass()) {
1997 func =
cr->GetMethodWithPrototype(
name.c_str(),
proto.c_str());
1999 cl =
cr->GetClassInfo();
2037 if (
name.back() ==
'>') {
2038 auto pos =
name.find(
'<');
2039 if (pos != std::string::npos) {
2044 if (
name.size() <
alt.size() &&
alt.find(
'<') == pos) {
2063 if (
n1 ==
"str" ||
n1 ==
"unicode") {
2064 if (
n2 ==
"std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >")
2066 return "std::string";
2067 }
else if (
n1 ==
"float") {
2069 }
else if (
n1 ==
"complex") {
2070 return "std::complex<double>";
2089 func =
gROOT->GetGlobalFunctionWithPrototype(
opname.c_str(),
proto.c_str());
2093 if (
cr.GetClass()) {
2095 if (func)
return (
TCppIndex_t)
cr->GetListOfMethods()->IndexOf(func);
2097 func =
cr->GetMethodWithPrototype(
opname.c_str(),
proto.c_str());
2098 if (func)
return (
TCppIndex_t)
cr->GetListOfMethods()->IndexOf(func);
2113 return f->Property() &
prop;
2121 return f->ExtraProperty() &
prop;
2161 return gROOT->GetListOfGlobals(
true)->GetSize();
2164 if (
cr.GetClass() &&
cr->GetListOfDataMembers())
2165 return cr->GetListOfDataMembers()->GetSize();
2173 if (
cr.GetClass()) {
2179 return gbl->GetName();
2186 std::string::size_type pos =
tpname.find(
"::", 0);
2187 while (pos != std::string::npos) {
2189 pos =
tpname.find(
"::", pos+1);
2200 if ((
int)
gbl->GetArrayDim()) {
2201 std::ostringstream s;
2202 for (
int i = 0; i < (
int)
gbl->GetArrayDim(); ++i)
2203 s <<
'[' <<
gbl->GetMaxIndex(i) <<
']';
2210 if (
cr.GetClass()) {
2219 const char*
ft =
m->GetFullTypeName(); std::string
fullType =
ft ?
ft :
"";
2220 const char*
tn =
m->GetTrueTypeName(); std::string
trueName =
tn ?
tn :
"";
2227 fullType.insert(
fullType.rfind(
"const ", 0) == std::string::npos ? 0 : 6,
"enum ");
2231 if ((
int)
m->GetArrayDim()) {
2232 std::ostringstream s;
2233 for (
int i = 0; i < (
int)
m->GetArrayDim(); ++i)
2234 s <<
'[' <<
m->GetMaxIndex(i) <<
']';
2247 if (!
gbl->GetAddress() ||
gbl->GetAddress() == (
void*)-1) {
2249 intptr_t
addr = (intptr_t)
gInterpreter->ProcessLine((std::string(
"&")+
gbl->GetName()+
";").c_str());
2250 if (
gbl->GetAddress() &&
gbl->GetAddress() != (
void*)-1)
2251 return (intptr_t)
gbl->GetAddress();
2254 return (intptr_t)
gbl->GetAddress();
2258 if (
cr.GetClass()) {
2263 intptr_t
offset = (intptr_t)-1;
2267 offset = (intptr_t)
m->GetOffsetCint();
2269 if (
offset == (intptr_t)-1)
2270 return (intptr_t)
gInterpreter->ProcessLine((std::string(
"&")+
cr->GetName()+
"::"+
m->
GetName()+
";").c_str());
2272 offset = (intptr_t)
m->GetOffsetCint();
2276 return (intptr_t)-1;
2310 if (
gb &&
strcmp(
gb->GetFullTypeName(),
"(lambda)") == 0) {
2315 std::ostringstream s;
2316 s <<
"auto __cppyy_internal_wrap_" <<
name <<
" = "
2317 "new __cling_internal::FT<decltype(" <<
name <<
")>::F"
2318 "{" <<
name <<
"};";
2321 (
"__cppyy_internal_wrap_"+
name).c_str());
2322 if (wrap && wrap->GetAddress())
gb = wrap;
2329 if (
cr.GetClass()) {
2333 if (dm)
return (
TCppIndex_t)
cr->GetListOfDataMembers()->IndexOf(dm);
2390 property =
gbl->Property();
2393 if (
cr.GetClass()) {
2395 property =
m->Property();
2419 if (
cr.GetClass()) {
2421 std::string
ti =
m->GetTypeName();
2424 if (
ti.rfind(
"(anonymous)") != std::string::npos ||
ti.rfind(
"(unnamed)") != std::string::npos)
2429 if (
ti.rfind(
cr->GetName(), 0) != std::string::npos) {
2430 std::string::size_type s =
strlen(
cr->GetName())+2;
2431 if (s <
ti.size()) {
2447 return gbl->GetMaxIndex(dimension);
2450 if (
cr.GetClass()) {
2452 return m->GetMaxIndex(dimension);
2484 return (
long long)
ecst->GetValue();
static Roo_reg_AGKInteg1D instance
int Int_t
Signed integer 4 bytes (int)
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
long double LongDouble_t
Long Double (not portable)
long long Long64_t
Portable signed long integer 8 bytes.
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Int_t gErrorIgnoreLevel
errors with level below this value will be ignored. Default is kUnset.
R__EXTERN TExceptionHandler * gExceptionHandler
R__EXTERN ExceptionContext_t * gException
R__EXTERN void Throw(int code)
If an exception context has been set (using the TRY and RETRY macros) jump back to where it was set.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h prop
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h req_type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void funcs
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t property
R__EXTERN TSystem * gSystem
static struct Signalmap_t gSignalMap[kMAXSIGNALS]
const_iterator begin() const
const_iterator end() const
Each class (see TClass) has a linked list of its base class(es).
Long_t Property() const override
Get property description word. For meaning of bits see EProperty.
TClassRef is used to implement a permanent reference to a TClass object.
TClass * GetClass() const
TClass instances represent classes, structs and namespaces in the ROOT type system.
TList * GetListOfUsingDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of using declarations of a class.
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
TMethod * GetMethod(const char *method, const char *params, Bool_t objectIsConst=kFALSE)
Find the best method (if there is one) matching the parameters.
TMethod * GetMethodWithPrototype(const char *method, const char *proto, Bool_t objectIsConst=kFALSE, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch)
Find the method with a given prototype.
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
TList * GetListOfFunctionTemplates(Bool_t load=kTRUE)
Return TListOfFunctionTemplates for a class.
TList * GetListOfEnums(Bool_t load=kTRUE)
Return a list containing the TEnums of a class.
TList * GetListOfMethods(Bool_t load=kTRUE)
Return list containing the TMethods of a class.
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
ClassInfo_t * GetClassInfo() const
Long_t ClassProperty() const
Return the C++ property of this class, eg.
Long_t Property() const override
Returns the properties of the TClass as a bit field stored as a Long_t value.
Bool_t HasDefaultConstructor(Bool_t testio=kFALSE) const
Return true if we have access to a constructor usable for I/O.
TMethod * GetMethodAllAny(const char *method)
Return pointer to method without looking at parameters.
ROOT::DelFunc_t GetDelete() const
Return the wrapper around delete ThisObject.
TClass * GetActualClass(const void *object) const
Return a pointer to the real class of the object.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Collection abstract base class.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
All ROOT classes may have RTTI (run time type identification) support added.
Basic data type descriptor (datatype information is obtained from CINT).
Long_t Property() const override
Get property description word. For meaning of bits see EProperty.
Int_t Size() const
Get size of basic typedef'ed type.
The TEnumConstant class implements the constants of the enum type.
The TEnum class implements the enum type.
const char * GetValue() const
const char * GetName() const override
Returns name of object.
Dictionary for function template This class describes one single function template.
Global functions class (global functions are obtained from CINT).
Long_t Property() const override
Get property description word. For meaning of bits see EProperty.
Long_t ExtraProperty() const
Get property description word. For meaning of bits see EProperty.
std::string GetReturnTypeNormalizedName() const
Get the normalized name of the return type.
Global variables class (global variables are obtained from CINT).
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
A collection of TDataMember objects designed for fast access given a DeclId_t and for keep track of T...
A collection of TEnum objects designed for fast access given a DeclId_t and for keep track of TEnum t...
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
Each ROOT method (see TMethod) has a linked list of its arguments.
const char * GetFullTypeName() const
Get full type description of method argument, e.g.: "class TDirectory*".
TypeInfo_t * GetTypeInfo() const
Get the TypeInfo of the method argument.
const char * GetDefault() const
Get default value of method argument.
std::string GetTypeNormalizedName() const
Get the normalized name of the return type.
const char * GetName() const override
Returns name of object.
virtual const char * GetName() const
Returns name of object.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
static Bool_t Initialized()
Return kTRUE if the TROOT object has been initialized.
virtual void Exit(int code, Bool_t mode=kTRUE)
Exit the application.
virtual void StackTrace()
Print a stack trace.
static void cond_add(Cppyy::TCppScope_t scope, const std::string &ns_scope, std::set< std::string > &cppnames, const char *name, bool nofilter=false)
static bool testMethodProperty(Cppyy::TCppMethod_t method, EProperty prop)
static Name2ClassRefIndex_t g_name2classrefidx
#define FILL_COLL(type, filter)
static void remove_space(std::string &n)
static std::string outer_with_template(const std::string &name)
static std::string outer_no_template(const std::string &name)
static std::string type_remap(const std::string &n1, const std::string &n2)
static std::map< Cppyy::TCppType_t, bool > sHasOperatorDelete
static std::set< std::string > gRootSOs
static bool template_compare(std::string n1, std::string n2)
static TClassRef & type_from_handle(Cppyy::TCppScope_t scope)
static bool copy_args(Parameter *args, size_t nargs, void **vargs)
static TInterpreter::CallFuncIFacePtr_t GetCallFunc(Cppyy::TCppMethod_t method)
CPyCppyy::Parameter Parameter
static bool is_missclassified_stl(const std::string &name)
std::map< std::string, ClassRefs_t::size_type > Name2ClassRefIndex_t
static const ClassRefs_t::size_type STD_HANDLE
static std::set< std::string > gSmartPtrTypes
static GlobalVars_t g_globalvars
static char * cppstring_to_cstring(const std::string &cppstr)
static void release_args(Parameter *args, size_t nargs)
static std::set< std::string > g_builtins
static std::vector< CallWrapper * > gWrapperHolder
static bool gEnableFastPath
static ClassRefs_t g_classrefs(1)
static bool WrapperCall(Cppyy::TCppMethod_t method, size_t nargs, void *args_, void *self, void *result)
static std::map< std::string, std::string > resolved_enum_types
static Cppyy::TCppIndex_t gb2idx(TGlobal *gb)
static size_t CALL_NARGS(size_t nargs)
static CallWrapper * new_CallWrapper(TFunction *f)
static std::set< std::string > gSTLNames
static const ClassRefs_t::size_type GLOBAL_HANDLE
static GlobalVarsIndices_t g_globalidx
static bool testMethodExtraProperty(Cppyy::TCppMethod_t method, EFunctionProperty prop)
static int count_scopes(const std::string &tpname)
std::vector< TGlobal * > GlobalVars_t
std::map< TGlobal *, GlobalVars_t::size_type > GlobalVarsIndices_t
std::vector< TClassRef > ClassRefs_t
static std::map< TDictionary::DeclId_t, CallWrapper * > gMethodTemplates
static bool match_name(const std::string &tname, const std::string fname)
static TFunction * m2f(Cppyy::TCppMethod_t method)
#define CPPYY_IMP_CALL(typecode, rtype)
static std::set< std::string > gInitialNames
static T CallT(Cppyy::TCppMethod_t method, Cppyy::TCppObject_t self, size_t nargs, void *args)
Cppyy::TCppIndex_t GetLongestInheritancePath(TClass *klass)
Retrieve number of base classes in the longest branch of the inheritance tree of the input class.
RPY_EXPORTED TCppIndex_t GetNumTemplatedMethods(TCppScope_t scope, bool accept_namespace=false)
RPY_EXPORTED std::string GetMethodMangledName(TCppMethod_t)
RPY_EXPORTED TCppObject_t CallO(TCppMethod_t method, TCppObject_t self, size_t nargs, void *args, TCppType_t result_type)
RPY_EXPORTED TCppIndex_t CompareMethodArgType(TCppMethod_t, TCppIndex_t iarg, const std::string &req_type)
RPY_EXPORTED ptrdiff_t GetBaseOffset(TCppType_t derived, TCppType_t base, TCppObject_t address, int direction, bool rerror=false)
RPY_EXPORTED void DeallocateFunctionArgs(void *args)
RPY_EXPORTED bool IsEnumData(TCppScope_t scope, TCppIndex_t idata)
RPY_EXPORTED bool IsAbstract(TCppType_t type)
RPY_EXPORTED size_t SizeOf(TCppType_t klass)
RPY_EXPORTED TCppObject_t CallConstructor(TCppMethod_t method, TCppType_t type, size_t nargs, void *args)
RPY_EXPORTED void * AllocateFunctionArgs(size_t nargs)
RPY_EXPORTED bool IsDefaultConstructable(TCppType_t type)
RPY_EXPORTED bool IsTemplate(const std::string &template_name)
RPY_EXPORTED TCppIndex_t GetDatamemberIndexEnumerated(TCppScope_t scope, TCppIndex_t idata)
RPY_EXPORTED TCppIndex_t GetMethodReqArgs(TCppMethod_t)
RPY_EXPORTED bool IsEnum(const std::string &type_name)
RPY_EXPORTED std::vector< TCppIndex_t > GetMethodIndicesFromName(TCppScope_t scope, const std::string &name)
RPY_EXPORTED bool ExistsMethodTemplate(TCppScope_t scope, const std::string &name)
RPY_EXPORTED TCppIndex_t GetNumDatamembers(TCppScope_t scope, bool accept_namespace=false)
RPY_EXPORTED std::string ToString(TCppType_t klass, TCppObject_t obj)
RPY_EXPORTED std::string GetMethodName(TCppMethod_t)
RPY_EXPORTED bool IsConstData(TCppScope_t scope, TCppIndex_t idata)
RPY_EXPORTED void AddSmartPtrType(const std::string &)
RPY_EXPORTED bool Compile(const std::string &code, bool silent=false)
RPY_EXPORTED void CallDestructor(TCppType_t type, TCppObject_t self)
RPY_EXPORTED TCppScope_t gGlobalScope
RPY_EXPORTED bool IsProtectedData(TCppScope_t scope, TCppIndex_t idata)
RPY_EXPORTED std::string GetMethodSignature(TCppMethod_t, bool show_formalargs, TCppIndex_t maxargs=(TCppIndex_t) -1)
RPY_EXPORTED int GetDimensionSize(TCppScope_t scope, TCppIndex_t idata, int dimension)
RPY_EXPORTED bool IsSubtype(TCppType_t derived, TCppType_t base)
RPY_EXPORTED TCppMethod_t GetMethodTemplate(TCppScope_t scope, const std::string &name, const std::string &proto)
RPY_EXPORTED bool IsConstructor(TCppMethod_t method)
RPY_EXPORTED TCppIndex_t GetNumMethods(TCppScope_t scope, bool accept_namespace=false)
RPY_EXPORTED TCppObject_t Construct(TCppType_t type, void *arena=nullptr)
RPY_EXPORTED bool GetSmartPtrInfo(const std::string &, TCppType_t *raw, TCppMethod_t *deref)
RPY_EXPORTED std::string GetMethodArgName(TCppMethod_t, TCppIndex_t iarg)
RPY_EXPORTED size_t GetFunctionArgTypeoffset()
RPY_EXPORTED TCppObject_t Allocate(TCppType_t type)
RPY_EXPORTED void Destruct(TCppType_t type, TCppObject_t instance)
RPY_EXPORTED std::string ResolveName(const std::string &cppitem_name)
RPY_EXPORTED void AddTypeReducer(const std::string &reducable, const std::string &reduced)
RPY_EXPORTED std::string ResolveEnum(const std::string &enum_type)
RPY_EXPORTED long long GetEnumDataValue(TCppEnum_t, TCppIndex_t idata)
RPY_EXPORTED bool IsAggregate(TCppType_t type)
RPY_EXPORTED TCppIndex_t GetMethodNumArgs(TCppMethod_t)
RPY_EXPORTED TCppType_t GetActualClass(TCppType_t klass, TCppObject_t obj)
RPY_EXPORTED std::string GetBaseName(TCppType_t type, TCppIndex_t ibase)
RPY_EXPORTED bool IsNamespace(TCppScope_t scope)
RPY_EXPORTED std::string GetScopedFinalName(TCppType_t type)
RPY_EXPORTED void Deallocate(TCppType_t type, TCppObject_t instance)
RPY_EXPORTED bool IsPublicData(TCppScope_t scope, TCppIndex_t idata)
RPY_EXPORTED std::string GetMethodArgType(TCppMethod_t, TCppIndex_t iarg)
RPY_EXPORTED std::string GetEnumDataName(TCppEnum_t, TCppIndex_t idata)
RPY_EXPORTED void GetAllCppNames(TCppScope_t scope, std::set< std::string > &cppnames)
RPY_EXPORTED bool IsComplete(const std::string &type_name)
RPY_EXPORTED bool IsBuiltin(const std::string &type_name)
RPY_EXPORTED bool IsStaticMethod(TCppMethod_t method)
RPY_EXPORTED TCppIndex_t GetDatamemberIndex(TCppScope_t scope, const std::string &name)
RPY_EXPORTED void CallV(TCppMethod_t method, TCppObject_t self, size_t nargs, void *args)
RPY_EXPORTED bool IsStaticData(TCppScope_t scope, TCppIndex_t idata)
RPY_EXPORTED std::string GetDatamemberType(TCppScope_t scope, TCppIndex_t idata)
RPY_EXPORTED TCppMethod_t GetMethod(TCppScope_t scope, TCppIndex_t imeth)
RPY_EXPORTED bool IsStaticTemplate(TCppScope_t scope, const std::string &name)
RPY_EXPORTED bool IsDestructor(TCppMethod_t method)
RPY_EXPORTED bool IsSmartPtr(TCppType_t type)
RPY_EXPORTED std::string GetTemplatedMethodName(TCppScope_t scope, TCppIndex_t imeth)
RPY_EXPORTED size_t GetFunctionArgSizeof()
RPY_EXPORTED TCppScope_t GetScope(const std::string &scope_name)
RPY_EXPORTED bool HasVirtualDestructor(TCppType_t type)
RPY_EXPORTED bool IsConstMethod(TCppMethod_t)
RPY_EXPORTED bool HasComplexHierarchy(TCppType_t type)
RPY_EXPORTED std::vector< TCppScope_t > GetUsingNamespaces(TCppScope_t)
RPY_EXPORTED bool IsTemplatedConstructor(TCppScope_t scope, TCppIndex_t imeth)
RPY_EXPORTED TCppIndex_t GetGlobalOperator(TCppType_t scope, const std::string &lc, const std::string &rc, const std::string &op)
RPY_EXPORTED TCppFuncAddr_t GetFunctionAddress(TCppMethod_t method, bool check_enabled=true)
RPY_EXPORTED TCppIndex_t GetNumEnumData(TCppEnum_t)
RPY_EXPORTED TCppIndex_t GetNumBases(TCppType_t type)
RPY_EXPORTED TCppIndex_t GetNumBasesLongestBranch(TCppType_t type)
RPY_EXPORTED std::string GetMethodPrototype(TCppScope_t scope, TCppMethod_t, bool show_formalargs)
RPY_EXPORTED std::string GetMethodResultType(TCppMethod_t)
RPY_EXPORTED std::string GetFinalName(TCppType_t type)
RPY_EXPORTED char * CallS(TCppMethod_t method, TCppObject_t self, size_t nargs, void *args, size_t *length)
RPY_EXPORTED bool IsExplicit(TCppMethod_t method)
RPY_EXPORTED std::string GetMethodArgDefault(TCppMethod_t, TCppIndex_t iarg)
RPY_EXPORTED bool IsMethodTemplate(TCppScope_t scope, TCppIndex_t imeth)
RPY_EXPORTED std::string GetDatamemberName(TCppScope_t scope, TCppIndex_t idata)
RPY_EXPORTED bool IsPublicMethod(TCppMethod_t method)
RPY_EXPORTED intptr_t GetDatamemberOffset(TCppScope_t scope, TCppIndex_t idata)
RPY_EXPORTED std::string GetMethodFullName(TCppMethod_t)
RPY_EXPORTED bool IsProtectedMethod(TCppMethod_t method)
RPY_EXPORTED TCppEnum_t GetEnum(TCppScope_t scope, const std::string &enum_name)
void(* DelFunc_t)(void *)
std::string ResolveTypedef(const char *tname, bool resolveAll=false)
std::string CleanType(const char *typeDesc, int mode=0, const char **tail=nullptr)
Cleanup type description, redundant blanks removed and redundant tail ignored return *tail = pointer ...
std::string ShortType(const char *typeDesc, int mode)
Return the absolute type of typeDesc.
char * DemangleName(const char *mangled_name, int &errorCode)
union CPyCppyy::Parameter::Value fValue