PPL Logo

PythonObject Class Reference

#include <PythonCCS.h>

Collaboration diagram for PythonObject:

Collaboration graph
[legend]

Public Member Functions

void pyRequest (CkCcsRequestMsg *msg)
void execute (CkCcsRequestMsg *msg, CcsDelayedReply *reply)
void print (PythonPrint *pyMsg, CcsDelayedReply *reply)
void finished (PythonFinished *pyMsg, CcsDelayedReply *reply)
void cleanup (PythonExecute *pyMsg, PyThreadState *pts, CmiUInt4 pyVal)
void getPrint (CkCcsRequestMsg *msg)
void executeThread (PythonExecute *pyMsg)
virtual PyMethodDef * getMethods ()
virtual const char * getMethodsDoc ()
 PythonObject ()
void pythonSetString (PyObject *, char *, char *)
void pythonSetString (PyObject *, char *, char *, int)
void pythonSetInt (PyObject *, char *, long)
void pythonSetLong (PyObject *, char *, long)
void pythonSetLong (PyObject *, char *, unsigned long)
void pythonSetLong (PyObject *, char *, double)
void pythonSetFloat (PyObject *, char *, double)
void pythonSetComplex (PyObject *, char *, double, double)
void pythonSetPointer (PyObject *, char *, void *)
void pythonGetString (PyObject *, char *, char **)
void pythonGetInt (PyObject *, char *, long *)
void pythonGetLong (PyObject *, char *, long *)
void pythonGetLong (PyObject *, char *, unsigned long *)
void pythonGetLong (PyObject *, char *, double *)
void pythonGetFloat (PyObject *, char *, double *)
void pythonGetComplex (PyObject *, char *, double *, double *)
void pythonGetPointer (PyObject *, char *, void **)
PyObject * pythonGetArg (int)
void pythonReturn (int)
void pythonReturn (int, PyObject *)
void pythonAwake (int)
void pythonSleep (int)
virtual PyObject * read (PyObject *where)
virtual void write (PyObject *where, PyObject *what)
virtual int buildIterator (PyObject *&, void *)
virtual int nextIteratorUpdate (PyObject *&, PyObject *, void *)

Static Public Member Functions

static void replyIntValue (PythonObject *obj, CcsDelayedReply *reply, CmiUInt4 *value)
static void _callthr_executeThread (CkThrCallArg *impl_arg)

Data Fields

CmiUInt4 pyNumber
PythonTable pyWorkers
void(* replyIntFn )(PythonObject *, CcsDelayedReply *, CmiUInt4 *)

Protected Member Functions

int prepareInterpreter (PythonExecute *pyMsg)
 This method prepares a python interpreter for execution of code inside it.

Static Private Attributes

static PyMethodDef CkPy_MethodsCustom []
static const char * CkPy_MethodsCustomDoc = ""

Detailed Description

Definition at line 55 of file PythonCCS.h.


Constructor & Destructor Documentation

PythonObject::PythonObject (  )  [inline]

Definition at line 79 of file PythonCCS.h.

References replyIntFn, and replyIntValue().


Member Function Documentation

void PythonObject::pyRequest ( CkCcsRequestMsg msg  ) 

void PythonObject::execute ( CkCcsRequestMsg msg,
CcsDelayedReply reply 
)

void PythonObject::print ( PythonPrint pyMsg,
CcsDelayedReply reply 
)

void PythonObject::finished ( PythonFinished pyMsg,
CcsDelayedReply reply 
)

int PythonObject::prepareInterpreter ( PythonExecute pyMsg  )  [protected]

This method prepares a python interpreter for execution of code inside it.

It either allocates a new interpreter or uses an existing one, depending on the input parameters. The python lock is acquired if the interpreter is successfully prepared.

Returns:
the ID of the interpreter allocated. zero means failure

Definition at line 361 of file PythonCCS.C.

References CkPy_MethodsDefault, CkPythonDebugf(), getMethods(), getMethodsDoc(), PythonExecute::interpreter, PythonExecute::isHighLevel(), PythonExecute::isKeepPrint(), pyNumber, and pyWorkers.

Referenced by execute().

void PythonObject::replyIntValue ( PythonObject obj,
CcsDelayedReply reply,
CmiUInt4 value 
) [static]

void PythonObject::cleanup ( PythonExecute pyMsg,
PyThreadState *  pts,
CmiUInt4  pyVal 
)

Definition at line 687 of file PythonCCS.C.

References PythonExecute::isPersistent(), pyWorkers, and replyIntFn.

Referenced by executeThread().

void PythonObject::getPrint ( CkCcsRequestMsg msg  ) 

Definition at line 719 of file PythonCCS.C.

void PythonObject::_callthr_executeThread ( CkThrCallArg impl_arg  )  [static]

Definition at line 485 of file PythonCCS.C.

References CkCcsRequestMsg::data, CkThrCallArg::msg, and CkThrCallArg::obj.

Referenced by execute().

void PythonObject::executeThread ( PythonExecute pyMsg  ) 

