4 #include "GaudiKernel/IAlgManager.h"
5 #include "GaudiKernel/IDataManagerSvc.h"
6 #include "GaudiKernel/IDataStoreAgent.h"
28 declareProperty(
"OutputStreams", m_outputStreamNames,
29 "OutputStream instances that can be called.");
40 template <Gaudi::StateMachine::Transition TR>
41 class OutStreamTransition {
49 void operator() (ItemType &
item);
58 void OutStreamTransition<Gaudi::StateMachine::INITIALIZE>::operator() (ItemType &
item) {
66 void OutStreamTransition<Gaudi::StateMachine::START>::operator() (ItemType &item) {
74 void OutStreamTransition<Gaudi::StateMachine::STOP>::operator() (ItemType &item) {
82 void OutStreamTransition<Gaudi::StateMachine::FINALIZE>::operator() (ItemType &item) {
83 const StatusCode sc = item.second->sysFinalize();
92 template <Gaudi::StateMachine::Transition TR>
94 OutStreamTransition<TR> trans(
msg());
96 return trans.result();
108 m_algMgr = service(
"ApplicationMgr");
117 return i_outStreamTransition<Gaudi::StateMachine::INITIALIZE>();
126 return i_outStreamTransition<Gaudi::StateMachine::START>();
134 std::list<std::string> names;
137 names.push_back(pRegistry->
name());
149 OutputStreamsCollector collector;
152 std::for_each(collector.names.begin(), collector.names.end(),
164 StatusCode sc = i_outStreamTransition<Gaudi::StateMachine::FINALIZE>();
179 StatusCode sc = i_outStreamTransition<Gaudi::StateMachine::STOP>();
189 const std::string algId =
"/" + outStream.
name();
197 warning() <<
"OutputStream instance " << outStream.
name()
198 <<
" already added, ignoring " << outStream <<
endmsg;
virtual SmartIF< IAlgorithm > & algorithm(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
Definition of the MsgStream class used to transmit messages.
#define DECLARE_ALGORITHM_FACTORY(x)
Define general base for Gaudi exception.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
virtual StatusCode finalize()
Algorithm finalization.
OutStreamsMapType m_outputStreams
Internal storage for the OutputStreams to call.
Helper class to call the required OutputStream.
StatusCode initialize() override
standard initialization method
bool isSuccess() const
Test for a status code of SUCCESS.
virtual bool analyse(IRegistry *pObject, int level)=0
Analyse the data object.
StatusCode Error(const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
Print the error message and return with the given StatusCode.
virtual StatusCode stop()
Algorithm finalization.
virtual StatusCode start()
Algorithm initialization.
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
virtual ~ReplayOutputStream()
Destructor.
virtual const name_type & name() const =0
Name of the directory (or key)
bool isFailure() const
Test for a status code of FAILURE.
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
StatusCode i_outStreamTransition()
Helper function to call the transition on the contained OutputStreams.
Helper class to parse a string of format "type/name".
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
virtual StatusCode execute()
Algorithm execution.
This class is used for returning status codes from appropriate routines.
std::pair< const K, T > value_type
StatusCode finalize() override
standard finalization method
iterator find(const key_type &key)
The useful base class for data processing algorithms.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
void i_addOutputStream(const Gaudi::Utils::TypeNameString &outStream)
Add a new algorithm to the list of OutputStreams.
std::vector< std::string > m_outputStreamNames
(property) Type/Name list of OutputStream we have to call.
Helper class to fill the internal map of OutputStreams.
Generic data agent interface.
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
const std::string & name() const
SmartIF< IDataManagerSvc > m_evtMgr
virtual StatusCode traverseSubTree(const std::string &sub_path, IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects below the sub tree identified by its full path name...
SmartIF< IAlgManager > m_algMgr
static const std::string locationRoot()
Return the path in the Transient Store used to record the triggered instances.
virtual StatusCode initialize()
Algorithm initialization.
MSG::Level msgLevel() const
get the output level from the embedded MsgStream