16#if PY_MAJOR_VERSION >= 3
18# define PyInt_FromLong PyLong_FromLong
20# define PyBuffer_Type PyMemoryView_Type
43#if PY_VERSION_HEX < 0x02050000
70#if PY_MAJOR_VERSION >= 3
72 static PyObject* PyBuffer_FromReadWriteMemory(
void* ptr,
int size ) {
73# if PY_VERSION_HEX > 0x03000000
92# if PY_VERSION_HEX < 0x03030000
97 return PyMemoryView_FromBuffer( &bufinfo );
106 return svcloc->
service( name, createif ).
get();
150 const bool retrieve =
true,
const bool disableDoD =
false );
186#if PY_MAJOR_VERSION >= 3
188 ( *(
self->ob_type->tp_as_buffer->bf_getbuffer ) )(
self, &bufinfo, PyBUF_SIMPLE );
191# if PY_VERSION_HEX < 0x02050000
195 Py_ssize_t size = ( *(
self->ob_type->tp_as_buffer->bf_getcharbuffer ) )(
self, 0, &buf );
197 return size /
sizeof( T );
204 static PyObject*
toPython(
int* o ) {
return PyInt_FromLong( (
long)*o ); }
205 static PyObject*
toPython(
short* o ) {
return PyInt_FromLong( (
long)*o ); }
206 static PyObject*
toPython(
char* o ) {
return PyInt_FromLong( (
long)*o ); }
207 static PyObject*
toPython(
long* o ) {
return PyInt_FromLong( *o ); }
208 static PyObject*
toPython(
float* o ) {
return PyFloat_FromDouble( (
double)*o ); }
209 static PyObject*
toPython(
double* o ) {
return PyFloat_FromDouble( *o ); }
213#if PY_VERSION_HEX < 0x02050000
217#if PY_MAJOR_VERSION >= 3
219 ( *(
self->ob_type->tp_as_buffer->bf_getbuffer ) )(
self, &bufinfo, PyBUF_SIMPLE );
222 Py_ssize_t size = ( *(
self->ob_type->tp_as_buffer->bf_getcharbuffer ) )(
self, 0, &buf );
224 if ( idx < 0 || idx >= size /
int(
sizeof( T ) ) ) {
225 PyErr_SetString( PyExc_IndexError,
"buffer index out of range" );
234 static PyTypeObject type = PyBuffer_Type;
235 static PySequenceMethods meth = *( PyBuffer_Type.tp_as_sequence );
236#if PY_VERSION_HEX < 0x02050000
243 type.tp_as_sequence = &meth;
244 PyObject* buf = PyBuffer_FromReadWriteMemory( ptr, size *
sizeof( T ) );
245 buf->ob_type = &type;
246 Py_INCREF( buf->ob_type );
int Py_ssize_t
For compatibility with Python 2.4 and 2.5.
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
virtual SmartIF< IAlgorithm > & algorithm(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
The IAlgorithm is the interface implemented by the Algorithm base class.
Data provider interface definition.
virtual StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
virtual StatusCode unregisterObject(std::string_view fullPath)=0
Unregister object from the data store.
StatusCode registerObject(std::string_view fullPath, DataObject *pObject)
Register object with the data store.
Definition of the IHistogramSvc interface class.
virtual StatusCode findObject(const std::string &fullPath, AIDA::IHistogram1D *&h1dObj)=0
Definition of the basic interface.
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
General service interface definition.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
virtual SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
TYPE * get() const
Get interface pointer.
This class is used for returning status codes from appropriate routines.
GaudiPython.h GaudiPython/GaudiPython.h.
GAUDI_API unsigned long loadDynamicLib(const std::string &name, ImageHandle *handle)
Load dynamic link library.
static IAlgTool * tool(IToolSvc *toolsvc, const std::string &type, const std::string &name, IInterface *p, bool cif)
static PyObject * toArray(T *ptr, Py_ssize_t size)
static StatusCode unregisterObject(IDataProviderSvc *dpsvc, const std::string &path)
static IService * service(ISvcLocator *svcloc, const std::string &name, bool createif=false)
static PyObject * toPython(float *o)
static PyObject * toPython(int *o)
static T * toAddress(std::vector< T > &v)
static PyObject * toDoubleArray(void *ptr, Py_ssize_t size)
static IHistogram1D * histo1D(IHistogramSvc *hsvc, const std::string &path)
static IHistogram2D * histo2D(IHistogramSvc *hsvc, const std::string &path)
static PyObject * toIntArray(void *ptr, Py_ssize_t size)
static PyObject * toPython(char *o)
static StatusCode registerObject(IDataProviderSvc *dpsvc, const std::string &path, DataObject *pObject)
static long loadDynamicLib(const std::string &name)
static Py_ssize_t Array_length(PyObject *self)
static PyObject * toPython(T *)
static IAlgorithm * algorithm(IAlgManager *algmgr, const std::string &name, const bool createIf=false)
static PyObject * toPython(double *o)
static IProfile1D * profile1D(IHistogramSvc *hsvc, const std::string &path)
static IProfile2D * profile2D(IHistogramSvc *hsvc, const std::string &path)
static PyObject * toPython(long *o)
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 T * toAddress(void *a)
static PyObject * toShortArray(void *ptr, Py_ssize_t size)
static PyObject * toPython(short *o)
static IHistogram3D * histo3D(IHistogramSvc *hsvc, const std::string &path)
static PyObject * Array_item(PyObject *self, Py_ssize_t idx)
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 f...
static PyObject * toFloatArray(void *ptr, Py_ssize_t size)
static DataObject * dataobject(IDataProviderSvc *dpsvc, const std::string &path)