Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
hpi::python_interface Class Reference

a class which encapsulates the python interface. More...

#include <hpi_classes.h>

Public Member Functions

 python_interface ()
 constructor More...
 
 ~python_interface ()
 
bool activate ()
 : loads the necessary modules hsi and hpi. More...
 
int call_hpi (const char *hpi_func, PyObject *pArgs)
 call a routine in the hsi module with a bunch of parameters. More...
 

Private Member Functions

PyObject * load_module (const char *name)
 general module-loading function More...
 

Private Attributes

bool activated
 flag, true if activated More...
 
PyObject * hsi_module
 pointer to loaded hsi module More...
 
PyObject * hpi_module
 pointer to loaded hpi module More...
 

Detailed Description

a class which encapsulates the python interface.

It will only function if it's activate() method is called. Note there is only a single instance of this class; it lives in hpi.cpp the python interface relies on two modules:

Definition at line 50 of file hpi_classes.h.

Constructor & Destructor Documentation

hpi::python_interface::python_interface ( )
inline

constructor

Definition at line 64 of file hpi_classes.h.

hpi::python_interface::~python_interface ( )

Definition at line 53 of file hpi_classes.cpp.

References activated, hpi_module, and hsi_module.

Member Function Documentation

bool hpi::python_interface::activate ( )

: loads the necessary modules hsi and hpi.

this will only succeed if Python can find them. Currently this will only succeed if the modules are in PYTHONPATH, so you might either keep them in Python's module directory or set PYTHONPATH to where you keep them

Definition at line 67 of file hpi_classes.cpp.

References activated, hpi_module, hsi_module, and load_module().

Referenced by hpi::callhpi().

int hpi::python_interface::call_hpi ( const char *  hpi_func,
PyObject *  pArgs 
)

call a routine in the hsi module with a bunch of parameters.

The parameters are passed in as a python tuple which is constructed with the python_arglist class below. note that currently the only function in hpi is hpi_dispatch() but since this may change it isn't hardcoded.

Definition at line 99 of file hpi_classes.cpp.

References hpi_module.

Referenced by hpi::callhpi().

PyObject * hpi::python_interface::load_module ( const char *  name)
private

general module-loading function

Definition at line 38 of file hpi_classes.cpp.

Referenced by activate().

Member Data Documentation

bool hpi::python_interface::activated
private

flag, true if activated

Definition at line 54 of file hpi_classes.h.

Referenced by activate(), and ~python_interface().

PyObject* hpi::python_interface::hpi_module
private

pointer to loaded hpi module

Definition at line 58 of file hpi_classes.h.

Referenced by activate(), call_hpi(), and ~python_interface().

PyObject* hpi::python_interface::hsi_module
private

pointer to loaded hsi module

Definition at line 56 of file hpi_classes.h.

Referenced by activate(), and ~python_interface().


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