#include </builds/gaudi/Gaudi/GaudiPython/include/GaudiPython/Helpers.h>
|
static IService * | service (ISvcLocator *svcloc, const std::string &name, bool createif=false) |
|
static IAlgorithm * | algorithm (IAlgManager *algmgr, const std::string &name, const bool createIf=false) |
|
static DataObject * | dataobject (IDataProviderSvc *dpsvc, const std::string &path) |
|
static StatusCode | registerObject (IDataProviderSvc *dpsvc, const std::string &path, DataObject *pObject) |
|
static StatusCode | unregisterObject (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 More...
|
|
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 More...
|
|
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) |
|
Definition at line 69 of file Helpers.h.
◆ Helper()
GaudiPython::Helper::Helper |
( |
| ) |
|
|
inline |
◆ algorithm()
◆ Array_item()
template<class T >
static PyObject* GaudiPython::Helper::Array_item |
( |
PyObject * |
self, |
|
|
Py_ssize_t |
idx |
|
) |
| |
|
inlinestaticprivate |
Definition at line 213 of file Helpers.h.
214 #if PY_VERSION_HEX < 0x02050000
218 #if PY_MAJOR_VERSION >= 3
220 ( *(
self->ob_type->tp_as_buffer->bf_getbuffer ) )(
self, &bufinfo, PyBUF_SIMPLE );
223 Py_ssize_t size = ( *(
self->ob_type->tp_as_buffer->bf_getcharbuffer ) )(
self, 0, &buf );
225 if ( idx < 0 || idx >=
size /
int(
sizeof( T ) ) ) {
226 PyErr_SetString( PyExc_IndexError,
"buffer index out of range" );
◆ Array_length()
template<class T >
static Py_ssize_t GaudiPython::Helper::Array_length |
( |
PyObject * |
self | ) |
|
|
inlinestaticprivate |
Definition at line 186 of file Helpers.h.
187 #if PY_MAJOR_VERSION >= 3
189 ( *(
self->ob_type->tp_as_buffer->bf_getbuffer ) )(
self, &bufinfo, PyBUF_SIMPLE );
192 # if PY_VERSION_HEX < 0x02050000
196 Py_ssize_t size = ( *(
self->ob_type->tp_as_buffer->bf_getcharbuffer ) )(
self, 0, &buf );
198 return size /
sizeof( T );
◆ dataobject()
◆ findobject()
◆ getobject()
◆ histo1D()
◆ histo2D()
◆ histo3D()
◆ loadDynamicLib()
static long GaudiPython::Helper::loadDynamicLib |
( |
const std::string & |
name | ) |
|
|
inlinestatic |
◆ profile1D()
◆ profile2D()
◆ registerObject()
◆ service()
◆ toAddress() [1/2]
template<class T >
static T* GaudiPython::Helper::toAddress |
( |
std::vector< T > & |
v | ) |
|
|
inlinestatic |
◆ toAddress() [2/2]
template<class T >
static T* GaudiPython::Helper::toAddress |
( |
void * |
a | ) |
|
|
inlinestatic |
◆ toArray()
template<class T >
template PyObject * GaudiPython::Helper::toArray |
( |
T * |
ptr, |
|
|
Py_ssize_t |
size |
|
) |
| |
|
inlinestatic |
Definition at line 234 of file Helpers.h.
235 static PyTypeObject
type = PyBuffer_Type;
236 static PySequenceMethods meth = *( PyBuffer_Type.tp_as_sequence );
237 #if PY_VERSION_HEX < 0x02050000
238 meth.sq_item = (intargfunc)&Array_item<T>;
239 meth.sq_length = (inquiry)&Array_length<T>;
241 meth.sq_item = (ssizeargfunc)&Array_item<T>;
242 meth.sq_length = (lenfunc)&Array_length<T>;
244 type.tp_as_sequence = &meth;
245 PyObject* buf = PyBuffer_FromReadWriteMemory( ptr,
size *
sizeof( T ) );
246 buf->ob_type = &
type;
247 Py_INCREF( buf->ob_type );
◆ toDoubleArray()
static PyObject* GaudiPython::Helper::toDoubleArray |
( |
void * |
ptr, |
|
|
Py_ssize_t |
size |
|
) |
| |
|
inlinestatic |
◆ toFloatArray()
static PyObject* GaudiPython::Helper::toFloatArray |
( |
void * |
ptr, |
|
|
Py_ssize_t |
size |
|
) |
| |
|
inlinestatic |
◆ toIntArray()
static PyObject* GaudiPython::Helper::toIntArray |
( |
void * |
ptr, |
|
|
Py_ssize_t |
size |
|
) |
| |
|
inlinestatic |
◆ tool()
◆ toPython() [1/7]
static PyObject* GaudiPython::Helper::toPython |
( |
char * |
o | ) |
|
|
inlinestaticprivate |
Definition at line 207 of file Helpers.h.
207 {
return PyInt_FromLong( (
long)*o ); }
◆ toPython() [2/7]
static PyObject* GaudiPython::Helper::toPython |
( |
double * |
o | ) |
|
|
inlinestaticprivate |
Definition at line 210 of file Helpers.h.
210 {
return PyFloat_FromDouble( *o ); }
◆ toPython() [3/7]
static PyObject* GaudiPython::Helper::toPython |
( |
float * |
o | ) |
|
|
inlinestaticprivate |
Definition at line 209 of file Helpers.h.
209 {
return PyFloat_FromDouble( (
double)*o ); }
◆ toPython() [4/7]
static PyObject* GaudiPython::Helper::toPython |
( |
int * |
o | ) |
|
|
inlinestaticprivate |
Definition at line 205 of file Helpers.h.
205 {
return PyInt_FromLong( (
long)*o ); }
◆ toPython() [5/7]
static PyObject* GaudiPython::Helper::toPython |
( |
long * |
o | ) |
|
|
inlinestaticprivate |
Definition at line 208 of file Helpers.h.
208 {
return PyInt_FromLong( *o ); }
◆ toPython() [6/7]
static PyObject* GaudiPython::Helper::toPython |
( |
short * |
o | ) |
|
|
inlinestaticprivate |
Definition at line 206 of file Helpers.h.
206 {
return PyInt_FromLong( (
long)*o ); }
◆ toPython() [7/7]
template<class T >
static PyObject* GaudiPython::Helper::toPython |
( |
T * |
| ) |
|
|
inlinestaticprivate |
◆ toShortArray()
static PyObject* GaudiPython::Helper::toShortArray |
( |
void * |
ptr, |
|
|
Py_ssize_t |
size |
|
) |
| |
|
inlinestatic |
◆ unregisterObject()
The documentation for this struct was generated from the following files:
GAUDI_API unsigned long loadDynamicLib(const std::string &name, ImageHandle *handle)
Load dynamic link library.
virtual StatusCode unregisterObject(std::string_view fullPath)=0
Unregister object from the data store.
int Py_ssize_t
For compatibility with Python 2.4 and 2.5.
constexpr auto size(const T &, Args &&...) noexcept
virtual StatusCode findObject(const std::string &fullPath, AIDA::IHistogram1D *&h1dObj)=0
static PyObject * toPython(T *)
static PyObject * toArray(T *ptr, Py_ssize_t size)
StatusCode registerObject(std::string_view fullPath, DataObject *pObject)
Register object with the data store.
virtual SmartIF< IAlgorithm > & algorithm(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
virtual StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
TYPE * get() const
Get interface pointer.
virtual StatusCode findObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Find object identified by its directory entry.