BALL  1.5.0
pyKernel.h
Go to the documentation of this file.
1 #ifndef BALL_PYTHON_PYKERNEL_H
2 #define BALL_PYTHON_PYKERNEL_H
3 
4 #include <BALL/COMMON/global.h>
5 
6 #include <Python.h>
7 
8 #include <map>
9 #include <string>
10 #include <utility>
11 
12 namespace BALL
13 {
14  class PyKernel
15  {
16  public:
17  using KeyValArgs = std::map<std::string, std::string>;
18 
19  PyKernel() = default;
20  virtual ~PyKernel() = default;
21 
27  virtual bool isStarted() const = 0;
28 
34  virtual std::string getErrorMessage() const = 0;
35 
43  virtual std::pair<bool, std::string> run(std::string str) = 0;
44 
53  BALL_DEPRECATED virtual bool runFile(std::string filename) = 0;
54 
63  virtual bool execute(const std::string& module, const std::string& func, const KeyValArgs& args) = 0;
64 
65  protected:
66 
73  virtual void loadScriptDir();
74  };
75 }
76 
77 #endif // BALL_PYTHON_PYKERNEL_H
BALL::PyKernel::loadScriptDir
virtual void loadScriptDir()
BALL::PyKernel::getErrorMessage
virtual std::string getErrorMessage() const =0
BALL::PyKernel::PyKernel
PyKernel()=default
BALL_DEPRECATED
#define BALL_DEPRECATED
Definition: COMMON/global.h:64
BALL::PyKernel::KeyValArgs
std::map< std::string, std::string > KeyValArgs
Definition: pyKernel.h:17
BALL
Definition: constants.h:12
BALL::PyKernel::runFile
virtual BALL_DEPRECATED bool runFile(std::string filename)=0
BALL::PyKernel::run
virtual std::pair< bool, std::string > run(std::string str)=0
global.h
BALL::PyKernel
Definition: pyKernel.h:14
BALL::PyKernel::isStarted
virtual bool isStarted() const =0
BALL::PyKernel::~PyKernel
virtual ~PyKernel()=default
BALL::PyKernel::execute
virtual bool execute(const std::string &module, const std::string &func, const KeyValArgs &args)=0