MIRA
Classes | Functions
mira::python Namespace Reference

Classes

class  BaseReflectorWrapper
 
struct  ChannelAccessWrapper
 
struct  ChannelReadIntervalWrapper
 Also wrap ChannelReadInterval<T>::begin and ChannelReadInterval<T>::end to return the ChannelReadInterval<T>::IntervalList::const_iterator instead of the ChannelReadInterval<T>::const_iterator. More...
 
struct  ChannelReadWrapper
 
struct  ChannelReadWrapperBase
 
struct  ChannelWaitWrapper
 
struct  EigenBaseAccessor
 
struct  EigenFixedSizeMatrix
 
struct  EigenMatrixAccessor
 
struct  EigenVectorAccessor
 
class  final_vector_derived_policies
 
struct  ImageAccessor
 Dummy image accessor struct. More...
 
struct  ImageAccessor< mira::Img< TPixel, TChannels > >
 
struct  ImageAccessor< mira::Img< void, 1 > >
 
struct  ImageAccessorBase
 Dummy image accessor base struct. More...
 
struct  ImageAccessorBase< mira::Img< TPixel, TChannels > >
 
class  no_contains_vector_indexing_suite
 
struct  object_from_python
 
struct  python_optional
 
class  PythonEditor
 
class  PythonEditorUI
 
class  PythonError
 
class  PythonInterpreter
 
struct  PythonSetAccessor
 
class  PyUnit
 
class  PyUnitWrapper
 
class  PyUnitWrapperBase
 
class  ReflectorWrapper
 
struct  ReflectorWrapperRPCCallHelper
 
struct  ReflectorWrapperRPCCallHelper< void >
 
struct  ReflectorWrapperVersionHelper
 
struct  ReflectorWrapperVersionHelper< MetaSerializer >
 
struct  register_python_conversion
 
class  ScopedGILLock
 A scoped global interpreter (GIL) lock. More...
 
class  ScopedGILThreadLock
 A scoped global interpreter (GIL) lock. More...
 
struct  VectorWithoutContains
 
struct  ZeroMatrix
 ZeroMatrix serves 2 purposes: More...
 
struct  ZeroMatrix< Eigen::MatrixXf >
 
struct  ZeroMatrix< Eigen::VectorXf >
 

Functions

static int getNumpyDtype (int cvDtype)
 Return numerical numpy dtype identifier corresponding to a numerical dtype from OpenCV. More...
 
static int getCvDtype (int numpyDtype)
 
json::Value to_json (boost::python::object o)
 
boost::python::object from_json (const json::Value &j)
 
std::ostream & operator<< (std::ostream &os, const PythonError &err)
 
PythonError checkSyntax (const std::string &code)
 check syntax of python string More...
 
std::string getLastExceptionString ()
 Extract the message from the last python exception. More...
 
void block_hashing (boost::python::object)
 
template<typename T >
std::vector< T > listToVector (const boost::python::object &l)
 
template<typename T >
Channel< T > subscribe (PyUnitWrapper &unit, const std::string &channelID)
 Typed subscribe method every wrapped type must contain. More...
 
template<typename T >
Channel< T > subscribeCb (PyUnitWrapper &unit, const std::string &channelID, boost::python::object callable)
 Typed subscribe method every wrapped type must contain. More...
 
template<typename T >
Channel< T > subscribeIntervalCb (PyUnitWrapper &unit, const std::string &channelID, boost::python::object callable, const Duration &storageDuration)
 Typed subscribe method every wrapped type must contain. More...
 
template<typename T >
void unsubscribe (PyUnitWrapper &unit, const std::string &channelID)
 Typed unsubscribe method every wrapped type must contain. More...
 
template<typename T >
Channel< T > publish (PyUnitWrapper &unit, const std::string &channelID)
 Typed publish method every wrapped type must contain. More...
 
