The Gaudi Framework  v33r1 (b1225454)
GaudiPython::PyAlg< ALGORITHM > Class Template Reference

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

#include <GaudiPython/Algorithm.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...
 
StatusCode initialize () override
 
StatusCode start () override
 
StatusCode execute () override
 
StatusCode stop () override
 
StatusCode finalize () override
 
virtual IAlgorithmialgorithm ()
 
virtual IPropertyiproperty ()
 
virtual StatusCode initialize_ ()
 
virtual StatusCode finalize_ ()
 

Protected Member Functions

PyObject * _obj () const
 get the object More...
 

Private Member Functions

 PyAlg ()=delete
 the default constructor is disabled More...
 
 PyAlg (const PyAlg &)=delete
 the copy constructor is disabled More...
 
PyAlgoperator= (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 67 of file Algorithm.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 75 of file Algorithm.h.

75  : ALGORITHM( name, Gaudi::svcLocator() ), m_self( self ) {
76  // the printout of actual type for embedded algorithm has no sense
77  this->setProperty( "TypePrint", "false" );
78  this->setProperty( "StatPrint", "true" );
79  // The owner of the Algorithm is Python (as creator) therefore
80  // it should not be deleted by Gaudi (added an extra addRef()).
81  this->addRef();
82  this->addRef();
83  }
PyObject * m_self
"shadow" python class
Definition: Algorithm.h:117
GAUDI_API ISvcLocator * svcLocator()
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
Definition: Bootstrap.cpp:243

◆ 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
inlineprotected

get the object

Definition at line 88 of file Algorithm.h.

88 { return m_self; } // get the object
PyObject * m_self
"shadow" python class
Definition: Algorithm.h:117

◆ execute()

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

Definition at line 94 of file Algorithm.h.

94 { return GaudiPython::call_python_method( m_self, "execute" ); }
PyObject * m_self
"shadow" python class
Definition: Algorithm.h:117
GAUDI_API StatusCode call_python_method(PyObject *self, const char *method)
call the python method
Definition: Algorithm.cpp:48

◆ finalize()

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

Definition at line 96 of file Algorithm.h.

96 { return GaudiPython::call_python_method( m_self, "finalize" ); }
PyObject * m_self
"shadow" python class
Definition: Algorithm.h:117
GAUDI_API StatusCode call_python_method(PyObject *self, const char *method)
call the python method
Definition: Algorithm.cpp:48

◆ finalize_()

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

Definition at line 103 of file Algorithm.h.

103 { return ALGORITHM::finalize(); }

◆ ialgorithm()

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

Definition at line 98 of file Algorithm.h.

98 { return this; }

◆ initialize()

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

Definition at line 92 of file Algorithm.h.

92 { return GaudiPython::call_python_method( m_self, "initialize" ); }
PyObject * m_self
"shadow" python class
Definition: Algorithm.h:117
GAUDI_API StatusCode call_python_method(PyObject *self, const char *method)
call the python method
Definition: Algorithm.cpp:48

◆ initialize_()

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

Definition at line 102 of file Algorithm.h.

102 { return ALGORITHM::initialize(); }

◆ iproperty()

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

Definition at line 99 of file Algorithm.h.

99 { 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 93 of file Algorithm.h.

93 { return GaudiPython::call_python_method( m_self, "start" ); }
PyObject * m_self
"shadow" python class
Definition: Algorithm.h:117
GAUDI_API StatusCode call_python_method(PyObject *self, const char *method)
call the python method
Definition: Algorithm.cpp:48

◆ stop()

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

Definition at line 95 of file Algorithm.h.

95 { return GaudiPython::call_python_method( m_self, "stop" ); }
PyObject * m_self
"shadow" python class
Definition: Algorithm.h:117
GAUDI_API StatusCode call_python_method(PyObject *self, const char *method)
call the python method
Definition: Algorithm.cpp:48

Member Data Documentation

◆ m_self

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

"shadow" python class

Definition at line 117 of file Algorithm.h.


The documentation for this class was generated from the following file: