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