Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
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 *)
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)
CPYCPPYY_EXPORT void DestroyExecutor(Executor *p)
CPYCPPYY_EXTERN bool RegisterExecutor(const std::string &name, ExecutorFactory_t)
CPYCPPYY_EXTERN Executor * CreateExecutor(const std::string &name)
Executor *(* ef_t)()
Definition Executors.cxx:22
CPYCPPYY_EXTERN void * CallVoidP(Cppyy::TCppMethod_t, Cppyy::TCppObject_t, CallContext *)
intptr_t TCppMethod_t
Definition cpp_cppyy.h:22
void * TCppObject_t
Definition cpp_cppyy.h:21