ROOT
v6-22
Reference Guide
DeclareExecutors.h
Go to the documentation of this file.
1
#ifndef CPYCPPYY_DECLAREEXECUTORS_H
2
#define CPYCPPYY_DECLAREEXECUTORS_H
3
4
// Bindings
5
#include "
Executors.h
"
6
#include "
CallContext.h
"
7
8
#if __cplusplus > 201402L
9
#include <cstddef>
10
#endif
11
12
13
namespace
CPyCppyy
{
14
15
namespace
{
16
17
#define CPPYY_DECL_EXEC(name) \
18
class name##Executor : public Executor { \
19
public: \
20
virtual PyObject* Execute( \
21
Cppyy::TCppMethod_t, Cppyy::TCppObject_t, CallContext*); \
22
}
23
24
// executors for built-ins
25
CPPYY_DECL_EXEC
(
Bool
);
26
CPPYY_DECL_EXEC
(BoolConstRef);
27
CPPYY_DECL_EXEC
(
Char
);
28
CPPYY_DECL_EXEC
(CharConstRef);
29
CPPYY_DECL_EXEC
(
UChar
);
30
CPPYY_DECL_EXEC
(UCharConstRef);
31
CPPYY_DECL_EXEC
(WChar);
32
CPPYY_DECL_EXEC
(Char16);
33
CPPYY_DECL_EXEC
(Char32);
34
CPPYY_DECL_EXEC
(Int8);
35
CPPYY_DECL_EXEC
(UInt8);
36
CPPYY_DECL_EXEC
(
Short
);
37
CPPYY_DECL_EXEC
(
Int
);
38
CPPYY_DECL_EXEC
(
Long
);
39
CPPYY_DECL_EXEC
(
ULong
);
40
CPPYY_DECL_EXEC
(LongLong);
41
CPPYY_DECL_EXEC
(ULongLong);
42
CPPYY_DECL_EXEC
(
Float
);
43
CPPYY_DECL_EXEC
(
Double
);
44
CPPYY_DECL_EXEC
(LongDouble);
45
CPPYY_DECL_EXEC
(Void);
46
CPPYY_DECL_EXEC
(CString);
47
CPPYY_DECL_EXEC
(WCString);
48
CPPYY_DECL_EXEC
(CString16);
49
CPPYY_DECL_EXEC
(CString32);
50
51
// pointer/array executors
52
CPPYY_DECL_EXEC
(VoidArray);
53
CPPYY_DECL_EXEC
(BoolArray);
54
CPPYY_DECL_EXEC
(UCharArray);
55
#if __cplusplus > 201402L
56
CPPYY_DECL_EXEC
(ByteArray);
57
#endif
58
CPPYY_DECL_EXEC
(ShortArray);
59
CPPYY_DECL_EXEC
(UShortArray);
60
CPPYY_DECL_EXEC
(IntArray);
61
CPPYY_DECL_EXEC
(UIntArray);
62
CPPYY_DECL_EXEC
(LongArray);
63
CPPYY_DECL_EXEC
(ULongArray);
64
CPPYY_DECL_EXEC
(LLongArray);
65
CPPYY_DECL_EXEC
(ULLongArray);
66
CPPYY_DECL_EXEC
(FloatArray);
67
CPPYY_DECL_EXEC
(DoubleArray);
68
CPPYY_DECL_EXEC
(ComplexFArray);
69
CPPYY_DECL_EXEC
(ComplexDArray);
70
CPPYY_DECL_EXEC
(ComplexIArray);
71
CPPYY_DECL_EXEC
(ComplexLArray);
72
73
// special cases
74
CPPYY_DECL_EXEC
(ComplexD);
75
CPPYY_DECL_EXEC
(STLString);
76
CPPYY_DECL_EXEC
(STLWString);
77
78
class
InstancePtrExecutor :
public
Executor {
79
public
:
80
InstancePtrExecutor(
Cppyy::TCppType_t
klass) :
fClass
(klass) {}
81
virtual
PyObject
* Execute(
82
Cppyy::TCppMethod_t
,
Cppyy::TCppObject_t
, CallContext*);
83
virtual
bool
HasState() {
return
true
; }
84
85
protected
:
86
Cppyy::TCppType_t
fClass
;
87
};
88
89
class
InstanceExecutor :
public
Executor {
90
public
:
91
InstanceExecutor(
Cppyy::TCppType_t
klass);
92
virtual
PyObject
* Execute(
93
Cppyy::TCppMethod_t
,
Cppyy::TCppObject_t
, CallContext*);
94
virtual
bool
HasState() {
return
true
; }
95
96
protected
:
97
Cppyy::TCppType_t
fClass
;
98
unsigned
int
fFlags
;
99
};
100
101
class
IteratorExecutor :
public
InstanceExecutor {
102
public
:
103
IteratorExecutor(
Cppyy::TCppType_t
klass);
104
};
105
106
CPPYY_DECL_EXEC
(Constructor);
107
CPPYY_DECL_EXEC
(
PyObject
);
108
109
#define CPPYY_DECL_REFEXEC(name) \
110
class name##RefExecutor : public RefExecutor { \
111
public: \
112
virtual PyObject* Execute( \
113
Cppyy::TCppMethod_t, Cppyy::TCppObject_t, CallContext*); \
114
}
115
116
CPPYY_DECL_REFEXEC
(
Bool
);
117
CPPYY_DECL_REFEXEC
(
Char
);
118
CPPYY_DECL_REFEXEC
(
UChar
);
119
CPPYY_DECL_REFEXEC
(Int8);
120
CPPYY_DECL_REFEXEC
(UInt8);
121
CPPYY_DECL_REFEXEC
(
Short
);
122
CPPYY_DECL_REFEXEC
(
UShort
);
123
CPPYY_DECL_REFEXEC
(
Int
);
124
CPPYY_DECL_REFEXEC
(
UInt
);
125
CPPYY_DECL_REFEXEC
(
Long
);
126
CPPYY_DECL_REFEXEC
(
ULong
);
127
CPPYY_DECL_REFEXEC
(LongLong);
128
CPPYY_DECL_REFEXEC
(ULongLong);
129
CPPYY_DECL_REFEXEC
(
Float
);
130
CPPYY_DECL_REFEXEC
(
Double
);
131
CPPYY_DECL_REFEXEC
(LongDouble);
132
CPPYY_DECL_REFEXEC
(ComplexD);
133
CPPYY_DECL_REFEXEC
(STLString);
134
135
// special cases
136
class
InstanceRefExecutor :
public
RefExecutor {
137
public
:
138
InstanceRefExecutor(
Cppyy::TCppType_t
klass) :
fClass
(klass) {}
139
virtual
PyObject
* Execute(
140
Cppyy::TCppMethod_t
,
Cppyy::TCppObject_t
, CallContext*);
141
142
protected
:
143
Cppyy::TCppType_t
fClass
;
144
};
145
146
class
InstancePtrPtrExecutor :
public
InstanceRefExecutor {
147
public
:
148
using
InstanceRefExecutor::InstanceRefExecutor;
149
virtual
PyObject
* Execute(
150
Cppyy::TCppMethod_t
,
Cppyy::TCppObject_t
, CallContext*);
151
};
152
153
class
InstancePtrRefExecutor :
public
InstanceRefExecutor {
154
public
:
155
using
InstanceRefExecutor::InstanceRefExecutor;
156
virtual
PyObject
* Execute(
157
Cppyy::TCppMethod_t
,
Cppyy::TCppObject_t
, CallContext*);
158
};
159
160
class
InstanceArrayExecutor :
public
InstancePtrExecutor {
161
public
:
162
InstanceArrayExecutor(
Cppyy::TCppType_t
klass,
Py_ssize_t
array_size)
163
: InstancePtrExecutor(klass),
fArraySize
(array_size) {}
164
virtual
PyObject
* Execute(
165
Cppyy::TCppMethod_t
,
Cppyy::TCppObject_t
, CallContext*);
166
167
protected
:
168
Py_ssize_t
fArraySize
;
169
};
170
171
}
// unnamed namespace
172
173
}
// namespace CPyCppyy
174
175
#endif
// !CPYCPPYY_DECLAREEXECUTORS_H
Py_ssize_t
int Py_ssize_t
Definition:
CPyCppyy.h:228
CallContext.h
fFlags
unsigned int fFlags
Definition:
DeclareExecutors.h:98
CPPYY_DECL_EXEC
#define CPPYY_DECL_EXEC(name)
Definition:
DeclareExecutors.h:17
fClass
Cppyy::TCppType_t fClass
Definition:
DeclareExecutors.h:86
CPPYY_DECL_REFEXEC
#define CPPYY_DECL_REFEXEC(name)
Definition:
DeclareExecutors.h:109
fArraySize
Py_ssize_t fArraySize
Definition:
DeclareExecutors.h:168
Executors.h
PyObject
_object PyObject
Definition:
PyMethodBase.h:41
CPyCppyy
Definition:
TPython.cxx:99
Cppyy::TCppMethod_t
intptr_t TCppMethod_t
Definition:
cpp_cppyy.h:22
Cppyy::TCppObject_t
void * TCppObject_t
Definition:
cpp_cppyy.h:21
Cppyy::TCppType_t
TCppScope_t TCppType_t
Definition:
cpp_cppyy.h:19
sqlio::Long
const char * Long
Definition:
TSQLStructure.cxx:72
sqlio::ULong
const char * ULong
Definition:
TSQLStructure.cxx:79
sqlio::Float
const char * Float
Definition:
TSQLStructure.cxx:74
sqlio::Double
const char * Double
Definition:
TSQLStructure.cxx:75
sqlio::UChar
const char * UChar
Definition:
TSQLStructure.cxx:76
sqlio::Short
const char * Short
Definition:
TSQLStructure.cxx:70
sqlio::Int
const char * Int
Definition:
TSQLStructure.cxx:71
sqlio::UInt
const char * UInt
Definition:
TSQLStructure.cxx:78
sqlio::UShort
const char * UShort
Definition:
TSQLStructure.cxx:77
sqlio::Bool
const char * Bool
Definition:
TSQLStructure.cxx:68
sqlio::Char
const char * Char
Definition:
TSQLStructure.cxx:69
bindings
pyroot
cppyy
CPyCppyy
src
DeclareExecutors.h
ROOT v6-22 - Reference Guide Generated on Fri Apr 1 2022 11:50:22 (GVA Time) using Doxygen 1.9.4