22 const char*
name =
nullptr;
26 case '?':
name =
"bool";
break;
27 case 'c':
name =
"char";
break;
28 case 'b':
name =
"char";
break;
29 case 'B':
name =
"unsigned char";
break;
30 case 'h':
name =
"short";
break;
31 case 'H':
name =
"unsigned short";
break;
32 case 'i':
name =
"int";
break;
33 case 'I':
name =
"unsigned int";
break;
34 case 'l':
name =
"long";
break;
35 case 'L':
name =
"unsigned long";
break;
36 case 'q':
name =
"long long";
break;
37 case 'Q':
name =
"unsigned long long";
break;
38 case 'f':
name =
"float";
break;
39 case 'd':
name =
"double";
break;
40 case 'g':
name =
"long double";
break;
54 fTemplated(nullptr), fLowPriority(nullptr), fDoc(nullptr)
70 for (
const auto&
c :
p.second) {
81 for (
auto pc :
mp->fMethodInfo->fMethods) {
95 cppol->AdoptMethod(pc);
101 fTI->fTemplated->AdoptMethod(pc);
109 std::string
proto =
"";
111#if PY_VERSION_HEX >= 0x03080000
173#if PY_VERSION_HEX >= 0x03080000
212 if (
resname.find(
"initializer_list") != std::string::npos) {
213 auto pos =
proto.find(
"initializer_list");
214 while (pos != std::string::npos) {
215 proto.replace(pos, 16,
"vector");
216 pos =
proto.find(
"initializer_list", pos + 6);
326 pytmpl->fTemplateArgs =
nullptr;
327 pytmpl->fWeakrefList =
nullptr;
329 pytmpl->fTI = std::make_shared<TemplateInfo>();
376 pytmpl->fTI.~TP_TInfo_t();
400 if (
pytmpl->fTI->fNonTemplated->HasMethods())
402 if (
pytmpl->fTI->fTemplated->HasMethods()) {
411 if (
pytmpl->fTI->fLowPriority->HasMethods()) {
439#define TPPCALL_RETURN \
440{ if (!errors.empty()) \
441 std::for_each(errors.begin(), errors.end(), Utility::PyError_t::Clear);\
473 if (
pymeth->HasMethods()) {
523#if PY_VERSION_HEX >= 0x03080000
558#if PY_VERSION_HEX < 0x03080000
569 if (!
pytmpl->fTemplateArgs) {
571 auto&
v =
pytmpl->fTI->fDispatchMap[
""];
572 for (
const auto&
p :
v) {
594 std::vector<Utility::PyError_t>
errors;
598 if (
pytmpl->fTemplateArgs) {
692 pytmpl->fTI->fCppName.c_str());
719#if PY_VERSION_HEX >= 0x03080000
761 (
char*)
"unused",
nullptr},
762 {(
char*)
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
777 std::vector<PyCallable*> dummy;
782#if PY_VERSION_HEX >= 0x03080000
792 const char*
sigarg =
nullptr;
833 proto.push_back(
'<');
835 for (
int i = 0; i <
n; i++) {
843 proto.push_back(
',');
845 proto.push_back(
'>');
884 (
char*)
"select overload for dispatch" },
885 {(
char*)
nullptr,
nullptr, 0,
nullptr }
892 (
char*)
"cppyy.TemplateProxy",
923 (
char*)
"cppyy template proxy (internal)",
948#if PY_VERSION_HEX >= 0x02030000
951#if PY_VERSION_HEX >= 0x02060000
954#if PY_VERSION_HEX >= 0x03040000
957#if PY_VERSION_HEX >= 0x03080000
960#if PY_VERSION_HEX >= 0x030c0000
963#if PY_VERSION_HEX >= 0x030d0000
#define CPyCppyy_PyText_InternFromString
#define CPyCppyy_PyText_Append
#define CPyCppyy_PyText_AsString
static Py_ssize_t CPyCppyy_PyArgs_GET_SIZE(CPyCppyy_PyArgs_t args, size_t)
PyObject * CPyCppyy_PyArgs_t
#define CPyCppyy_PyText_AppendAndDel
PyObject * CPyCppyy_PyObject_Call(PyObject *cb, PyObject *args, size_t, PyObject *kwds)
#define CPyCppyy_PyText_FromFormat
PyObject * CPyCppyy_tp_call(PyObject *cb, PyObject *args, size_t, PyObject *kwds)
#define CPyCppyy_PyText_FromString
static PyObject * CPyCppyy_PyArgs_GET_ITEM(CPyCppyy_PyArgs_t args, Py_ssize_t i)
#define CPyCppyy_PyText_Check
#define PyVarObject_HEAD_INIT(type, size)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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
MethodInfo_t * fMethodInfo
virtual bool IsGreedy()=0
CPPOverload * fLowPriority
TP_DispatchMap_t fDispatchMap
CPPOverload * fNonTemplated
PyObject * Instantiate(const std::string &fname, CPyCppyy_PyArgs_t tmplArgs, size_t nargsf, Utility::ArgPreference, int *pcnt=nullptr)
void Set(const std::string &cppname, const std::string &pyname, PyObject *pyclass)
PyObject_HEAD PyObject * fSelf
void AdoptTemplate(PyCallable *pc)
void AdoptMethod(PyCallable *pc)
void MergeOverload(CPPOverload *mp)
std::string ConstructTemplateArgs(PyObject *pyname, PyObject *tpArgs, PyObject *args=nullptr, ArgPreference=kNone, int argoff=0, int *pcnt=nullptr)
size_t FetchError(std::vector< PyError_t > &, bool is_cpp=false)
void SetDetailedException(std::vector< PyError_t > &errors, PyObject *topmsg, PyObject *defexc)
CPPOverload * CPPOverload_New(const std::string &name, std::vector< PyCallable * > &methods)
static PyObject * tpp_richcompare(TemplateProxy *self, PyObject *other, int op)
bool AdjustSelf(PyCallArgs &cargs)
static PyObject * tpp_doc(TemplateProxy *pytmpl, void *)
static PyMappingMethods tpp_as_mapping
bool CPPOverload_Check(T *object)
static int tpp_clear(TemplateProxy *pytmpl)
static PyObject * tpp_call(TemplateProxy *pytmpl, PyObject *args, PyObject *kwds)
static PyObject * tpp_getuseffi(CPPOverload *, void *)
bool TemplateProxy_CheckExact(T *object)
static void tpp_dealloc(TemplateProxy *pytmpl)
uint64_t HashSignature(CPyCppyy_PyArgs_t args, size_t nargsf)
static int tpp_traverse(TemplateProxy *pytmpl, visitproc visit, void *arg)
static PyObject * tpp_overload(TemplateProxy *pytmpl, PyObject *args)
static int tpp_setuseffi(CPPOverload *, PyObject *, void *)
static PyGetSetDef tpp_getset[]
PyTypeObject CPPOverload_Type
PyTypeObject TemplateProxy_Type
static PyObject * tpp_subscript(TemplateProxy *pytmpl, PyObject *args)
static PyObject * CallMethodImp(TemplateProxy *pytmpl, PyObject *&pymeth, CPyCppyy_PyArgs_t args, size_t nargsf, PyObject *kwds, bool impOK, uint64_t sighash)
static void UpdateDispatchMap(TemplateProxy *pytmpl, bool use_targs, uint64_t sighash, CPPOverload *pymeth)
static TemplateProxy * tpp_new(PyTypeObject *, PyObject *, PyObject *)
static PyMethodDef tpp_methods[]
static int tpp_doc_set(TemplateProxy *pytmpl, PyObject *val, void *)
static Py_hash_t tpp_hash(TemplateProxy *self)
static PyObject * SelectAndForward(TemplateProxy *pytmpl, CPPOverload *pymeth, CPyCppyy_PyArgs_t args, size_t nargsf, PyObject *kwds, bool implicitOkay, bool use_targs, uint64_t sighash, std::vector< Utility::PyError_t > &errors)
static std::string targs2str(TemplateProxy *pytmpl)
static TemplateProxy * tpp_descr_get(TemplateProxy *pytmpl, PyObject *pyobj, PyObject *)
bool TemplateProxy_Check(T *object)
std::shared_ptr< TemplateInfo > TP_TInfo_t
static PyObject * TC2CppName(PyObject *pytc, const char *cpd, bool allow_voidp)
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 bool IsNamespace(TCppScope_t scope)
RPY_EXPORTED bool IsStaticMethod(TCppMethod_t method)
RPY_EXPORTED std::string GetMethodFullName(TCppMethod_t)