template<typename T >
boost::python::object convertJSONtoObject (const json::Value &value)
 Create an object instance from JSON data MIRA's JSON deserialization capabilities. More...
 
template<typename T >
json::Value convertObjectToJSON (const T &obj)
 Generate a JSON representation using MIRA's JSON serialization capabilities. More...
 

Function Documentation

◆ getNumpyDtype()

static int mira::python::getNumpyDtype ( int  cvDtype)
static

Return numerical numpy dtype identifier corresponding to a numerical dtype from OpenCV.

Parameters
cvDtypenumerical representation of a dtype from OpenCV, e.g. CV_32F
Returns
matching numerical numpy dtype, e.g. NPY_FLOAT

◆ getCvDtype()

static int mira::python::getCvDtype ( int  numpyDtype)
static

◆ to_json()

json::Value mira::python::to_json ( boost::python::object  o)

◆ from_json()

boost::python::object mira::python::from_json ( const json::Value j)

◆ operator<<()

std::ostream& mira::python::operator<< ( std::ostream &  os,
const PythonError err 
)

◆ checkSyntax()

PythonError mira::python::checkSyntax ( const std::string &  code)

check syntax of python string

◆ getLastExceptionString()

std::string mira::python::getLastExceptionString ( )

Extract the message from the last python exception.

◆ block_hashing()

void mira::python::block_hashing ( boost::python::object  )
inline

◆ listToVector()

std::vector<T> mira::python::listToVector ( const boost::python::object &  l)
inline

◆ subscribe()

Channel<T> mira::python::subscribe ( PyUnitWrapper unit,
const std::string &  channelID 
)

Typed subscribe method every wrapped type must contain.

This is automatically appended to the definition of the wrapper when using the macro MIRA_PYCONNECTOR_TYPE_FOOTER. This method is called by the authority wrapper internally. Same as above without callable object.

◆ subscribeCb()

Channel<T> mira::python::subscribeCb ( PyUnitWrapper unit,
const std::string &  channelID,
boost::python::object  callable 
)

Typed subscribe method every wrapped type must contain.

This is automatically appended to the definition of the wrapper when using the macro MIRA_PYCONNECTOR_TYPE_FOOTER. This method is called by the authority wrapper internally.

◆ subscribeIntervalCb()

Channel<T> mira::python::subscribeIntervalCb ( PyUnitWrapper unit,
const std::string &  channelID,
boost::python::object  callable,
const Duration storageDuration 
)

Typed subscribe method every wrapped type must contain.

This is automatically appended to the definition of the wrapper when using the macro MIRA_PYCONNECTOR_TYPE_FOOTER. This method is called by the authority wrapper internally.

◆ unsubscribe()

void mira::python::unsubscribe ( PyUnitWrapper unit,
const std::string &  channelID 
)

Typed unsubscribe method every wrapped type must contain.

This is automatically appended to the definition of the wrapper when using the macro MIRA_PYCONNECTOR_TYPE_FOOTER. This method is called by the authority wrapper internally. Same as above without callable object.

◆ publish()

Channel<T> mira::python::publish ( PyUnitWrapper unit,
const std::string &  channelID 
)

Typed publish method every wrapped type must contain.

This is automatically appended to the definition of the wrapper when using the macro MIRA_PYCONNECTOR_TYPE_FOOTER. This method is called by the authority wrapper internally.

◆ convertJSONtoObject()

boost::python::object mira::python::convertJSONtoObject ( const json::Value value)

Create an object instance from JSON data MIRA's JSON deserialization capabilities.

Parameters
valuethe JSON data
Returns
the object deserialized from the input JSON value
See also
JSONDeserializer

◆ convertObjectToJSON()

json::Value mira::python::convertObjectToJSON ( const T &  obj)

Generate a JSON representation using MIRA's JSON serialization capabilities.

Parameters
objobject to serialize
Returns
JSON representation of the given object
Note
This function is used as "non-static" method below, so this binds to obj
See also
JSONSerializer