|
ATLAS Offline Software
|
Go to the documentation of this file.
27 #include "GaudiKernel/System.h"
28 #include "GaudiKernel/INamedInterface.h"
29 #include "GaudiKernel/ServiceHandle.h"
42 ::Auditor(
name, svcLocator ),
62 return PyAthena::callPyMethod(
m_self,
"sysInitialize" );
69 (
"PyAthena::PyComponentMgr/PyComponentMgr",
name() );
70 if ( !pyMgr.retrieve().isSuccess() ) {
71 return StatusCode::FAILURE;
75 m_self = pyMgr->pyObject(
this );
78 return StatusCode::FAILURE;
82 return ::Auditor::sysInitialize();
88 return PyAthena::callPyMethod(
m_self,
"sysFinalize" );
177 py_after (IAuditor::ReInitialize,
comp->name(), StatusCode::SUCCESS);
201 py_after (IAuditor::Finalize,
comp->name(), StatusCode::SUCCESS);
208 const char* evtname = 0;
210 case Initialize: evtname =
"initialize";
break;
211 case ReInitialize: evtname =
"reinitialize";
break;
212 case Execute: evtname =
"execute";
break;
213 case Finalize: evtname =
"finalize";
break;
214 case Start: evtname =
"start";
break;
215 case Stop: evtname =
"stop";
break;
216 case ReStart: evtname =
"restart";
break;
218 return PyAthena::pyAudit (
m_self,
"before", evtname, component.c_str());
224 return PyAthena::pyAudit (
m_self,
"before",
evt.c_str(), component.c_str());
229 const std::string& component,
232 const char* evtname = 0;
234 case Initialize: evtname =
"initialize";
break;
235 case ReInitialize: evtname =
"reinitialize";
break;
236 case Execute: evtname =
"execute";
break;
237 case Finalize: evtname =
"finalize";
break;
238 case Start: evtname =
"start";
break;
239 case Stop: evtname =
"stop";
break;
240 case ReStart: evtname =
"restart";
break;
242 return PyAthena::pyAudit (
m_self,
"after", evtname, component.c_str(),
sc);
247 const std::string& component,
250 return PyAthena::pyAudit (
m_self,
251 "after",
evt.c_str(), component.c_str(),
sc);
264 PyObject* pyobj = TPython::CPPInstance_FromVoidPtr
269 pyobj = TPython::CPPInstance_FromVoidPtr ((
void*)
this,
"PyAthena::Aud");
272 <<
"could not dyncast component [" <<
name() <<
"] to a python "
273 <<
"object of type [" << this->
typeName() <<
"] (probably a missing "
274 <<
"dictionary)" <<
endmsg
275 <<
"fallback to [PyAthena::Aud]..."
281 msg << MSG::WARNING <<
"Could not dyncast component ["
282 <<
name() <<
"] to a pyobject of type ["
286 if ( -1 == PyObject_SetAttrString(o,
"_cppHandle", pyobj) ) {
290 <<
"Could not attach C++ handle [" <<
name() <<
"] to its python "
293 if ( -1 == PyObject_SetAttrString(o,
"_cppHandle", Py_None) ) {
296 <<
"could not attach a dummy C++ handle [" <<
name() <<
"] to its "
virtual StatusCode initialize() override
Gaudi Aud Implementation.
virtual void py_before(IAuditor::StandardEventType, const std::string &)
Audit the start of a standard "event".
virtual void py_after(IAuditor::StandardEventType, const std::string &, const StatusCode &)
Audit the end of a standard "event".
virtual StatusCode finalize() override
virtual bool setPyAttr(PyObject *pyobj) override
attach the C++ component to its python cousin
virtual ~Aud()
Destructor:
virtual void after(StandardEventType, INamedInterface *, const StatusCode &) override
Aud()
Default constructor:
std::string typeinfoName(const std::type_info &ti)
Convert a type_info to a demangled string.
virtual void beforeFinalize(INamedInterface *) override
msgSvc
Provide convenience handles for various services.
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual void beforeReinitialize(INamedInterface *) override
virtual const char * typeName() const override
return the std::type_info name of the underlying py-component This is used by concrete implementation...
virtual void afterReinitialize(INamedInterface *) override
virtual StatusCode sysInitialize() override
virtual void beforeExecute(INamedInterface *) override
virtual void beforeInitialize(INamedInterface *) override
PyObject * m_self
Pointer to self (from the python world)
virtual void afterFinalize(INamedInterface *) override
virtual void before(StandardEventType, INamedInterface *) override
Auditor interface
virtual void afterInitialize(INamedInterface *) override
virtual void afterExecute(INamedInterface *, const StatusCode &) override