GaudiPython::Helper Struct Reference

#include </tmp/marcocle/lhcb-release/1122/GAUDI/GAUDI_v27r0/InstallArea/x86_64-slc6-gcc49-opt/include/GaudiPython/Helpers.h>

Public Member Functions

 Helper ()
 
 Helper ()
 

Static Public Member Functions

static IServiceservice (ISvcLocator *svcloc, const std::string &name, bool createif=false)
 
static IAlgorithmalgorithm (IAlgManager *algmgr, const std::string &name, const bool createIf=false)
 
static DataObjectdataobject (IDataProviderSvc *dpsvc, const std::string &path)
 
static GAUDI_API DataObjectfindobject (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 DataObjectgetobject (IDataProviderSvc *dpsvc, const std::string &path, const bool retrieve=true, const bool disableDoD=false)
 the generic function to get object from TES More...
 
static IAlgTooltool (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 StatusCode setPropertyFromString (Property &p, const std::string &s)
 
static IServiceservice (ISvcLocator *svcloc, const std::string &name, bool createif=false)
 
static IAlgorithmalgorithm (IAlgManager *algmgr, const std::string &name, const bool createIf=false)
 
static DataObjectdataobject (IDataProviderSvc *dpsvc, const std::string &path)
 
static GAUDI_API DataObjectfindobject (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 DataObjectgetobject (IDataProviderSvc *dpsvc, const std::string &path, const bool retrieve=true, const bool disableDoD=false)
 the generic function to get object from TES More...
 
static IAlgTooltool (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 StatusCode setPropertyFromString (Property &p, const std::string &s)
 

Static Private Member Functions

template<class T >
static Py_ssize_t Array_length (PyObject *self)
 
template<class T >
static PyObject * toPython (T *)
 
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)
 
template<class T >
static Py_ssize_t Array_length (PyObject *self)
 
template<class T >
static PyObject * toPython (T *)
 
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)
 

Detailed Description

Definition at line 47 of file Helpers.h.

Constructor & Destructor Documentation

GaudiPython::Helper::Helper ( )
inline

Definition at line 51 of file Helpers.h.

51 {}
GaudiPython::Helper::Helper ( )
inline

Definition at line 51 of file Helpers.h.

51 {}

Member Function Documentation

static IAlgorithm* GaudiPython::Helper::algorithm ( IAlgManager algmgr,
const std::string &  name,
const bool  createIf = false 
)
inlinestatic

Definition at line 58 of file Helpers.h.

61  {
62  return algmgr->algorithm(name, createIf).get();
63  }
virtual SmartIF< IAlgorithm > & algorithm(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
static IAlgorithm* GaudiPython::Helper::algorithm ( IAlgManager algmgr,
const std::string &  name,
const bool  createIf = false 
)
inlinestatic

Definition at line 58 of file Helpers.h.

61  {
62  return algmgr->algorithm(name, createIf).get();
63  }
virtual SmartIF< IAlgorithm > & algorithm(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
template<class T >
static PyObject* GaudiPython::Helper::Array_item ( PyObject *  self,
Py_ssize_t  idx 
)
inlinestaticprivate

Definition at line 162 of file Helpers.h.

162  {
163 #if PY_VERSION_HEX < 0x02050000
164  const
165 #endif
166  char* buf = nullptr;
167  Py_ssize_t size = (*(self->ob_type->tp_as_buffer->bf_getcharbuffer))( self, 0, &buf );
168  if ( idx < 0 || idx >= size/int(sizeof(T)) ) {
169  PyErr_SetString( PyExc_IndexError, "buffer index out of range" );
170  return nullptr;
171  }
172  return toPython((T*)buf + idx);
173  }
static PyObject * toPython(T *)
Definition: Helpers.h:153
int Py_ssize_t
For compatibility with Python 2.4 and 2.5.
Definition: Helpers.h:31
template<class T >
static PyObject* GaudiPython::Helper::Array_item ( PyObject *  self,
Py_ssize_t  idx 
)
inlinestaticprivate

Definition at line 162 of file Helpers.h.

162  {
163 #if PY_VERSION_HEX < 0x02050000
164  const
165 #endif
166  char* buf = nullptr;
167  Py_ssize_t size = (*(self->ob_type->tp_as_buffer->bf_getcharbuffer))( self, 0, &buf );
168  if ( idx < 0 || idx >= size/int(sizeof(T)) ) {
169  PyErr_SetString( PyExc_IndexError, "buffer index out of range" );
170  return nullptr;
171  }
172  return toPython((T*)buf + idx);
173  }
static PyObject * toPython(T *)
Definition: Helpers.h:153
int Py_ssize_t
For compatibility with Python 2.4 and 2.5.
Definition: Helpers.h:31
template<class T >
static Py_ssize_t GaudiPython::Helper::Array_length ( PyObject *  self)
inlinestaticprivate

Definition at line 144 of file Helpers.h.

144  {
145 #if PY_VERSION_HEX < 0x02050000
146  const
147 #endif
148  char* buf = 0;
149  Py_ssize_t size = (*(self->ob_type->tp_as_buffer->bf_getcharbuffer))( self, 0, &buf );
150  return size/sizeof(T);
151  }
int Py_ssize_t
For compatibility with Python 2.4 and 2.5.
Definition: Helpers.h:31
template<class T >
static Py_ssize_t GaudiPython::Helper::Array_length ( PyObject *  self)
inlinestaticprivate

Definition at line 144 of file Helpers.h.

144  {
145 #if PY_VERSION_HEX < 0x02050000
146  const
147 #endif
148  char* buf = 0;
149  Py_ssize_t size = (*(self->ob_type->tp_as_buffer->bf_getcharbuffer))( self, 0, &buf );
150  return size/sizeof(T);
151  }
int Py_ssize_t
For compatibility with Python 2.4 and 2.5.
Definition: Helpers.h:31
static DataObject* GaudiPython::Helper::dataobject ( IDataProviderSvc dpsvc,
const std::string &  path 
)
inlinestatic

Definition at line 65 of file Helpers.h.

67  {
68  DataObject* o;
69  return dpsvc->retrieveObject(path,o).isSuccess() ? o : nullptr;
70  }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
list path
Definition: __init__.py:15
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
static DataObject* GaudiPython::Helper::dataobject ( IDataProviderSvc dpsvc,
const std::string &  path 
)
inlinestatic

Definition at line 65 of file Helpers.h.

67  {
68  DataObject* o;
69  return dpsvc->retrieveObject(path,o).isSuccess() ? o : nullptr;
70  }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
list path
Definition: __init__.py:15
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
static GAUDI_API 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

See also
IDataProviderSvc
IDataProviderSvc::findObject
Parameters
psvc(INPUT) pointer to Data ProviderService
paththe full path in TES
Returns
the object
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-10-09
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

See also
IDataProviderSvc
IDataProviderSvc::findObject
Parameters
psvc(INPUT) pointer to Data ProviderService
paththe full path in TES
Returns
the object
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-10-09

Definition at line 42 of file Helpers.cpp.

44 {
45  DataObject* o = nullptr ;
46  if ( !dpsvc ) { return nullptr ; } // RETURN
47  StatusCode sc = dpsvc -> findObject ( path , o ) ; // NB!
48  return sc.isSuccess() ? o : nullptr ; // RETURN
49 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
list path
Definition: __init__.py:15
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
static GAUDI_API 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

See also
IDataProviderSvc
IDataProviderSvc::findObject
IDataProviderSvc::retriveObject
Parameters
psvc(INPUT) pointer to Data ProviderService
paththe full path in TES
rerieve(INPUT) retrieve or find object ?
disableDoD(INPUT) disable 'on-demand-actions' ?
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-10-09
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

See also
IDataProviderSvc
IDataProviderSvc::findObject
IDataProviderSvc::retriveObject
Parameters
psvc(INPUT) pointer to Data ProviderService
paththe full path in TES
rerieve(INPUT) retrieve or find object ?
disableDoD(INPUT) disable 'on-demand-actions' ?
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-10-09

Definition at line 124 of file Helpers.cpp.

128 {
129  if ( !dpsvc ) { return nullptr ; } // RETURN 0
130  // create the sentry:
131  Disabler sentry ( dpsvc , disable ) ;
132  //
133  DataObject * result = nullptr ;
134  //
135  StatusCode sc =
136  retrieve ?
137  dpsvc -> retrieveObject ( path , result ) :
138  dpsvc -> findObject ( path , result ) ;
139  //
140  return sc.isSuccess() ? result : nullptr ;
141 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
list path
Definition: __init__.py:15
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
static IHistogram1D* GaudiPython::Helper::histo1D ( IHistogramSvc hsvc,
const std::string &  path 
)
inlinestatic

Definition at line 112 of file Helpers.h.

112  {
113  IHistogram1D* h;
114  return ( hsvc->findObject(path, h ).isSuccess() ) ? h : nullptr;
115  }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
list path
Definition: __init__.py:15
virtual StatusCode findObject(const std::string &fullPath, AIDA::IHistogram1D *&h1dObj)=0
static IHistogram1D* GaudiPython::Helper::histo1D ( IHistogramSvc hsvc,
const std::string &  path 
)
inlinestatic

Definition at line 112 of file Helpers.h.

112  {
113  IHistogram1D* h;
114  return ( hsvc->findObject(path, h ).isSuccess() ) ? h : nullptr;
115  }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
list path
Definition: __init__.py:15
virtual StatusCode findObject(const std::string &fullPath, AIDA::IHistogram1D *&h1dObj)=0
static IHistogram2D* GaudiPython::Helper::histo2D ( IHistogramSvc hsvc,
const std::string &  path 
)
inlinestatic

Definition at line 116 of file Helpers.h.

116  {
117  IHistogram2D* h;
118  return ( hsvc->findObject(path, h ).isSuccess() ) ? h : nullptr;
119  }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
list path
Definition: __init__.py:15
virtual StatusCode findObject(const std::string &fullPath, AIDA::IHistogram1D *&h1dObj)=0
static IHistogram2D* GaudiPython::Helper::histo2D ( IHistogramSvc hsvc,
const std::string &  path 
)
inlinestatic

Definition at line 116 of file Helpers.h.

116  {
117  IHistogram2D* h;
118  return ( hsvc->findObject(path, h ).isSuccess() ) ? h : nullptr;
119  }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
list path
Definition: __init__.py:15
virtual StatusCode findObject(const std::string &fullPath, AIDA::IHistogram1D *&h1dObj)=0
static IHistogram3D* GaudiPython::Helper::histo3D ( IHistogramSvc hsvc,
const std::string &  path 
)
inlinestatic

Definition at line 120 of file Helpers.h.

120  {
121  IHistogram3D* h;
122  return ( hsvc->findObject(path, h ).isSuccess() ) ? h : nullptr;
123  }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
list path
Definition: __init__.py:15
virtual StatusCode findObject(const std::string &fullPath, AIDA::IHistogram1D *&h1dObj)=0
static IHistogram3D* GaudiPython::Helper::histo3D ( IHistogramSvc hsvc,
const std::string &  path 
)
inlinestatic

Definition at line 120 of file Helpers.h.

120  {
121  IHistogram3D* h;
122  return ( hsvc->findObject(path, h ).isSuccess() ) ? h : nullptr;
123  }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
list path
Definition: __init__.py:15
virtual StatusCode findObject(const std::string &fullPath, AIDA::IHistogram1D *&h1dObj)=0
static long GaudiPython::Helper::loadDynamicLib ( const std::string &  name)
inlinestatic

Definition at line 108 of file Helpers.h.

108  {
109  void* h;
110  return System::loadDynamicLib(name, &h);
111  }
GAUDI_API unsigned long loadDynamicLib(const std::string &name, ImageHandle *handle)
Load dynamic link library.
Definition: System.cpp:124
static long GaudiPython::Helper::loadDynamicLib ( const std::string &  name)
inlinestatic

Definition at line 108 of file Helpers.h.

108  {
109  void* h;
110  return System::loadDynamicLib(name, &h);
111  }
GAUDI_API unsigned long loadDynamicLib(const std::string &name, ImageHandle *handle)
Load dynamic link library.
Definition: System.cpp:124
static IProfile1D* GaudiPython::Helper::profile1D ( IHistogramSvc hsvc,
const std::string &  path 
)
inlinestatic

Definition at line 126 of file Helpers.h.

128  {
129  IProfile1D* h = 0 ;
130  return ( hsvc && hsvc->findObject ( path , h ).isSuccess() ) ? h : nullptr;
131  }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
list path
Definition: __init__.py:15
virtual StatusCode findObject(const std::string &fullPath, AIDA::IHistogram1D *&h1dObj)=0
static IProfile1D* GaudiPython::Helper::profile1D ( IHistogramSvc hsvc,
const std::string &  path 
)
inlinestatic

Definition at line 126 of file Helpers.h.

128  {
129  IProfile1D* h = 0 ;
130  return ( hsvc && hsvc->findObject ( path , h ).isSuccess() ) ? h : nullptr;
131  }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
list path
Definition: __init__.py:15
virtual StatusCode findObject(const std::string &fullPath, AIDA::IHistogram1D *&h1dObj)=0
static IProfile2D* GaudiPython::Helper::profile2D ( IHistogramSvc hsvc,
const std::string &  path 
)
inlinestatic

Definition at line 134 of file Helpers.h.

136  {
137  IProfile2D* h = 0 ;
138  return ( hsvc && hsvc->findObject ( path , h ).isSuccess() ) ? h : nullptr;
139  }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
list path
Definition: __init__.py:15
virtual StatusCode findObject(const std::string &fullPath, AIDA::IHistogram1D *&h1dObj)=0
static IProfile2D* GaudiPython::Helper::profile2D ( IHistogramSvc hsvc,
const std::string &  path 
)
inlinestatic

Definition at line 134 of file Helpers.h.

136  {
137  IProfile2D* h = 0 ;
138  return ( hsvc && hsvc->findObject ( path , h ).isSuccess() ) ? h : nullptr;
139  }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
list path
Definition: __init__.py:15
virtual StatusCode findObject(const std::string &fullPath, AIDA::IHistogram1D *&h1dObj)=0
static IService* GaudiPython::Helper::service ( ISvcLocator svcloc,
const std::string &  name,
bool  createif = false 
)
inlinestatic

Definition at line 53 of file Helpers.h.

53  {
54  return svcloc->service(name, createif).get();
55  }
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
static IService* GaudiPython::Helper::service ( ISvcLocator svcloc,
const std::string &  name,
bool  createif = false 
)
inlinestatic

Definition at line 53 of file Helpers.h.

53  {
54  return svcloc->service(name, createif).get();
55  }
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
static StatusCode GaudiPython::Helper::setPropertyFromString ( Property p,
const std::string &  s 
)
inlinestatic

Definition at line 208 of file Helpers.h.

208  {
209  return p.fromString(s);
210  }
string s
Definition: gaudirun.py:245
virtual StatusCode fromString(const std::string &value)=0
string -> value
static StatusCode GaudiPython::Helper::setPropertyFromString ( Property p,
const std::string &  s 
)
inlinestatic

Definition at line 208 of file Helpers.h.

208  {
209  return p.fromString(s);
210  }
string s
Definition: gaudirun.py:245
virtual StatusCode fromString(const std::string &value)=0
string -> value
template<class T >
static T* GaudiPython::Helper::toAddress ( std::vector< T > &  v)
inlinestatic

Definition at line 199 of file Helpers.h.

199  {
200  return v.data();
201  }
template<class T >
static T* GaudiPython::Helper::toAddress ( std::vector< T > &  v)
inlinestatic

Definition at line 199 of file Helpers.h.

199  {
200  return v.data();
201  }
template<class T >
static T* GaudiPython::Helper::toAddress ( void *  a)
inlinestatic

Definition at line 203 of file Helpers.h.

203  {
204  return (T*)a;
205  }
template<class T >
static T* GaudiPython::Helper::toAddress ( void *  a)
inlinestatic

Definition at line 203 of file Helpers.h.

203  {
204  return (T*)a;
205  }
template<class T >
static PyObject* GaudiPython::Helper::toArray ( T *  ptr,
Py_ssize_t  size 
)
inlinestatic

Definition at line 177 of file Helpers.h.

177  {
178  static PyTypeObject type = PyBuffer_Type;
179  static PySequenceMethods meth = *(PyBuffer_Type.tp_as_sequence);
180 #if PY_VERSION_HEX < 0x02050000
181  meth.sq_item = (intargfunc) &Array_item<T>;
182  meth.sq_length = (inquiry) &Array_length<T>;
183 #else
184  meth.sq_item = (ssizeargfunc) &Array_item<T>;
185  meth.sq_length = (lenfunc) &Array_length<T>;
186 #endif
187  type.tp_as_sequence = &meth;
188  PyObject* buf = PyBuffer_FromReadWriteMemory( ptr, size*sizeof(T) );
189  buf->ob_type = &type;
190  Py_INCREF( buf->ob_type );
191  return buf;
192  }
string type
Definition: gaudirun.py:151
template<class T >
static PyObject* GaudiPython::Helper::toArray ( T *  ptr,
Py_ssize_t  size 
)
inlinestatic

Definition at line 177 of file Helpers.h.

177  {
178  static PyTypeObject type = PyBuffer_Type;
179  static PySequenceMethods meth = *(PyBuffer_Type.tp_as_sequence);
180 #if PY_VERSION_HEX < 0x02050000
181  meth.sq_item = (intargfunc) &Array_item<T>;
182  meth.sq_length = (inquiry) &Array_length<T>;
183 #else
184  meth.sq_item = (ssizeargfunc) &Array_item<T>;
185  meth.sq_length = (lenfunc) &Array_length<T>;
186 #endif
187  type.tp_as_sequence = &meth;
188  PyObject* buf = PyBuffer_FromReadWriteMemory( ptr, size*sizeof(T) );
189  buf->ob_type = &type;
190  Py_INCREF( buf->ob_type );
191  return buf;
192  }
string type
Definition: gaudirun.py:151
static PyObject* GaudiPython::Helper::toDoubleArray ( void *  ptr,
Py_ssize_t  size 
)
inlinestatic

Definition at line 196 of file Helpers.h.

196 { return toArray( (double*) ptr , size ); }
static PyObject * toArray(T *ptr, Py_ssize_t size)
Definition: Helpers.h:177
static PyObject* GaudiPython::Helper::toDoubleArray ( void *  ptr,
Py_ssize_t  size 
)
inlinestatic

Definition at line 196 of file Helpers.h.

196 { return toArray( (double*) ptr , size ); }
static PyObject * toArray(T *ptr, Py_ssize_t size)
Definition: Helpers.h:177
static PyObject* GaudiPython::Helper::toFloatArray ( void *  ptr,
Py_ssize_t  size 
)
inlinestatic

Definition at line 195 of file Helpers.h.

195 { return toArray( (float*) ptr , size ); }
static PyObject * toArray(T *ptr, Py_ssize_t size)
Definition: Helpers.h:177
static PyObject* GaudiPython::Helper::toFloatArray ( void *  ptr,
Py_ssize_t  size 
)
inlinestatic

Definition at line 195 of file Helpers.h.

195 { return toArray( (float*) ptr , size ); }
static PyObject * toArray(T *ptr, Py_ssize_t size)
Definition: Helpers.h:177
static PyObject* GaudiPython::Helper::toIntArray ( void *  ptr,
Py_ssize_t  size 
)
inlinestatic

Definition at line 193 of file Helpers.h.

193 { return toArray( (int*) ptr , size ); }
static PyObject * toArray(T *ptr, Py_ssize_t size)
Definition: Helpers.h:177
static PyObject* GaudiPython::Helper::toIntArray ( void *  ptr,
Py_ssize_t  size 
)
inlinestatic

Definition at line 193 of file Helpers.h.

193 { return toArray( (int*) ptr , size ); }
static PyObject * toArray(T *ptr, Py_ssize_t size)
Definition: Helpers.h:177
static IAlgTool* GaudiPython::Helper::tool ( IToolSvc toolsvc,
const std::string &  type,
const std::string &  name,
IInterface p,
bool  cif 
)
inlinestatic

Definition at line 103 of file Helpers.h.

103  {
104  IAlgTool* o;
105  return toolsvc->retrieve(type, name, IAlgTool::interfaceID(), o, p, cif).isSuccess() ?
106  o : nullptr ;
107  }
virtual StatusCode retrieve(const std::string &type, const InterfaceID &iid, IAlgTool *&tool, const IInterface *parent=0, bool createIf=true)=0
Retrieve tool with tool dependent part of the name automatically assigned.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:23
string type
Definition: gaudirun.py:151
static IAlgTool* GaudiPython::Helper::tool ( IToolSvc toolsvc,
const std::string &  type,
const std::string &  name,
IInterface p,
bool  cif 
)
inlinestatic

Definition at line 103 of file Helpers.h.

103  {
104  IAlgTool* o;
105  return toolsvc->retrieve(type, name, IAlgTool::interfaceID(), o, p, cif).isSuccess() ?
106  o : nullptr ;
107  }
virtual StatusCode retrieve(const std::string &type, const InterfaceID &iid, IAlgTool *&tool, const IInterface *parent=0, bool createIf=true)=0
Retrieve tool with tool dependent part of the name automatically assigned.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:23
string type
Definition: gaudirun.py:151
template<class T >
static PyObject* GaudiPython::Helper::toPython ( T *  )
inlinestaticprivate

Definition at line 153 of file Helpers.h.

153 { return 0; }
template<class T >
static PyObject* GaudiPython::Helper::toPython ( T *  )
inlinestaticprivate

Definition at line 153 of file Helpers.h.

153 { return 0; }
static PyObject* GaudiPython::Helper::toPython ( int *  o)
inlinestaticprivate

Definition at line 154 of file Helpers.h.

154 { return PyInt_FromLong((long)*o); }
static PyObject* GaudiPython::Helper::toPython ( int *  o)
inlinestaticprivate

Definition at line 154 of file Helpers.h.

154 { return PyInt_FromLong((long)*o); }
static PyObject* GaudiPython::Helper::toPython ( short *  o)
inlinestaticprivate

Definition at line 155 of file Helpers.h.

155 { return PyInt_FromLong((long)*o); }
static PyObject* GaudiPython::Helper::toPython ( short *  o)
inlinestaticprivate

Definition at line 155 of file Helpers.h.

155 { return PyInt_FromLong((long)*o); }
static PyObject* GaudiPython::Helper::toPython ( char *  o)
inlinestaticprivate

Definition at line 156 of file Helpers.h.

156 { return PyInt_FromLong((long)*o); }
static PyObject* GaudiPython::Helper::toPython ( char *  o)
inlinestaticprivate

Definition at line 156 of file Helpers.h.

156 { return PyInt_FromLong((long)*o); }
static PyObject* GaudiPython::Helper::toPython ( long *  o)
inlinestaticprivate

Definition at line 157 of file Helpers.h.

157 { return PyInt_FromLong(*o); }
static PyObject* GaudiPython::Helper::toPython ( long *  o)
inlinestaticprivate

Definition at line 157 of file Helpers.h.

157 { return PyInt_FromLong(*o); }
static PyObject* GaudiPython::Helper::toPython ( float *  o)
inlinestaticprivate

Definition at line 158 of file Helpers.h.

158 { return PyFloat_FromDouble((double)*o); }
static PyObject* GaudiPython::Helper::toPython ( float *  o)
inlinestaticprivate

Definition at line 158 of file Helpers.h.

158 { return PyFloat_FromDouble((double)*o); }
static PyObject* GaudiPython::Helper::toPython ( double *  o)
inlinestaticprivate

Definition at line 159 of file Helpers.h.

159 { return PyFloat_FromDouble(*o); }
static PyObject* GaudiPython::Helper::toPython ( double *  o)
inlinestaticprivate

Definition at line 159 of file Helpers.h.

159 { return PyFloat_FromDouble(*o); }
static PyObject* GaudiPython::Helper::toShortArray ( void *  ptr,
Py_ssize_t  size 
)
inlinestatic

Definition at line 194 of file Helpers.h.

194 { return toArray( (short*) ptr , size ); }
static PyObject * toArray(T *ptr, Py_ssize_t size)
Definition: Helpers.h:177
static PyObject* GaudiPython::Helper::toShortArray ( void *  ptr,
Py_ssize_t  size 
)
inlinestatic

Definition at line 194 of file Helpers.h.

194 { return toArray( (short*) ptr , size ); }
static PyObject * toArray(T *ptr, Py_ssize_t size)
Definition: Helpers.h:177

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