MIRA
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
PythonInterpreter Class Reference

#include <python/PythonInterpreter.h>

Inheritance diagram for PythonInterpreter:
Inheritance graph
[legend]

Public Types

typedef Base::Type Type
 

Public Member Functions

boost::python::object getMainModule ()
 Get the main (main) module. More...
 
boost::python::dict getGlobalDict ()
 Get the global dict (dict) of the main module. More...
 
boost::python::dict getLocalDict ()
 Get a local copy of the global dict (dict) of the main module. More...
 
boost::python::object importModule (const std::string &name)
 Import a python module. More...
 
void extendPath (const std::string &path)
 Extend the list of search paths for python modules by the given path. More...
 

Static Public Member Functions

static Typeinstance ()
 
static bool isDestroyed ()
 

Protected Member Functions

 PythonInterpreter ()
 
 ~PythonInterpreter ()
 

Static Protected Member Functions

static TypemakeInstance ()
 
static void destroyInstance (void)
 

Protected Attributes

boost::python::object mMainModule
 
boost::python::object mGlobalDict
 
PyThreadState * mMainThreadState
 PyEval_ReleaseLock() is deprecated and should not be used anymore. More...
 

Friends

class mira::singleton::CreateUsingNew< PythonInterpreter >
 

Constructor & Destructor Documentation

◆ PythonInterpreter()

PythonInterpreter ( )
protected

◆ ~PythonInterpreter()

~PythonInterpreter ( )
protected

Member Function Documentation

◆ getMainModule()

boost::python::object getMainModule ( )
inline

Get the main (main) module.

◆ getGlobalDict()

boost::python::dict getGlobalDict ( )
inline

Get the global dict (dict) of the main module.

Can be used as a context to execute python code.

◆ getLocalDict()

boost::python::dict getLocalDict ( )
inline

Get a local copy of the global dict (dict) of the main module.

Can be used as a context to execute python code.

◆ importModule()

boost::python::object importModule ( const std::string &  name)

Import a python module.

◆ extendPath()

void extendPath ( const std::string &  path)

Extend the list of search paths for python modules by the given path.

Friends And Related Function Documentation

◆ mira::singleton::CreateUsingNew< PythonInterpreter >

Member Data Documentation

◆ mMainModule

boost::python::object mMainModule
protected

◆ mGlobalDict

boost::python::object mGlobalDict
protected

◆ mMainThreadState

PyThreadState* mMainThreadState
protected

PyEval_ReleaseLock() is deprecated and should not be used anymore.

This means we have to store the thread state here to release the GIL on the main thread and restore it on exit.


The documentation for this class was generated from the following file: