Choreonoid  1.8
Public Types | Public Member Functions | Static Public Member Functions | List of all members
cnoid::PythonExecutor Class Reference

#include <PythonExecutor.h>

Public Types

enum  State { NOT_RUNNING, RUNNING_FOREGROUND, RUNNING_BACKGROUND }
 

Public Member Functions

 PythonExecutor ()
 
 PythonExecutor (const PythonExecutor &org)
 
 ~PythonExecutor ()
 
void setBackgroundMode (bool on)
 
bool isBackgroundMode () const
 
State state () const
 
bool eval (const std::string &code)
 
python::object returnValue ()
 
python::object resultObject ()
 
bool execCode (const std::string &code)
 
bool execFile (const std::string &filename)
 
bool waitToFinish (double timeout)
 
SignalProxy< void()> sigFinished ()
 
bool hasException () const
 
const std::string exceptionTypeName () const
 
const std::string exceptionText () const
 
python::object exceptionType () const
 
python::object exceptionValue () const
 
const std::string resultString () const
 
bool isTerminated () const
 
bool terminate ()
 

Static Public Member Functions

static void setModuleRefreshEnabled (bool on)
 

Detailed Description

Note
GIL must be locked to access to the objects of this class. Even the destructor requires GIL to be locked when it is executed.

Member Enumeration Documentation

◆ State

Enumerator
NOT_RUNNING 
RUNNING_FOREGROUND 
RUNNING_BACKGROUND 

Constructor & Destructor Documentation

◆ PythonExecutor() [1/2]

PythonExecutor::PythonExecutor ( )

◆ PythonExecutor() [2/2]

PythonExecutor::PythonExecutor ( const PythonExecutor org)

◆ ~PythonExecutor()

PythonExecutor::~PythonExecutor ( )

Member Function Documentation

◆ eval()

bool PythonExecutor::eval ( const std::string &  code)

◆ exceptionText()

const std::string PythonExecutor::exceptionText ( ) const

◆ exceptionType()

python::object PythonExecutor::exceptionType ( ) const
Note
GIL must be obtained when accessing this object.

◆ exceptionTypeName()

const std::string PythonExecutor::exceptionTypeName ( ) const
Note
The name includes module components.

◆ exceptionValue()

python::object PythonExecutor::exceptionValue ( ) const
Note
GIL must be obtained when accessing this object.

◆ execCode()

bool PythonExecutor::execCode ( const std::string &  code)

◆ execFile()

bool PythonExecutor::execFile ( const std::string &  filename)

◆ hasException()

bool PythonExecutor::hasException ( ) const

◆ isBackgroundMode()

bool PythonExecutor::isBackgroundMode ( ) const

◆ isTerminated()

bool PythonExecutor::isTerminated ( ) const

◆ resultObject()

python::object cnoid::PythonExecutor::resultObject ( )
inline
Deprecated:
. Use the returnValue function.

◆ resultString()

const std::string cnoid::PythonExecutor::resultString ( ) const
inline
Deprecated:
. Use the 'exceptionText' function.

◆ returnValue()

python::object PythonExecutor::returnValue ( )
Note
This is only valid when the "eval' function is executed.
GIL must be obtained when accessing this object.

◆ setBackgroundMode()

void PythonExecutor::setBackgroundMode ( bool  on)

◆ setModuleRefreshEnabled()

void PythonExecutor::setModuleRefreshEnabled ( bool  on)
static

◆ sigFinished()

SignalProxy< void()> PythonExecutor::sigFinished ( )

◆ state()

PythonExecutor::State PythonExecutor::state ( ) const

◆ terminate()

bool PythonExecutor::terminate ( )

◆ waitToFinish()

bool PythonExecutor::waitToFinish ( double  timeout)

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