The Gaudi Framework  v37r1 (a7f61348)
GaudiPython::PyAlg< ALGORITHM > Class Template Reference

#include </builds/gaudi/Gaudi/GaudiAlg/include/GaudiPython/PyAlg.h>

Inheritance diagram for GaudiPython::PyAlg< ALGORITHM >:
Collaboration diagram for GaudiPython::PyAlg< ALGORITHM >:

Public Member Functions

 PyAlg (PyObject *self, const std::string &name)
 constructor from Python object and the name More...
 
PyObject * _obj () const
 get the object More...
 
StatusCode initialize () override
 
StatusCode start () override
 
StatusCode execute () override
 
StatusCode stop () override
 
StatusCode finalize () override
 
virtual IAlgorithm * ialgorithm ()
 
virtual IProperty * iproperty ()
 
virtual StatusCode initialize_ ()
 
virtual StatusCode finalize_ ()
 

Private Member Functions

 PyAlg ()=delete
 the default constructor is disabled More...
 
 PyAlg (const PyAlg &)=delete
 the copy constructor is disabled More...
 
PyAlg & operator= (const PyAlg &)=delete
 the assignment operator is disabled More...
 

Private Attributes

PyObject * m_self
 "shadow" python class More...
 

Detailed Description

template<class ALGORITHM>
class GaudiPython::PyAlg< ALGORITHM >

general class to embed the existing algorithm/base class into the python

Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
Date
2005-08-03

Definition at line 25 of file PyAlg.h.

Constructor & Destructor Documentation

◆ PyAlg() [1/3]

template<class ALGORITHM >
GaudiPython::PyAlg< ALGORITHM >::PyAlg ( PyObject *  self,
const std::string &  name 
)
inline

constructor from Python object and the name

Parameters
selfpython object
namename of algorithm instance

Definition at line 33 of file PyAlg.h.

33  : ALGORITHM( name, Gaudi::svcLocator() ), m_self( self ) {
34  // the printout of actual type for embedded algorithm has no sense
35  this->setProperty( "TypePrint", false );
36  // The owner of the Algorithm is Python (as creator) therefore
37  // it should not be deleted by Gaudi (added an extra addRef()).
38  this->addRef();
39  this->addRef();
40  this->setType( System::typeinfoName( typeid( PyAlg ) ) );
41  }

◆ PyAlg() [2/3]

template<class ALGORITHM >
GaudiPython::PyAlg< ALGORITHM >::PyAlg ( )
privatedelete

the default constructor is disabled

◆ PyAlg() [3/3]

template<class ALGORITHM >
GaudiPython::PyAlg< ALGORITHM >::PyAlg ( const PyAlg< ALGORITHM > &  )
privatedelete

the copy constructor is disabled

Member Function Documentation

◆ _obj()

template<class ALGORITHM >
PyObject* GaudiPython::PyAlg< ALGORITHM >::_obj ( ) const
inline

get the object

Definition at line 43 of file PyAlg.h.

43 { return m_self; } // get the object

◆ execute()

template<class ALGORITHM >
StatusCode GaudiPython::PyAlg< ALGORITHM >::execute ( )
inlineoverride

Definition at line 49 of file PyAlg.h.

49 { return GaudiPython::call_python_method( m_self, "execute" ); }

◆ finalize()

template<class ALGORITHM >
StatusCode GaudiPython::PyAlg< ALGORITHM >::finalize ( )
inlineoverride

Definition at line 51 of file PyAlg.h.

51 { return GaudiPython::call_python_method( m_self, "finalize" ); }

◆ finalize_()

template<class ALGORITHM >
virtual StatusCode GaudiPython::PyAlg< ALGORITHM >::finalize_ ( )
inlinevirtual

Definition at line 58 of file PyAlg.h.

58 { return ALGORITHM::finalize(); }

◆ ialgorithm()

template<class ALGORITHM >
virtual IAlgorithm* GaudiPython::PyAlg< ALGORITHM >::ialgorithm ( )
inlinevirtual

Definition at line 53 of file PyAlg.h.

53 { return this; }

◆ initialize()

template<class ALGORITHM >
StatusCode GaudiPython::PyAlg< ALGORITHM >::initialize ( )
inlineoverride

Definition at line 47 of file PyAlg.h.

47 { return GaudiPython::call_python_method( m_self, "initialize" ); }

◆ initialize_()

template<class ALGORITHM >
virtual StatusCode GaudiPython::PyAlg< ALGORITHM >::initialize_ ( )
inlinevirtual

Definition at line 57 of file PyAlg.h.

57 { return ALGORITHM::initialize(); }

◆ iproperty()

template<class ALGORITHM >
virtual IProperty* GaudiPython::PyAlg< ALGORITHM >::iproperty ( )
inlinevirtual

Definition at line 54 of file PyAlg.h.

54 { return this; }

◆ operator=()

template<class ALGORITHM >
PyAlg& GaudiPython::PyAlg< ALGORITHM >::operator= ( const PyAlg< ALGORITHM > &  )
privatedelete

the assignment operator is disabled

◆ start()

template<class ALGORITHM >
StatusCode GaudiPython::PyAlg< ALGORITHM >::start ( )
inlineoverride

Definition at line 48 of file PyAlg.h.

48 { return GaudiPython::call_python_method( m_self, "start" ); }

◆ stop()

template<class ALGORITHM >
StatusCode GaudiPython::PyAlg< ALGORITHM >::stop ( )
inlineoverride

Definition at line 50 of file PyAlg.h.

50 { return GaudiPython::call_python_method( m_self, "stop" ); }

Member Data Documentation

◆ m_self

template<class ALGORITHM >
PyObject* GaudiPython::PyAlg< ALGORITHM >::m_self
private

"shadow" python class

Definition at line 72 of file PyAlg.h.


The documentation for this class was generated from the following file:
setProperty
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
Definition: Bootstrap.cpp:244
bug_34121.name
name
Definition: bug_34121.py:20
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:313
GaudiPython::PyAlg::m_self
PyObject * m_self
"shadow" python class
Definition: PyAlg.h:72
Gaudi::svcLocator
GAUDI_API ISvcLocator * svcLocator()
GaudiPython::PyAlg::PyAlg
PyAlg()=delete
the default constructor is disabled
GaudiPython::call_python_method
GAUDI_API StatusCode call_python_method(PyObject *self, const char *method)
call the python method
Definition: Algorithm.cpp:48