Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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* GetDocString() { return GetPrototype(); }
25 PyErr_Format(PyExc_ValueError, "unsupported reflex request %d or format %d", request, format);
26 return nullptr;
27 };
28
29 virtual int GetPriority() = 0;
30 virtual bool IsGreedy() = 0;
31
32 virtual int GetMaxArgs() = 0;
33 virtual PyObject* GetCoVarNames() = 0;
34 virtual PyObject* GetArgDefault(int /* iarg */) = 0;
35 virtual bool IsConst() { return false; }
36
37 virtual PyObject* GetScopeProxy() = 0;
39
40 virtual PyCallable* Clone() = 0;
41
42 virtual int GetArgMatchScore(PyObject* /* args_tuple */) { return INT_MAX; }
43
44public:
45 virtual PyObject* Call(
46 CPPInstance*& self, PyObject* args, PyObject* kwds, CallContext* ctxt = nullptr) = 0;
47};
48
49} // namespace CPyCppyy
50
51#endif // !CPYCPPYY_PYCALLABLE_H
_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:35
virtual PyObject * GetScopeProxy()=0
virtual PyObject * GetCoVarNames()=0
virtual PyObject * Reflex(Cppyy::Reflex::RequestId_t request, Cppyy::Reflex::FormatId_t format=Cppyy::Reflex::OPTIMAL)
Definition PyCallable.h:23
virtual int GetArgMatchScore(PyObject *)
Definition PyCallable.h:42
virtual PyObject * GetDocString()
Definition PyCallable.h:22
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 * Call(CPPInstance *&self, PyObject *args, PyObject *kwds, CallContext *ctxt=nullptr)=0
virtual PyObject * GetArgDefault(int)=0
virtual Cppyy::TCppFuncAddr_t GetFunctionAddress()=0
Set of helper functions that are invoked from the pythonizors, on the Python side.
const FormatId_t OPTIMAL
Definition Reflex.h:21
void * TCppFuncAddr_t
Definition cpp_cppyy.h:25