Logo ROOT  
Reference Guide
Executors.h
Go to the documentation of this file.
1#ifndef CPYCPPYY_EXECUTORS_H
2#define CPYCPPYY_EXECUTORS_H
3
4// Standard
5#include <string>
6
7
8namespace CPyCppyy {
9
10struct CallContext;
11
12class CPYCPPYY_CLASS_EXPORT Executor {
13public:
14 virtual ~Executor();
15 virtual PyObject* Execute(
17 virtual bool HasState() { return false; }
18};
19
20// special case needed for CPPSetItem
21class RefExecutor : public Executor {
22public:
23 RefExecutor() : fAssignable(nullptr) {}
24 virtual bool SetAssignable(PyObject*);
25 virtual bool HasState() { return true; }
26
27protected:
29};
30
31// create/destroy executor from fully qualified type (public API)
32CPYCPPYY_EXPORT Executor* CreateExecutor(const std::string& fullType);
34typedef Executor* (*ef_t) ();
35CPYCPPYY_EXPORT bool RegisterExecutor(const std::string& name, ef_t fac);
36CPYCPPYY_EXPORT bool UnregisterExecutor(const std::string& name);
37
38// helper for the actual call
40
41} // namespace CPyCppyy
42
43#endif // !CPYCPPYY_EXECUTORS_H
_object PyObject
Definition: PyMethodBase.h:42
char name[80]
Definition: TGX11.cxx:110
#define CPYCPPYY_CLASS_EXPORT
Definition: CommonDefs.h:27
#define CPYCPPYY_EXPORT
Definition: CommonDefs.h:25
virtual PyObject * Execute(Cppyy::TCppMethod_t, Cppyy::TCppObject_t, CallContext *)=0
virtual bool HasState()
Definition: Executors.h:17
virtual bool SetAssignable(PyObject *)
Definition: Executors.cxx:319
PyObject * fAssignable
Definition: Executors.h:28
virtual bool HasState()
Definition: Executors.h:25
Set of helper functions that are invoked from the pythonizors, on the Python side.
CPYCPPYY_EXTERN bool UnregisterExecutor(const std::string &name)
Definition: Executors.cxx:858
CPYCPPYY_EXPORT void DestroyExecutor(Executor *p)
Definition: Executors.cxx:837
CPYCPPYY_EXTERN bool RegisterExecutor(const std::string &name, ExecutorFactory_t)
Definition: Executors.cxx:845
CPYCPPYY_EXTERN Executor * CreateExecutor(const std::string &name)
Definition: Executors.cxx:748
Executor *(* ef_t)()
Definition: Executors.cxx:22
CPYCPPYY_EXTERN void * CallVoidP(Cppyy::TCppMethod_t, Cppyy::TCppObject_t, CallContext *)
Definition: Executors.cxx:871
intptr_t TCppMethod_t
Definition: cpp_cppyy.h:22
void * TCppObject_t
Definition: cpp_cppyy.h:21