|
Gaudi Framework, version v21r6 |
| Home | Generated: 11 Nov 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 GAUDI_API DataObject * | findobject (IDataProviderSvc *dpsvc, const std::string &path) |
| simple wrapper for IDataProviderSvc::findObject The methdod does NOT trigger the loading the object from tape or Data-On-Demand action | |
| static GAUDI_API DataObject * | getobject (IDataProviderSvc *dpsvc, const std::string &path, const bool retrieve=true, const bool disableDoD=false) |
| the generic function to get object from TES | |
| 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 55 of file Helpers.h.
00057 { 00058 DataObject* o; 00059 if ( dpsvc->retrieveObject(path,o).isSuccess() ) return o; 00060 else return 0; 00061 }
| DataObject * GaudiPython::Helper::findobject | ( | IDataProviderSvc * | dpsvc, | |
| const std::string & | path | |||
| ) | [static] |
simple wrapper for IDataProviderSvc::findObject The methdod does NOT trigger the loading the object from tape or Data-On-Demand action
| psvc | (INPUT) pointer to Data ProviderService | |
| path | the full path in TES |
Definition at line 41 of file Helpers.cpp.
00043 { 00044 DataObject* o = 0 ; 00045 if ( 0 == dpsvc ) { return 0 ; } // RETURN 00046 StatusCode sc = dpsvc -> findObject ( path , o ) ; // NB! 00047 if ( sc.isFailure() ) { return 0 ; } // RETURN 00048 return o ; // RETURN 00049 }
| DataObject * GaudiPython::Helper::getobject | ( | IDataProviderSvc * | dpsvc, | |
| const std::string & | path, | |||
| const bool | retrieve = true, |
|||
| const bool | disableDoD = false | |||
| ) | [static] |
the generic function to get object from TES
IDataProviderSvc::retriveObject
| psvc | (INPUT) pointer to Data ProviderService | |
| path | the full path in TES | |
| rerieve | (INPUT) retrieve or find object ? | |
| disableDoD | (INPUT) disable 'on-demand-actions' ? |
Definition at line 133 of file Helpers.cpp.
00137 { 00138 if ( 0 == dpsvc ) { return 0 ; } // RETURN 0 00139 // create the sentry: 00140 Disabler sentry ( dpsvc , disable ) ; 00141 // 00142 DataObject * result = 0 ; 00143 // 00144 StatusCode sc = 00145 retrieve ? 00146 dpsvc -> retrieveObject ( path , result ) : 00147 dpsvc -> findObject ( path , result ) ; 00148 // 00149 if ( sc.isFailure() ) { return 0 ; } // RETURN 00150 // 00151 return result ; // RETURN 00152 }
| 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 99 of file Helpers.h.
00099 { 00100 void* h; 00101 return System::loadDynamicLib(name, &h); 00102 }
| static IHistogram1D* GaudiPython::Helper::histo1D | ( | IHistogramSvc * | hsvc, | |
| const std::string & | path | |||
| ) | [inline, static] |
Definition at line 103 of file Helpers.h.
00103 { 00104 IHistogram1D* h; 00105 if ( hsvc->findObject(path, h ).isSuccess() ) return h; 00106 else return 0; 00107 }
| static IHistogram2D* GaudiPython::Helper::histo2D | ( | IHistogramSvc * | hsvc, | |
| const std::string & | path | |||
| ) | [inline, static] |
Definition at line 108 of file Helpers.h.
00108 { 00109 IHistogram2D* h; 00110 if ( hsvc->findObject(path, h ).isSuccess() ) return h; 00111 else return 0; 00112 }
| static IHistogram3D* GaudiPython::Helper::histo3D | ( | IHistogramSvc * | hsvc, | |
| const std::string & | path | |||
| ) | [inline, static] |
Definition at line 113 of file Helpers.h.
00113 { 00114 IHistogram3D* h; 00115 if ( hsvc->findObject(path, h ).isSuccess() ) return h; 00116 else return 0; 00117 }
| static IProfile1D* GaudiPython::Helper::profile1D | ( | IHistogramSvc * | hsvc, | |
| const std::string & | path | |||
| ) | [inline, static] |
Definition at line 120 of file Helpers.h.
00122 { 00123 IProfile1D* h = 0 ; 00124 if ( 0 != hsvc && hsvc->findObject ( path , h ).isSuccess() ) { return h ; } 00125 return 0 ; 00126 }
| static IProfile2D* GaudiPython::Helper::profile2D | ( | IHistogramSvc * | hsvc, | |
| const std::string & | path | |||
| ) | [inline, static] |
Definition at line 129 of file Helpers.h.
00131 { 00132 IProfile2D* h = 0 ; 00133 if ( 0 != hsvc && hsvc->findObject ( path , h ).isSuccess() ) { return h ; } 00134 return 0 ; 00135 }
| static Py_ssize_t GaudiPython::Helper::Array_length | ( | PyObject * | self | ) | [inline, static, private] |
Definition at line 139 of file Helpers.h.
00139 { 00140 #if PY_VERSION_HEX < 0x02050000 00141 const 00142 #endif 00143 char* buf = 0; 00144 Py_ssize_t size = (*(self->ob_type->tp_as_buffer->bf_getcharbuffer))( self, 0, &buf ); 00145 return size/sizeof(T); 00146 }
| 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 157 of file Helpers.h.
00157 { 00158 #if PY_VERSION_HEX < 0x02050000 00159 const 00160 #endif 00161 char* buf = 0; 00162 Py_ssize_t size = (*(self->ob_type->tp_as_buffer->bf_getcharbuffer))( self, 0, &buf ); 00163 if ( idx < 0 || idx >= size/int(sizeof(T)) ) { 00164 PyErr_SetString( PyExc_IndexError, "buffer index out of range" ); 00165 return 0; 00166 } 00167 return toPython((T*)buf + idx); 00168 }
| static PyObject* GaudiPython::Helper::toArray | ( | T * | ptr, | |
| Py_ssize_t | size | |||
| ) | [inline, static] |
Definition at line 172 of file Helpers.h.
00172 { 00173 static PyTypeObject type = PyBuffer_Type; 00174 static PySequenceMethods meth = *(PyBuffer_Type.tp_as_sequence); 00175 #if PY_VERSION_HEX < 0x02050000 00176 meth.sq_item = (intargfunc) &Array_item<T>; 00177 meth.sq_length = (inquiry) &Array_length<T>; 00178 #else 00179 meth.sq_item = (ssizeargfunc) &Array_item<T>; 00180 meth.sq_length = (lenfunc) &Array_length<T>; 00181 #endif 00182 type.tp_as_sequence = &meth; 00183 PyObject* buf = PyBuffer_FromReadWriteMemory( ptr, size*sizeof(T) ); 00184 Py_INCREF( &type ); 00185 buf->ob_type = &type; 00186 return buf; 00187 }
| 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] |