Logo ROOT   6.16/01
Reference Guide
Executors.h
Go to the documentation of this file.
1// @(#)root/pyroot:$Id$
2// Author: Wim Lavrijsen, Jan 2005
3#ifndef PYROOT_EXECUTORS_H
4#define PYROOT_EXECUTORS_H
5
6// Bindings
7#include "TCallContext.h"
8
9// Standard
10#include <string>
11#include <map>
12
13
14namespace PyROOT {
15
16 class TExecutor {
17 public:
18 virtual ~TExecutor() {}
19 virtual PyObject* Execute(
21 };
22
23#define PYROOT_DECLARE_BASIC_EXECUTOR( name ) \
24 class T##name##Executor : public TExecutor { \
25 public: \
26 virtual PyObject* Execute( \
27 Cppyy::TCppMethod_t, Cppyy::TCppObject_t, TCallContext* ); \
28 }
29
30// executors for built-ins
48
49// pointer/array executors
62
63// special cases
66
68 public:
70 virtual PyObject* Execute(
72
73 protected:
75 };
76
78 public:
80 virtual PyObject* Execute(
82 };
83
84 class TRefExecutor : public TExecutor {
85 public:
87
88 public:
89 virtual Bool_t SetAssignable( PyObject* );
90
91 protected:
93 };
94
97
98#define PYROOT_DECLARE_BASIC_REFEXECUTOR( name ) \
99 class T##name##RefExecutor : public TRefExecutor { \
100 public: \
101 virtual PyObject* Execute( \
102 Cppyy::TCppMethod_t, Cppyy::TCppObject_t, TCallContext* ); \
103 }
104
120
121// special cases
123 public:
125 virtual PyObject* Execute(
127
128 protected:
130 };
131
133 public:
135 virtual PyObject* Execute(
137 };
138
140 public:
142 virtual PyObject* Execute(
144 };
145
147 public:
149 : TCppObjectExecutor ( klass ), fArraySize( array_size ) {}
150 virtual PyObject* Execute(
152
153 protected:
155 };
156
157// smart pointer executors
159 public:
161 Cppyy::TCppMethod_t deref ) : fClass( klass ), fRawPtrType( rawPtrType ), fDereferencer( deref ) {}
162
163 virtual PyObject* Execute(
165
166 protected:
170 };
171
173 public:
175
176 virtual PyObject* Execute(
178 };
179
181 public:
183 Cppyy::TCppMethod_t deref ) : fClass( klass ), fRawPtrType( rawPtrType ), fDereferencer( deref ) {}
184
185 virtual PyObject* Execute(
187
188 protected:
192 };
193
194// create executor from fully qualified type
195 TExecutor* CreateExecutor( const std::string& fullType,
196 Bool_t manage_smart_ptr = kTRUE );
197
198} // namespace PyROOT
199
200#endif // !PYROOT_EXECUTORS_H
int Py_ssize_t
Definition: PyROOT.h:166
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
_object PyObject
Definition: TPyArg.h:20
TCppObjectArrayExecutor(Cppyy::TCppType_t klass, Py_ssize_t array_size)
Definition: Executors.h:148
virtual PyObject * Execute(Cppyy::TCppMethod_t, Cppyy::TCppObject_t, TCallContext *)
execute <method> with argument <self, ctxt>, construct TTupleOfInstances from return value
Definition: Executors.cxx:610
virtual PyObject * Execute(Cppyy::TCppMethod_t, Cppyy::TCppObject_t, TCallContext *)
smart pointer excutor
Definition: Executors.cxx:507
Cppyy::TCppMethod_t fDereferencer
Definition: Executors.h:169
TCppObjectBySmartPtrExecutor(Cppyy::TCppType_t klass, Cppyy::TCppType_t rawPtrType, Cppyy::TCppMethod_t deref)
Definition: Executors.h:160
virtual PyObject * Execute(Cppyy::TCppMethod_t, Cppyy::TCppObject_t, TCallContext *)
smart pointer excutor
Definition: Executors.cxx:530
TCppObjectBySmartPtrRefExecutor(Cppyy::TCppType_t klass, Cppyy::TCppType_t rawPtrType, Cppyy::TCppMethod_t deref)
Definition: Executors.h:182
virtual PyObject * Execute(Cppyy::TCppMethod_t, Cppyy::TCppObject_t, TCallContext *)
Definition: Executors.cxx:547
virtual PyObject * Execute(Cppyy::TCppMethod_t, Cppyy::TCppObject_t, TCallContext *)
execution will bring a temporary in existence
Definition: Executors.cxx:420
TCppObjectExecutor(Cppyy::TCppType_t klass)
Definition: Executors.h:69
virtual PyObject * Execute(Cppyy::TCppMethod_t, Cppyy::TCppObject_t, TCallContext *)
execute <method> with argument <self, ctxt>, construct python proxy object return value
Definition: Executors.cxx:411
Cppyy::TCppType_t fClass
Definition: Executors.h:74
virtual PyObject * Execute(Cppyy::TCppMethod_t, Cppyy::TCppObject_t, TCallContext *)
execute <method> with argument <self, ctxt>, construct python ROOT object return ptr value
Definition: Executors.cxx:488
virtual PyObject * Execute(Cppyy::TCppMethod_t, Cppyy::TCppObject_t, TCallContext *)
execute <method> with argument <self, ctxt>, construct python ROOT object (ignoring ref) return ptr v...
Definition: Executors.cxx:497
virtual PyObject * Execute(Cppyy::TCppMethod_t, Cppyy::TCppObject_t, TCallContext *)
executor binds the result to the left-hand side, overwriting if an old object
Definition: Executors.cxx:445
Cppyy::TCppType_t fClass
Definition: Executors.h:129
TCppObjectRefExecutor(Cppyy::TCppType_t klass)
Definition: Executors.h:124
virtual ~TExecutor()
Definition: Executors.h:18
virtual PyObject * Execute(Cppyy::TCppMethod_t, Cppyy::TCppObject_t, TCallContext *)=0
virtual Bool_t SetAssignable(PyObject *)
prepare "buffer" for by-ref returns, used with setitem
Definition: Executors.cxx:247
PyObject * fAssignable
Definition: Executors.h:92
Global variables class (global variables are obtained from CINT).
Definition: TGlobal.h:28
TCppScope_t TCppType_t
Definition: Cppyy.h:16
ptrdiff_t TCppMethod_t
Definition: Cppyy.h:18
void * TCppObject_t
Definition: Cppyy.h:17
PYROOT_DECLARE_BASIC_EXECUTOR(Bool)
TExecutor * CreateExecutor(const std::string &fullType, Bool_t manage_smart_ptr=kTRUE)
Definition: Executors.cxx:637
PYROOT_DECLARE_BASIC_REFEXECUTOR(Bool)
const char * Long
const char * ULong
const char * Float
const char * Double
const char * UChar
const char * Short
const char * Int
const char * UInt
const char * UShort
const char * Bool
const char * Char