Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
PyCallable.h
Go to the documentation of this file.
1#ifndef CPYCPPYY_PYCALLABLE_H
2#define CPYCPPYY_PYCALLABLE_H
3
4#include <climits>
5
6// Bindings
7#include "CPyCppyy/Reflex.h"
8#include "CallContext.h"
9
10
11namespace CPyCppyy {
12
13class CPPInstance;
14
16public:
17 virtual ~PyCallable() {}
18
19public:
20 virtual PyObject* GetSignature(bool show_formalargs = true) = 0;
21 virtual PyObject* GetPrototype(bool show_formalargs = true) = 0;
22 virtual PyObject* GetTypeName() { return GetPrototype(false); }
23 virtual PyObject* GetDocString() { return GetPrototype(); }
26 PyErr_Format(PyExc_ValueError, "unsupported reflex request %d or format %d", request, format);
27 return nullptr;
28 };
29
30 virtual int GetPriority() = 0;
31 virtual bool IsGreedy() = 0;
32
33 virtual int GetMaxArgs() = 0;
34 virtual PyObject* GetCoVarNames() = 0;
35 virtual PyObject* GetArgDefault(int /* iarg */, bool silent=true) = 0;
36 virtual bool IsConst() { return false; }
37
38 virtual PyObject* GetScopeProxy() = 0;
40
41 virtual PyCallable* Clone() = 0;
42
43 virtual int GetArgMatchScore(PyObject* /* args_tuple */) { return INT_MAX; }
44
45public:
46 virtual PyObject* Call(CPPInstance*& self,
47 CPyCppyy_PyArgs_t args, size_t nargsf, PyObject* kwds, CallContext* ctxt = nullptr) = 0;
48};
49
50} // namespace CPyCppyy
51
52#endif // !CPYCPPYY_PYCALLABLE_H
PyObject * CPyCppyy_PyArgs_t
Definition CPyCppyy.h:330
_object PyObject
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 format
virtual bool IsConst()
Definition PyCallable.h:36
virtual PyObject * GetScopeProxy()=0
virtual PyObject * GetTypeName()
Definition PyCallable.h:22
virtual PyObject * GetCoVarNames()=0
virtual PyObject * Call(CPPInstance *&self, CPyCppyy_PyArgs_t args, size_t nargsf, PyObject *kwds, CallContext *ctxt=nullptr)=0
virtual PyObject * Reflex(Cppyy::Reflex::RequestId_t request, Cppyy::Reflex::FormatId_t format=Cppyy::Reflex::OPTIMAL)
Definition PyCallable.h:24
virtual int GetArgMatchScore(PyObject *)
Definition PyCallable.h:43
virtual PyObject * GetDocString()
Definition PyCallable.h:23
virtual ~PyCallable()
Definition PyCallable.h:17
virtual PyObject * GetPrototype(bool show_formalargs=true)=0
virtual PyCallable * Clone()=0
virtual PyObject * GetSignature(bool show_formalargs=true)=0
virtual int GetPriority()=0
virtual bool IsGreedy()=0
virtual int GetMaxArgs()=0
virtual PyObject * GetArgDefault(int, bool silent=true)=0
virtual Cppyy::TCppFuncAddr_t GetFunctionAddress()=0
const FormatId_t OPTIMAL
Definition Reflex.h:22
void * TCppFuncAddr_t
Definition cpp_cppyy.h:25