39 GILControl() : fSave(PyEval_SaveThread()) {}
40 ~GILControl() { PyEval_RestoreThread(fSave); }
50#define CPPJIT_IMPL_GILCALL(rtype, tcode) \
51 static inline rtype GILCall##tcode(interop::TCppMethod_t method, \
52 interop::TCppObject_t self, \
53 cpyrt::CallContext* ctxt) { \
54 if (!ReleasesGIL(ctxt)) \
55 return interop::Call##tcode(method, self, ctxt->GetEncodedSize(), \
58 return interop::Call##tcode(method, self, ctxt->GetEncodedSize(), \
62#define CPPJIT_IMPL_GILCALL(rtype, tcode) \
63 static inline rtype GILCall##tcode(interop::TCppMethod_t method, \
64 interop::TCppObject_t self, \
65 cpyrt::CallContext* ctxt) { \
66 return interop::Call##tcode(method, self, ctxt->GetEncodedSize(), \
85static inline interop::TCppObject_t
GILCallO(interop::TCppMethod_t method,
86 interop::TCppObject_t self,
88 interop::TCppScope_t klass) {
93 return interop::CallO(method, self, ctxt->GetEncodedSize(), ctxt->GetArgs(),
97 return interop::CallO(method, self, ctxt->GetEncodedSize(), ctxt->GetArgs(),
119 if (cl < -256 || cl > 255) {
120 PyErr_SetString(PyExc_ValueError,
"char conversion out of range");
125 return PyUnicode_FromFormat(
"%c", 256 - std::abs(
c));
126 return PyUnicode_FromFormat(
"%c",
c);
132 PyErr_SetString(PyExc_ValueError,
"char conversion out of range");
136 return PyUnicode_FromFormat(
"%c",
c);
154 bool retval =
GILCallB(method, self, ctxt);
209 return PyLong_FromLong(*((int8_t*)
GILCallR(method, self, ctxt)));
216 return PyLong_FromLong(*((uint8_t*)
GILCallR(method, self, ctxt)));
225 wchar_t res = (wchar_t)
GILCallL(method, self, ctxt);
226 return PyUnicode_FromWideChar(&res, 1);
235 char16_t res = (char16_t)
GILCallL(method, self, ctxt);
236 return PyUnicode_DecodeUTF16((
const char*)&res,
sizeof(
char16_t),
nullptr,
246 char32_t res = (char32_t)
GILCallL(method, self, ctxt);
247 return PyUnicode_DecodeUTF32((
const char*)&res,
sizeof(
char32_t),
nullptr,
257 return PyLong_FromLong((
int)
GILCallI(method, self, ctxt));
266 return PyLong_FromLong((int8_t)
GILCallC(method, self, ctxt));
275 return PyLong_FromLong((uint8_t)
GILCallB(method, self, ctxt));
284 return PyLong_FromLong((
short)
GILCallH(method, self, ctxt));
293 return PyLong_FromLong((
long)
GILCallL(method, self, ctxt));
302 return PyLong_FromUnsignedLong((
unsigned long)
GILCallLL(method, self, ctxt));
312 return PyLong_FromLongLong(
result);
322 return PyLong_FromUnsignedLongLong(
result);
331 return PyFloat_FromDouble((
double)
GILCallF(method, self, ctxt));
340 return PyFloat_FromDouble((
double)
GILCallD(method, self, ctxt));
349 return PyFloat_FromDouble((
double)
GILCallLD(method, self, ctxt));
357 fAssignable = pyobject;
361 fAssignable =
nullptr;
366#define CPPJIT_IMPL_REFEXEC(name, type, stype, F1, F2) \
367 PyObject* cpyrt::name##RefExecutor::Execute(interop::TCppMethod_t method, \
368 interop::TCppObject_t self, \
369 CallContext* ctxt) { \
370 type* ref = (type*)GILCallR(method, self, ctxt); \
372 PyErr_SetString(PyExc_ReferenceError, \
373 "attempt to access a null-pointer"); \
377 return F1((stype) * ref); \
379 *ref = (type)F2(fAssignable); \
380 Py_DECREF(fAssignable); \
381 fAssignable = nullptr; \
382 if (*ref == (type) - 1 && PyErr_Occurred()) \
384 Py_INCREF(Py_None); \
410 return PyComplex_FromDoubles(
c.real(),
c.imag());
415 Py_complex cplx = PyComplex_AsCComplex(pycplx);
416 return std::complex<T>(cplx.real, cplx.imag);
420 PyComplex_FromComplex<double>, PyComplex_AsComplex<double>)
430 return PyUnicode_FromStringAndSize(
result->c_str(),
result->size());
433 if (!PyUnicode_Check(fAssignable)) {
434 PyErr_Format(PyExc_TypeError,
"wrong type in assignment (string expected)");
438 *
result = std::string(PyUnicode_AsUTF8(fAssignable),
439 PyUnicode_GET_LENGTH(fAssignable));
441 Py_DECREF(fAssignable);
442 fAssignable =
nullptr;
453 if (PyErr_Occurred())
470 return PyUnicode_FromString(
result);
485 return PyUnicode_FromString(*
result);
497 return PyUnicode_FromWideChar(&
w, 0);
512 return PyUnicode_DecodeUTF16((
const char*)&
w, 0,
nullptr,
nullptr);
515 return PyUnicode_DecodeUTF16((
const char*)
result,
516 std::char_traits<char16_t>::length(
result) *
530 return PyUnicode_DecodeUTF32((
const char*)&
w, 0,
nullptr,
nullptr);
533 return PyUnicode_DecodeUTF32((
const char*)
result,
534 std::char_traits<char32_t>::length(
result) *
554#define CPPJIT_IMPL_ARRAY_EXEC(name, type, suffix) \
555 PyObject* cpyrt::name##ArrayExecutor::Execute(interop::TCppMethod_t method, \
556 interop::TCppObject_t self, \
557 CallContext* ctxt) { \
558 return CreateLowLevelView##suffix((type*)GILCallR(method, self, ctxt), \
587#define CPPJIT_COMPLEX_EXEC(code, type) \
588 PyObject* cpyrt::Complex##code##Executor::Execute( \
589 interop::TCppMethod_t method, interop::TCppObject_t self, \
590 CallContext* ctxt) { \
591 static interop::TCppScope_t scopeid = \
592 interop::GetScope("std::complex<" #type ">"); \
593 std::complex<type>* result = \
594 (std::complex<type>*)GILCallO(method, self, ctxt, scopeid).data; \
596 PyErr_SetString(PyExc_ValueError, \
597 "NULL result where temporary expected"); \
601 PyObject* pyres = PyComplex_FromDoubles(result->real(), result->imag()); \
602 ::operator delete(result); \
619 (std::string*)
GILCallO(method, self, ctxt, sSTLStringScope).data;
624 if (PyErr_Occurred()) {
630 PyUnicode_FromStringAndSize(
result->c_str(),
result->size());
646 (std::wstring*)
GILCallO(method, self, ctxt, sSTLWStringScope).data;
649 return PyUnicode_FromWideChar(&
w, 0);
682 if (!PyErr_Occurred())
683 PyErr_Format(PyExc_ValueError,
684 "cannot allocate the temporary returned by '%s': the size "
685 "of its return type is unknown",
702 : InstanceExecutor(klass) {
714 if (!
result || !fAssignable)
722 if (descr && PyUnicode_CheckExact(descr)) {
723 PyErr_Format(PyExc_TypeError,
"cannot assign to return object (%s)",
724 PyUnicode_AsUTF8(descr));
726 PyErr_SetString(PyExc_TypeError,
"cannot assign to result");
730 Py_DECREF(fAssignable);
731 fAssignable =
nullptr;
736 PyObject_CallFunction(assign,
const_cast<char*
>(
"O"), fAssignable);
740 Py_DECREF(fAssignable);
741 fAssignable =
nullptr;
754 PyObject* pystr = PyObject_Str(pyobj);
756 PyErr_Format(PyExc_TypeError,
"C++ object expected, got %s",
757 PyUnicode_AsUTF8(pystr));
760 PyErr_SetString(PyExc_TypeError,
"C++ object expected");
780 Py_DECREF(fAssignable);
781 fAssignable =
nullptr;
802 Py_DECREF(fAssignable);
803 fAssignable =
nullptr;
848 void* address = (
void*)
GILCallR(method, self, ctxt);
872 if (fullType.empty())
878 return (
h->second)(dims);
883 const std::string resolvedType =
887 if (resolvedType != fullType) {
890 return (
h->second)(dims);
895 bool isConst = strncmp(resolvedType.c_str(),
"const", 5) == 0;
902 return (
h->second)(dims);
910 return (
h->second)(dims);
914 if (!cpd.empty() && (std::string::size_type)std::count(cpd.begin(), cpd.end(),
915 '*') == cpd.size()) {
918 return (
h->second)((!dims || dims.
ndim() < (
dim_t)cpd.size())
927 return (
h->second)(dims);
936 return new IteratorExecutor(klass);
940 result =
new InstanceExecutor(klass);
942 result =
new InstanceRefExecutor(klass);
943 else if (cpd ==
"**" || cpd ==
"*[]" || cpd ==
"&*")
944 result =
new InstancePtrPtrExecutor(klass);
945 else if (cpd ==
"*&")
946 result =
new InstancePtrRefExecutor(klass);
947 else if (cpd ==
"[]") {
950 result =
new InstanceArrayExecutor(klass, asize);
952 result =
new InstancePtrRefExecutor(klass);
954 result =
new InstancePtrExecutor(klass);
955 }
else if (std::string fnRet, fnSig;
958 result =
new FunctionPointerExecutor(fnRet, fnSig);
986 if (fullType.size() >= 2 &&
987 fullType.compare(fullType.size() - 2, 2,
" &") == 0)
988 fullType = fullType.substr(0, fullType.size() - 2) +
"&";
992 return (
h->second)(dims);
1007 resolvedTypeStr.erase(
1008 std::remove(resolvedTypeStr.begin(), resolvedTypeStr.end(),
' '),
1009 resolvedTypeStr.end());
1010 if (resolvedTypeStr.rfind(
"(void)") != std::string::npos)
1012 resolvedTypeStr.substr(0, resolvedTypeStr.size() - 6) +
"()";
1016 if (resolvedTypeStr != fullType) {
1019 return (
h->second)(dims);
1024 bool isConst = strncmp(resolvedTypeStr.c_str(),
"const", 5) == 0;
1032 const std::string compounded = cpd.empty() ? realTypeStr : realTypeStr + cpd;
1037 return (
h->second)(dims);
1045 return (
h->second)(dims);
1049 if (!cpd.empty() && (std::string::size_type)std::count(cpd.begin(), cpd.end(),
1050 '*') == cpd.size()) {
1053 return (
h->second)((!dims || dims.
ndim() < (
dim_t)cpd.size())
1062 return (
h->second)(dims);
1069 if (resolvedTypeStr.find(
"iterator") != std::string::npos ||
1072 return new IteratorExecutor(klass);
1076 result =
new InstanceExecutor(klass);
1077 else if (cpd ==
"&")
1078 result =
new InstanceRefExecutor(klass);
1079 else if (cpd ==
"**" || cpd ==
"*[]" || cpd ==
"&*")
1080 result =
new InstancePtrPtrExecutor(klass);
1081 else if (cpd ==
"*&")
1082 result =
new InstancePtrRefExecutor(klass);
1083 else if (cpd ==
"[]") {
1086 result =
new InstanceArrayExecutor(klass, asize);
1088 result =
new InstancePtrRefExecutor(klass);
1090 result =
new InstancePtrExecutor(klass);
1091 }
else if (std::string fnRet, fnSig;
1096 result =
new FunctionPointerExecutor(fnRet, fnSig);
1114 if (
p &&
p->HasState())
1154#define WSTRING1 "std::basic_string<wchar_t>"
1156 "std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_" \
1162#define CCOMPLEX_D "_Complex double"
1163#define CCOMPLEX_F "_Complex float"
1165#define CCOMPLEX_D "_C_double_complex"
1166#define CCOMPLEX_F "_C_float_complex"
1169struct InitExecFactories_t {
1171 InitExecFactories_t() {
1177 static BoolExecutor
e{};
1180 gf[
"bool&"] = (
ef_t) + [](
cdims_t) {
return new BoolRefExecutor{}; };
1182 static BoolConstRefExecutor
e{};
1186 static CharExecutor
e{};
1189 gf[
"signed char"] = gf[
"char"];
1191 static UCharExecutor
e{};
1194 gf[
"char&"] = (
ef_t) + [](
cdims_t) {
return new CharRefExecutor{}; };
1195 gf[
"signed char&"] = gf[
"char&"];
1196 gf[
"unsigned char&"] =
1197 (
ef_t) + [](
cdims_t) {
return new UCharRefExecutor{}; };
1199 static CharConstRefExecutor
e{};
1202 gf[
"const signed char&"] = gf[
"const char&"];
1203 gf[
"const unsigned char&"] = (
ef_t) + [](
cdims_t) {
1204 static UCharConstRefExecutor
e{};
1208 static WCharExecutor
e{};
1212 static Char16Executor
e{};
1216 static Char32Executor
e{};
1220 static Int8Executor
e{};
1223 gf[
"int8_t&"] = (
ef_t) + [](
cdims_t) {
return new Int8RefExecutor{}; };
1225 static Int8ConstRefExecutor
e{};
1229 static UInt8Executor
e{};
1232 gf[
"uint8_t&"] = (
ef_t) + [](
cdims_t) {
return new UInt8RefExecutor{}; };
1234 static UInt8ConstRefExecutor
e{};
1238 static ShortExecutor
e{};
1241 gf[
"short&"] = (
ef_t) + [](
cdims_t) {
return new ShortRefExecutor{}; };
1243 static IntExecutor
e{};
1246 gf[
"int&"] = (
ef_t) + [](
cdims_t) {
return new IntRefExecutor{}; };
1247 gf[
"unsigned short"] = gf[
"int"];
1248 gf[
"unsigned short&"] =
1249 (
ef_t) + [](
cdims_t) {
return new UShortRefExecutor{}; };
1251 static ULongExecutor
e{};
1254 gf[
"unsigned long&"] =
1255 (
ef_t) + [](
cdims_t) {
return new ULongRefExecutor{}; };
1256 gf[
"unsigned int"] = gf[
"unsigned long"];
1257 gf[
"unsigned int&"] =
1258 (
ef_t) + [](
cdims_t) {
return new UIntRefExecutor{}; };
1260 static LongExecutor
e{};
1263 gf[
"long&"] = (
ef_t) + [](
cdims_t) {
return new LongRefExecutor{}; };
1265 static ULongExecutor
e{};
1268 gf[
"unsigned long&"] =
1269 (
ef_t) + [](
cdims_t) {
return new ULongRefExecutor{}; };
1271 static LongLongExecutor
e{};
1275 (
ef_t) + [](
cdims_t) {
return new LongLongRefExecutor{}; };
1277 static ULongLongExecutor
e{};
1280 gf[
"unsigned long long&"] =
1281 (
ef_t) + [](
cdims_t) {
return new ULongLongRefExecutor{}; };
1284 static FloatExecutor
e{};
1287 gf[
"float&"] = (
ef_t) + [](
cdims_t) {
return new FloatRefExecutor{}; };
1289 static DoubleExecutor
e{};
1292 gf[
"double&"] = (
ef_t) + [](
cdims_t) {
return new DoubleRefExecutor{}; };
1294 static LongDoubleExecutor
e{};
1297 gf[
"long double&"] =
1298 (
ef_t) + [](
cdims_t) {
return new LongDoubleRefExecutor{}; };
1299 gf[
"std::complex<double>"] = (
ef_t) + [](
cdims_t) {
1300 static ComplexDExecutor
e{};
1303 gf[
"std::complex<double>&"] =
1304 (
ef_t) + [](
cdims_t) {
return new ComplexDRefExecutor{}; };
1306 static VoidExecutor
e{};
1312 (
ef_t) + [](
cdims_t d) {
return new VoidArrayExecutor{
d}; };
1314 (
ef_t) + [](
cdims_t d) {
return new BoolArrayExecutor{
d}; };
1315 gf[
"unsigned char ptr"] =
1316 (
ef_t) + [](
cdims_t d) {
return new UCharArrayExecutor{
d}; };
1317 gf[
"const unsigned char ptr"] = gf[
"unsigned char ptr"];
1318 gf[
"std::byte ptr"] =
1319 (
ef_t) + [](
cdims_t d) {
return new ByteArrayExecutor{
d}; };
1320 gf[
"const std::byte ptr"] = gf[
"std::byte ptr"];
1322 (
ef_t) + [](
cdims_t d) {
return new Int8ArrayExecutor{
d}; };
1324 (
ef_t) + [](
cdims_t d) {
return new UInt8ArrayExecutor{
d}; };
1326 (
ef_t) + [](
cdims_t d) {
return new ShortArrayExecutor{
d}; };
1327 gf[
"unsigned short ptr"] =
1328 (
ef_t) + [](
cdims_t d) {
return new UShortArrayExecutor{
d}; };
1329 gf[
"int ptr"] = (
ef_t) + [](
cdims_t d) {
return new IntArrayExecutor{
d}; };
1330 gf[
"unsigned int ptr"] =
1331 (
ef_t) + [](
cdims_t d) {
return new UIntArrayExecutor{
d}; };
1333 (
ef_t) + [](
cdims_t d) {
return new LongArrayExecutor{
d}; };
1334 gf[
"unsigned long ptr"] =
1335 (
ef_t) + [](
cdims_t d) {
return new ULongArrayExecutor{
d}; };
1336 gf[
"long long ptr"] =
1337 (
ef_t) + [](
cdims_t d) {
return new LLongArrayExecutor{
d}; };
1338 gf[
"unsigned long long ptr"] =
1339 (
ef_t) + [](
cdims_t d) {
return new ULLongArrayExecutor{
d}; };
1341 (
ef_t) + [](
cdims_t d) {
return new FloatArrayExecutor{
d}; };
1343 (
ef_t) + [](
cdims_t d) {
return new DoubleArrayExecutor{
d}; };
1344 gf[
"long double ptr"] =
1345 (
ef_t) + [](
cdims_t d) {
return new LDoubleArrayExecutor{
d}; };
1346 gf[
"std::complex<float> ptr"] =
1347 (
ef_t) + [](
cdims_t d) {
return new ComplexFArrayExecutor{
d}; };
1348 gf[
"std::complex<double> ptr"] =
1349 (
ef_t) + [](
cdims_t d) {
return new ComplexDArrayExecutor{
d}; };
1350 gf[
"std::complex<int> ptr"] =
1351 (
ef_t) + [](
cdims_t d) {
return new ComplexIArrayExecutor{
d}; };
1352 gf[
"std::complex<long> ptr"] =
1353 (
ef_t) + [](
cdims_t d) {
return new ComplexLArrayExecutor{
d}; };
1356 gf[
"internal_enum_type_t"] = gf[
"int"];
1357 gf[
"internal_enum_type_t&"] = gf[
"int&"];
1358 gf[
"internal_enum_type_t ptr"] = gf[
"int ptr"];
1359 gf[
"std::byte"] = gf[
"uint8_t"];
1360 gf[
"std::byte&"] = gf[
"uint8_t&"];
1361 gf[
"const std::byte&"] = gf[
"const uint8_t&"];
1362 gf[
"const byte&"] = gf[
"const uint8_t&"];
1363 gf[
"std::int8_t"] = gf[
"int8_t"];
1364 gf[
"std::int8_t&"] = gf[
"int8_t&"];
1365 gf[
"const std::int8_t&"] = gf[
"const int8_t&"];
1366 gf[
"std::int8_t ptr"] = gf[
"int8_t ptr"];
1367 gf[
"std::uint8_t"] = gf[
"uint8_t"];
1368 gf[
"std::uint8_t&"] = gf[
"uint8_t&"];
1369 gf[
"const std::uint8_t&"] = gf[
"const uint8_t&"];
1370 gf[
"std::uint8_t ptr"] = gf[
"uint8_t ptr"];
1372 gf[
"__int64"] = gf[
"long long"];
1373 gf[
"__int64&"] = gf[
"long long&"];
1374 gf[
"__int64 ptr"] = gf[
"long long ptr"];
1375 gf[
"unsigned __int64"] = gf[
"unsigned long long"];
1376 gf[
"unsigned __int64&"] = gf[
"unsigned long long&"];
1377 gf[
"unsigned __int64 ptr"] = gf[
"unsigned long long ptr"];
1380 gf[
CCOMPLEX_D "&"] = gf[
"std::complex<double>&"];
1381 gf[
CCOMPLEX_F " ptr"] = gf[
"std::complex<float> ptr"];
1382 gf[
CCOMPLEX_D " ptr"] = gf[
"std::complex<double> ptr"];
1389 gf[
"Long64_t"] = gf[
"long long"];
1390 gf[
"Long64_t&"] = gf[
"long long&"];
1391 gf[
"Long64_t ptr"] = gf[
"long long ptr"];
1392 gf[
"ULong64_t"] = gf[
"unsigned long long"];
1393 gf[
"ULong64_t&"] = gf[
"unsigned long long&"];
1394 gf[
"ULong64_t ptr"] = gf[
"unsigned long long ptr"];
1398 static CStringExecutor
e{};
1401 gf[
"char*"] = gf[
"const char*"];
1403 static CStringRefExecutor
e{};
1406 gf[
"char*&"] = gf[
"const char*&"];
1407 gf[
"const signed char*"] = gf[
"const char*"];
1409 gf[
"signed char ptr"] =
1410 (
ef_t) + [](
cdims_t d) {
return new SCharArrayExecutor{
d}; };
1412 static WCStringExecutor
e{};
1416 static CString16Executor
e{};
1420 static CString32Executor
e{};
1423 gf[
"std::basic_string<char>"] = (
ef_t) + [](
cdims_t) {
1424 static STLStringExecutor
e{};
1427 gf[
"std::basic_string<char>&"] =
1428 (
ef_t) + [](
cdims_t) {
return new STLStringRefExecutor{}; };
1429 gf[
"std::basic_string<wchar_t>"] = (
ef_t) + [](
cdims_t) {
1430 static STLWStringExecutor
e{};
1433 gf[
WSTRING1] = gf[
"std::basic_string<wchar_t>"];
1434 gf[
WSTRING2] = gf[
"std::basic_string<wchar_t>"];
1436 static ConstructorExecutor
e{};
1440 static PyObjectExecutor
e{};
1443 gf[
"_object*"] = gf[
"PyObject*"];
1444 gf[
"FILE*"] = gf[
"void ptr"];
1446} initExecvFactories_;
interop::TCppScope_t fClass
static interop::TCppObject_t GILCallConstructor(interop::TCppMethod_t method, interop::TCppScope_t klass, cpyrt::CallContext *ctxt)
static float GILCallF(interop::TCppMethod_t method, interop::TCppObject_t self, cpyrt::CallContext *ctxt)
static PyObject * PyComplex_FromComplex(const std::complex< T > &c)
static PY_LONG_LONG GILCallLL(interop::TCppMethod_t method, interop::TCppObject_t self, cpyrt::CallContext *ctxt)
static PyObject * SetInstanceCheckError(PyObject *pyobj)
static std::complex< T > PyComplex_AsComplex(PyObject *pycplx)
static interop::TCppObject_t GILCallO(interop::TCppMethod_t method, interop::TCppObject_t self, cpyrt::CallContext *ctxt, interop::TCppScope_t klass)
static void GILCallV(interop::TCppMethod_t method, interop::TCppObject_t self, cpyrt::CallContext *ctxt)
static void * GILCallR(interop::TCppMethod_t method, interop::TCppObject_t self, cpyrt::CallContext *ctxt)
static short GILCallH(interop::TCppMethod_t method, interop::TCppObject_t self, cpyrt::CallContext *ctxt)
#define CPPJIT_IMPL_GILCALL(rtype, tcode)
#define CPPJIT_COMPLEX_EXEC(code, type)
static double GILCallD(interop::TCppMethod_t method, interop::TCppObject_t self, cpyrt::CallContext *ctxt)
static long GILCallL(interop::TCppMethod_t method, interop::TCppObject_t self, cpyrt::CallContext *ctxt)
#define CPPJIT_IMPL_ARRAY_EXEC(name, type, suffix)
static PY_LONG_DOUBLE GILCallLD(interop::TCppMethod_t method, interop::TCppObject_t self, cpyrt::CallContext *ctxt)
static PyObject * cpyrt_PyBool_FromLong(long b)
static int GILCallI(interop::TCppMethod_t method, interop::TCppObject_t self, cpyrt::CallContext *ctxt)
static unsigned char GILCallB(interop::TCppMethod_t method, interop::TCppObject_t self, cpyrt::CallContext *ctxt)
static PyObject * cpyrt_PyText_FromULong(unsigned long uc)
#define CPPJIT_IMPL_REFEXEC(name, type, stype, F1, F2)
static char GILCallC(interop::TCppMethod_t method, interop::TCppObject_t self, cpyrt::CallContext *ctxt)
static PyObject * cpyrt_PyText_FromLong(long cl)
winID h TVirtualViewer3D TVirtualGLPainter p
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 value
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 gc
virtual bool SetAssignable(PyObject *)
long double PY_LONG_DOUBLE
unsigned long long PY_ULONG_LONG
RooArgList L(Args_t &&... args)
std::string remove_const(const std::string &cppname)
std::string clean_type(const std::string &cppname, bool template_strip=true, bool const_strip=true)
Py_ssize_t array_size(const std::string &name)
std::string compound(const std::string &name)
bool IsSTLIterator(const std::string &classname)
PyObject * FuncPtr2StdFunction(const std::string &retType, const std::string &signature, void *address)
static ExecFactories_t gExecFactories
PyObject * gNullPtrObject
PyObject * CreatePointerView(void *ptr, cdims_t shape=0)
PyObject * BindCppObject(interop::TCppObject_t object, interop::TCppScope_t klass, const unsigned flags=0)
PyObject * BindCppObjectArray(interop::TCppObject_t address, interop::TCppScope_t klass, cdims_t dims)
CPYRT_EXTERN Executor * CreateExecutor(const std::string &name, cdims_t=0)
bool ReleasesGIL(CallContext *ctxt)
PyObject * BindCppObjectNoCast(interop::TCppObject_t object, interop::TCppScope_t klass, const unsigned flags=0)
CPYRT_EXPORT void DestroyExecutor(Executor *p)
unsigned long PyLongOrInt_AsULong(PyObject *pyobject)
std::set< std::string > gIteratorTypes
bool CPPInstance_Check(T *object)
CPYRT_EXTERN bool UnregisterExecutor(const std::string &name)
PY_ULONG_LONG PyLongOrInt_AsULong64(PyObject *pyobject)
std::unordered_map< std::string, ef_t > ExecFactories_t
Executor *(* ef_t)(cdims_t)
CPYRT_EXTERN void * CallVoidP(interop::TCppMethod_t, interop::TCppObject_t, CallContext *)
CPYRT_EXTERN bool RegisterExecutor(const std::string &name, ExecutorFactory_t)
TCppScope_t GetFullScope(const std::string &scope_name)
Cpp::ObjectRef TCppObject_t
TCppType_t GetTypeFromScope(TCppScope_t klass)
std::string GetTypeAsString(TCppType_t type)
TCppType_t ResolveEnumPointerType(TCppType_t type)
bool IsClassType(TCppType_t type)
bool GetFnTypeSigAsString(TCppType_t fn_type, std::string &ret_type, std::string &signature)
Spells out a function type, or a pointer or reference to one, as the return type and the parenthesize...
Cpp::FuncRef TCppMethod_t
bool IsFunctionPointerType(TCppType_t type)
TCppObject_t CallO(TCppMethod_t method, TCppObject_t self, size_t nargs, void *args, TCppType_t result_type)
TCppType_t ResolveType(TCppType_t cppitem_name)
std::string GetMethodSignature(TCppMethod_t, bool show_formal_args, TCppIndex_t max_args=(TCppIndex_t) -1)
TCppObject_t CallConstructor(TCppMethod_t method, TCppScope_t klass, size_t nargs, void *args)
TCppScope_t GetScopeFromType(TCppType_t type)
TCppType_t GetRealType(TCppType_t type)
TCppType_t GetType(const std::string &name, bool enable_slow_lookup=false)
TCppType_t ResolveEnumReferenceType(TCppType_t type)
Parameter * GetArgs(size_t sz)