Loading...
Searching...
No Matches
pyCAPIKernel.h
Go to the documentation of this file.
#ifndef BALL_PYTHON_PYCAPIKERNEL_H
#define BALL_PYTHON_PYCAPIKERNEL_H
#include <BALL/PYTHON/pyKernel.h>
#include <vector>
namespace BALL
{
class PyCAPIKernel : public PyKernel
{
public:
PyCAPIKernel();
~PyCAPIKernel() override;
bool isStarted() const override;
std::string getErrorMessage() const override { return last_err_; };
std::pair<bool, std::string> run(std::string str) override;
BALL_DEPRECATED bool runFile(std::string filename) override;
bool execute(const std::string& module, const std::string& func, const KeyValArgs& args) override;
private:
PyObject* loadModule(const std::string& name);
bool errorOccurred();
PyObject* main_module_ {nullptr};
PyObject* context_ {nullptr};
std::string last_err_ {};
std::vector<PyObject*> modules_ {};
};
}
#endif // BALL_PYTHON_PYCAPIKERNEL_H
BALL_DEPRECATED
#define BALL_DEPRECATED
Definition COMMON/global.h:64
BALL::PyCAPIKernel::getErrorMessage
std::string getErrorMessage() const override
Definition pyCAPIKernel.h:17
BALL::PyCAPIKernel::runFile
BALL_DEPRECATED bool runFile(std::string filename) override
BALL::PyCAPIKernel::execute
bool execute(const std::string &module, const std::string &func, const KeyValArgs &args) override
BALL::PyCAPIKernel::run
std::pair< bool, std::string > run(std::string str) override
BALL::PyCAPIKernel::PyCAPIKernel
PyCAPIKernel()
BALL::PyCAPIKernel::isStarted
bool isStarted() const override
BALL::PyCAPIKernel::~PyCAPIKernel
~PyCAPIKernel() override
BALL::PyKernel::KeyValArgs
std::map< std::string, std::string > KeyValArgs
Definition pyKernel.h:17
BALL::PyKernel::PyKernel
PyKernel()=default
BALL
Definition constants.h:13
pyKernel.h