virtual PyMethodDef* PythonObject::getMethods (  )  [inline, virtual]

Definition at line 76 of file PythonCCS.h.

References CkPy_MethodsCustom.

Referenced by prepareInterpreter().

virtual const char* PythonObject::getMethodsDoc (  )  [inline, virtual]

Definition at line 77 of file PythonCCS.h.

References CkPy_MethodsCustomDoc.

Referenced by prepareInterpreter().

void PythonObject::pythonSetString ( PyObject *  arg,
char *  descr,
char *  value 
)

Definition at line 724 of file PythonCCS.C.

void PythonObject::pythonSetString ( PyObject *  arg,
char *  descr,
char *  value,
int  len 
)

Definition at line 730 of file PythonCCS.C.

void PythonObject::pythonSetInt ( PyObject *  arg,
char *  descr,
long  value 
)

Definition at line 742 of file PythonCCS.C.

void PythonObject::pythonSetLong ( PyObject *  arg,
char *  descr,
long  value 
)

Definition at line 754 of file PythonCCS.C.

void PythonObject::pythonSetLong ( PyObject *  arg,
char *  descr,
unsigned long  value 
)

Definition at line 760 of file PythonCCS.C.

void PythonObject::pythonSetLong ( PyObject *  arg,
char *  descr,
double  value 
)

Definition at line 766 of file PythonCCS.C.

void PythonObject::pythonSetFloat ( PyObject *  arg,
char *  descr,
double  value 
)

Definition at line 790 of file PythonCCS.C.

void PythonObject::pythonSetComplex ( PyObject *  arg,
char *  descr,
double  real,
double  imag 
)

Definition at line 802 of file PythonCCS.C.

void PythonObject::pythonSetPointer ( PyObject *  arg,
char *  descr,
void *  ptr 
)

Definition at line 815 of file PythonCCS.C.

void PythonObject::pythonGetString ( PyObject *  arg,
char *  descr,
char **  result 
)

Definition at line 736 of file PythonCCS.C.

void PythonObject::pythonGetInt ( PyObject *  arg,
char *  descr,
long *  result 
)

Definition at line 748 of file PythonCCS.C.

void PythonObject::pythonGetLong ( PyObject *  arg,
char *  descr,
long *  result 
)

Definition at line 772 of file PythonCCS.C.

void PythonObject::pythonGetLong ( PyObject *  arg,
char *  descr,
unsigned long *  result 
)

Definition at line 778 of file PythonCCS.C.

void PythonObject::pythonGetLong ( PyObject *  arg,
char *  descr,
double result 
)

Definition at line 784 of file PythonCCS.C.

void PythonObject::pythonGetFloat ( PyObject *  arg,
char *  descr,
double result 
)

Definition at line 796 of file PythonCCS.C.

void PythonObject::pythonGetComplex ( PyObject *  arg,
char *  descr,
double real,
double imag 
)

Definition at line 808 of file PythonCCS.C.

void PythonObject::pythonGetPointer ( PyObject *  arg,
char *  descr,
void **  ptr 
)

Definition at line 821 of file PythonCCS.C.

PyObject * PythonObject::pythonGetArg ( int  handle  ) 

Definition at line 827 of file PythonCCS.C.

References pyWorkers.

void PythonObject::pythonReturn ( int  handle  ) 

Definition at line 834 of file PythonCCS.C.

void PythonObject::pythonReturn ( int  handle,
PyObject *  data 
)

Definition at line 844 of file PythonCCS.C.

References pyWorkers.

void PythonObject::pythonAwake ( int  handle  ) 

Definition at line 852 of file PythonCCS.C.

void PythonObject::pythonSleep ( int  handle  ) 

Definition at line 860 of file PythonCCS.C.

virtual PyObject* PythonObject::read ( PyObject *  where  )  [inline, virtual]

Definition at line 115 of file PythonCCS.h.

virtual void PythonObject::write ( PyObject *  where,
PyObject *  what 
) [inline, virtual]

Definition at line 116 of file PythonCCS.h.

virtual int PythonObject::buildIterator ( PyObject *&  ,
void *   
) [inline, virtual]

Definition at line 121 of file PythonCCS.h.

Referenced by executeThread().

virtual int PythonObject::nextIteratorUpdate ( PyObject *&  ,
PyObject *  ,
void *   
) [inline, virtual]

Definition at line 122 of file PythonCCS.h.

Referenced by executeThread().


Field Documentation

PyMethodDef PythonObject::CkPy_MethodsCustom [static, private]

Initial value:

 {
  {NULL,      NULL}        
}

Definition at line 56 of file PythonCCS.h.

Referenced by getMethods().

const char * PythonObject::CkPy_MethodsCustomDoc = "" [static, private]

Definition at line 57 of file PythonCCS.h.

Referenced by getMethodsDoc().

Definition at line 59 of file PythonCCS.h.

Referenced by prepareInterpreter().


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

Generated on Fri May 25 08:04:59 2012 for Charm++ by  doxygen 1.5.5