|
Gaudi Framework, version v21r4 |
| Home | Generated: 7 Sep 2009 |
#include <Helpers.h>
Definition at line 39 of file Helpers.h.
Public Member Functions | |
| Helper () | |
Static Public Member Functions | |
| static IService * | service (ISvcLocator *svcloc, const std::string &name, bool createif=false) |
| static IAlgorithm * | algorithm (IAlgManager *algmgr, const std::string &name) |
| static DataObject * | dataobject (IDataProviderSvc *dpsvc, const std::string &path) |
| static IAlgTool * | tool (IToolSvc *toolsvc, const std::string &type, const std::string &name, IInterface *p, bool cif) |
| static long | loadDynamicLib (const std::string &name) |
| static IHistogram1D * | histo1D (IHistogramSvc *hsvc, const std::string &path) |
| static IHistogram2D * | histo2D (IHistogramSvc *hsvc, const std::string &path) |
| static IHistogram3D * | histo3D (IHistogramSvc *hsvc, const std::string &path) |
| static IProfile1D * | profile1D (IHistogramSvc *hsvc, const std::string &path) |
| static IProfile2D * | profile2D (IHistogramSvc *hsvc, const std::string &path) |
| template<class T> | |
| static PyObject * | toArray (T *ptr, Py_ssize_t size) |
| static PyObject * | toIntArray (void *ptr, Py_ssize_t size) |
| static PyObject * | toShortArray (void *ptr, Py_ssize_t size) |
| static PyObject * | toFloatArray (void *ptr, Py_ssize_t size) |
| static PyObject * | toDoubleArray (void *ptr, Py_ssize_t size) |
| template<class T> | |
| static T * | toAddress (std::vector< T > &v) |
| template<class T> | |
| static T * | toAddress (void *a) |
Static Private Member Functions | |
| template<class T> | |
| static Py_ssize_t | Array_length (PyObject *self) |
| template<class T> | |
| static PyObject * | toPython (T *o) |
| static PyObject * | toPython (int *o) |
| static PyObject * | toPython (short *o) |
| static PyObject * | toPython (char *o) |
| static PyObject * | toPython (long *o) |
| static PyObject * | toPython (float *o) |
| static PyObject * | toPython (double *o) |
| template<class T> | |
| static PyObject * | Array_item (PyObject *self, Py_ssize_t idx) |
| static IService* GaudiPython::Helper::service | ( | ISvcLocator * | svcloc, | |
| const std::string & | name, | |||
| bool | createif = false | |||
| ) | [inline, static] |
| static IAlgorithm* GaudiPython::Helper::algorithm | ( | IAlgManager * | algmgr, | |
| const std::string & | name | |||
| ) | [inline, static] |
| static DataObject* GaudiPython::Helper::dataobject | ( | IDataProviderSvc * | dpsvc, | |
| const std::string & | path | |||
| ) | [inline, static] |
Definition at line 53 of file Helpers.h.
00053 { 00054 DataObject* o; 00055 if ( dpsvc->retrieveObject(path,o).isSuccess() ) return o; 00056 else return 0; 00057 }
| static IAlgTool* GaudiPython::Helper::tool | ( | IToolSvc * | toolsvc, | |
| const std::string & | type, | |||
| const std::string & | name, | |||
| IInterface * | p, | |||
| bool | cif | |||
| ) | [inline, static] |
| static long GaudiPython::Helper::loadDynamicLib | ( | const std::string & | name | ) | [inline, static] |
Definition at line 63 of file Helpers.h.
00063 { 00064 void* h; 00065 return System::loadDynamicLib(name, &h); 00066 }
| static IHistogram1D* GaudiPython::Helper::histo1D | ( | IHistogramSvc * | hsvc, | |
| const std::string & | path | |||
| ) | [inline, static] |
Definition at line 67 of file Helpers.h.
00067 { 00068 IHistogram1D* h; 00069 if ( hsvc->findObject(path, h ).isSuccess() ) return h; 00070 else return 0; 00071 }
| static IHistogram2D* GaudiPython::Helper::histo2D | ( | IHistogramSvc * | hsvc, | |
| const std::string & | path | |||
| ) | [inline, static] |
Definition at line 72 of file Helpers.h.
00072 { 00073 IHistogram2D* h; 00074 if ( hsvc->findObject(path, h ).isSuccess() ) return h; 00075 else return 0; 00076 }
| static IHistogram3D* GaudiPython::Helper::histo3D | ( | IHistogramSvc * | hsvc, | |
| const std::string & | path | |||
| ) | [inline, static] |
Definition at line 77 of file Helpers.h.
00077 { 00078 IHistogram3D* h; 00079 if ( hsvc->findObject(path, h ).isSuccess() ) return h; 00080 else return 0; 00081 }
| static IProfile1D* GaudiPython::Helper::profile1D | ( | IHistogramSvc * | hsvc, | |
| const std::string & | path | |||
| ) | [inline, static] |
Definition at line 84 of file Helpers.h.
00086 { 00087 IProfile1D* h = 0 ; 00088 if ( 0 != hsvc && hsvc->findObject ( path , h ).isSuccess() ) { return h ; } 00089 return 0 ; 00090 }
| static IProfile2D* GaudiPython::Helper::profile2D | ( | IHistogramSvc * | hsvc, | |
| const std::string & | path | |||
| ) | [inline, static] |
Definition at line 93 of file Helpers.h.
00095 { 00096 IProfile2D* h = 0 ; 00097 if ( 0 != hsvc && hsvc->findObject ( path , h ).isSuccess() ) { return h ; } 00098 return 0 ; 00099 }
| static Py_ssize_t GaudiPython::Helper::Array_length | ( | PyObject * | self | ) | [inline, static, private] |
Definition at line 103 of file Helpers.h.
00103 { 00104 #if PY_VERSION_HEX < 0x02050000 00105 const 00106 #endif 00107 char* buf = 0; 00108 Py_ssize_t size = (*(self->ob_type->tp_as_buffer->bf_getcharbuffer))( self, 0, &buf ); 00109 return size/sizeof(T); 00110 }
| static PyObject* GaudiPython::Helper::toPython | ( | T * | o | ) | [inline, static, private] |
| static PyObject* GaudiPython::Helper::toPython | ( | int * | o | ) | [inline, static, private] |
| static PyObject* GaudiPython::Helper::toPython | ( | short * | o | ) | [inline, static, private] |
| static PyObject* GaudiPython::Helper::toPython | ( | char * | o | ) | [inline, static, private] |
| static PyObject* GaudiPython::Helper::toPython | ( | long * | o | ) | [inline, static, private] |
| static PyObject* GaudiPython::Helper::toPython | ( | float * | o | ) | [inline, static, private] |
| static PyObject* GaudiPython::Helper::toPython | ( | double * | o | ) | [inline, static, private] |
| static PyObject* GaudiPython::Helper::Array_item | ( | PyObject * | self, | |
| Py_ssize_t | idx | |||
| ) | [inline, static, private] |
Definition at line 121 of file Helpers.h.
00121 { 00122 #if PY_VERSION_HEX < 0x02050000 00123 const 00124 #endif 00125 char* buf = 0; 00126 Py_ssize_t size = (*(self->ob_type->tp_as_buffer->bf_getcharbuffer))( self, 0, &buf ); 00127 if ( idx < 0 || idx >= size/int(sizeof(T)) ) { 00128 PyErr_SetString( PyExc_IndexError, "buffer index out of range" ); 00129 return 0; 00130 } 00131 return toPython((T*)buf + idx); 00132 }
| static PyObject* GaudiPython::Helper::toArray | ( | T * | ptr, | |
| Py_ssize_t | size | |||
| ) | [inline, static] |
Definition at line 136 of file Helpers.h.
00136 { 00137 static PyTypeObject type = PyBuffer_Type; 00138 static PySequenceMethods meth = *(PyBuffer_Type.tp_as_sequence); 00139 #if PY_VERSION_HEX < 0x02050000 00140 meth.sq_item = (intargfunc) &Array_item<T>; 00141 meth.sq_length = (inquiry) &Array_length<T>; 00142 #else 00143 meth.sq_item = (ssizeargfunc) &Array_item<T>; 00144 meth.sq_length = (lenfunc) &Array_length<T>; 00145 #endif 00146 type.tp_as_sequence = &meth; 00147 PyObject* buf = PyBuffer_FromReadWriteMemory( ptr, size*sizeof(T) ); 00148 Py_INCREF( &type ); 00149 buf->ob_type = &type; 00150 return buf; 00151 }
| static PyObject* GaudiPython::Helper::toIntArray | ( | void * | ptr, | |
| Py_ssize_t | size | |||
| ) | [inline, static] |
| static PyObject* GaudiPython::Helper::toShortArray | ( | void * | ptr, | |
| Py_ssize_t | size | |||
| ) | [inline, static] |
| static PyObject* GaudiPython::Helper::toFloatArray | ( | void * | ptr, | |
| Py_ssize_t | size | |||
| ) | [inline, static] |
| static PyObject* GaudiPython::Helper::toDoubleArray | ( | void * | ptr, | |
| Py_ssize_t | size | |||
| ) | [inline, static] |
| static T* GaudiPython::Helper::toAddress | ( | std::vector< T > & | v | ) | [inline, static] |
| template double * GaudiPython::Helper::toAddress< double > | ( | void * | a | ) | [inline, static] |