3#include "../../string.hpp"
4#include "../../utilities/system_info.hpp"
6#include "../py_script.hpp"
15 inline HandleGuard<PyScript::Context>::HandleGuard(
void *handle) noexcept
16 : HandleGuard<PyScript::Context>(handle, [](
void *handle) { CVB_CALL_CAPI(
ReleaseObject(handle)); })
59 CExports::CVPYSCONTEXT context =
nullptr;
60 CVB_CALL_CAPI_CHECKED(CVPYSCreateOrGetContext(
61 *
reinterpret_cast<CExports::CVPYSInterpreterVersion *
>(&interpreterVersion_), context));
62 handle_ = Cvb::HandleGuard<Context>(context);
65 Context(
const Context &other) =
delete;
66 Context &operator=(
const Context &other) =
delete;
67 Context(Context &&other) =
delete;
68 Context &operator=(Context &&other) =
delete;
108 CVB_CALL_CAPI(CVPYSContextSysPathAppendTyped(
Handle(), path.c_str()));
118 return interpreterVersion_;
129 return handle_.Handle();
133 HandleGuard<Context> handle_;
Global python scripting context.
Definition decl_context.hpp:32
struct InterpreterVersion InterpreterVersion() const noexcept
Get the found interpreter version.
Definition decl_context.hpp:116
void AppendToSysPath(const Cvb::String &path)
Adds additional items to the python search path.
Definition decl_context.hpp:106
ObjectPtr Eval(const Cvb::String &fileName, const Cvb::String &code)
Compiles and evaluates python code-.
Definition detail_context.hpp:13
static ContextPtr CreateOrGet()
Creates a context.
Definition decl_context.hpp:50
ObjectPtr Item(const Cvb::String &itemName)
Get an item from this context.
Definition detail_context.hpp:27
ObjectPtr Import(const Cvb::String &moduleName)
Imports a python module.
Definition detail_context.hpp:20
void * Handle() const noexcept
Classic API buffer handle.
Definition decl_context.hpp:127
cvbbool_t ReleaseObject(OBJ &Object)
Namespace for the python scripting package.
Definition decl_context.hpp:21
std::shared_ptr< Context > ContextPtr
Convenience shared pointer for Context.
Definition py_script.hpp:123
std::shared_ptr< Object > ObjectPtr
Convenience shared pointer for Object.
Definition py_script.hpp:127
Root namespace for the Image Manager interface.
Definition version.hpp:11
std::string String
String for wide characters or unicode characters.
Definition string.hpp:49
Active interpreter version.
Definition py_script.hpp:138