The Gaudi Framework  v30r3 (a5ef0a68)
ReplayOutputStream.h
Go to the documentation of this file.
1 #ifndef COMPONENT_REPLAYOUTPUTSTREAM_H
2 #define COMPONENT_REPLAYOUTPUTSTREAM_H 1
3 // Include files
4 // from Gaudi
6 #include "GaudiKernel/HashMap.h"
7 #include "GaudiKernel/SmartIF.h"
9 
10 class IAlgManager;
11 struct IDataManagerSvc;
12 
20 {
21 public:
24 
25  StatusCode initialize() override;
26  StatusCode start() override;
27  StatusCode execute() override;
28  StatusCode stop() override;
29  StatusCode finalize() override;
30 
33 
34 private:
36  void i_addOutputStream( const Gaudi::Utils::TypeNameString& outStream );
37 
40  {
41  public:
43  inline void operator()( const Gaudi::Utils::TypeNameString& outStream ) { m_ptr->i_addOutputStream( outStream ); }
44 
45  private:
47  };
48 
51  {
52  public:
54  inline void operator()( const std::string& name ) const
55  {
57  if ( alg ) {
58  if ( !alg->isExecuted() ) {
60  } else {
61  m_ptr->warning() << name << " already executed for the current event" << endmsg;
62  }
63  } else {
64  m_ptr->warning() << "invalid OuputStream " << name << endmsg;
65  }
66  }
67 
68  private:
70  };
71 
74  template <Gaudi::StateMachine::Transition TR>
76 
78  this, "OutputStreams", {}, "OutputStream instances that can be called."};
79 
81  OutStreamsMapType m_outputStreams;
82 
85 };
86 
87 #endif // COMPONENT_REPLAYOUTPUTSTREAM_H
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:765
Implementation of property with value of concrete type.
Definition: Property.h:381
OutStreamsMapType m_outputStreams
Internal storage for the OutputStreams to call.
Helper class to call the required OutputStream.
StatusCode finalize() override
Algorithm finalization.
Header file for class GaudiAlgorithm.
OutStreamTrigger(ReplayOutputStream *ptr)
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Definition: IAlgManager.h:27
STL class.
StatusCode i_outStreamTransition()
Helper function to call the transition on the contained OutputStreams.
Helper class to parse a string of format "type/name".
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
StatusCode stop() override
Algorithm finalization.
Gaudi::Property< std::vector< std::string > > m_outputStreamNames
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
virtual bool isExecuted() const =0
check if the algorithm is already executed for the current event
The useful base class for data processing algorithms.
virtual StatusCode sysExecute(const EventContext &)=0
System execution. This method invokes the execute() method of a concrete algorithm.
GAUDI_API const EventContext & currentContext()
void i_addOutputStream(const Gaudi::Utils::TypeNameString &outStream)
Add a new algorithm to the list of OutputStreams.
Helper class to fill the internal map of OutputStreams.
StatusCode execute() override
Algorithm execution.
StatusCode start() override
Algorithm initialization.
GaudiUtils::HashMap< std::string, SmartIF< IAlgorithm > > OutStreamsMapType
Class used to hold the OutputStream instances.
void operator()(const std::string &name) const
Common class providing an architecture-independent hash map.
Definition: HashMap.h:74
StatusCode initialize() override
Algorithm initialization.
void operator()(const Gaudi::Utils::TypeNameString &outStream)
SmartIF< IDataManagerSvc > m_evtMgr
OutStreamAdder(ReplayOutputStream *ptr)
SmartIF< IAlgManager > m_algMgr
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
GaudiAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Standard constructor.