| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
5 #include "GaudiAlg/GaudiAlgorithm.h"
6 #include "GaudiKernel/HashMap.h"
7 #include "GaudiKernel/SmartIF.h"
8
9 class IAlgManager;
10 class IDataManagerSvc;
11
18 class ReplayOutputStream: public GaudiAlgorithm {
19 public:
21 ReplayOutputStream(const std::string& name, ISvcLocator* pSvcLocator);
22 virtual ~ReplayOutputStream();
23
24 virtual StatusCode initialize();
25 virtual StatusCode start ();
26 virtual StatusCode execute ();
27 virtual StatusCode stop ();
28 virtual StatusCode finalize ();
29
31 typedef GaudiUtils::HashMap<std::string, SmartIF<IAlgorithm> > OutStreamsMapType;
32
33 protected:
34 private:
35
37 void i_addOutputStream(const Gaudi::Utils::TypeNameString &outStream);
38
40 class OutStreamAdder {
41 public:
42 OutStreamAdder(ReplayOutputStream *ptr): m_ptr(ptr) {}
43 inline void operator() (const Gaudi::Utils::TypeNameString &outStream) {
44 m_ptr->i_addOutputStream(outStream);
45 }
46 private:
47 ReplayOutputStream *m_ptr;
48 };
49
51 class OutStreamTrigger {
52 public:
53 OutStreamTrigger(ReplayOutputStream *ptr): m_ptr(ptr) {}
54 inline void operator() (const std::string &name) const {
55 SmartIF<IAlgorithm> &alg = m_ptr->m_outputStreams[name];
56 if (alg) {
57 if (!alg->isExecuted()) {
58 alg->sysExecute();
59 } else {
60 m_ptr->warning() << name
61 << " already executed for the current event" << endmsg;
62 }
63 } else {
64 m_ptr->warning() << "invalid OuputStream " << name << endmsg;
65 }
66 }
67 private:
68 ReplayOutputStream *m_ptr;
69 };
70
73 template <Gaudi::StateMachine::Transition TR>
74 StatusCode i_outStreamTransition();
75
77 std::vector<std::string> m_outputStreamNames;
79 OutStreamsMapType m_outputStreams;
80
81 SmartIF<IAlgManager> m_algMgr;
82 SmartIF<IDataManagerSvc> m_evtMgr;
83 };
84
85 #endif // COMPONENT_REPLAYOUTPUTSTREAM_H
ReplayOutputStream::ReplayOutputStream
ReplayOutputStream(const std::string &name, ISvcLocator *pSvcLocator)
Standard constructor.
Definition: ReplayOutputStream.cpp:25
SmartIF< IAlgorithm >
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
ReplayOutputStream
Definition: ReplayOutputStream.h:18
ReplayOutputStream::finalize
virtual StatusCode finalize()
Algorithm finalization.
Definition: ReplayOutputStream.cpp:161
ReplayOutputStream::m_outputStreams
OutStreamsMapType m_outputStreams
Internal storage for the OutputStreams to call.
Definition: ReplayOutputStream.h:79
ReplayOutputStream::OutStreamTrigger
Helper class to call the required OutputStream.
Definition: ReplayOutputStream.h:51
ReplayOutputStream::stop
virtual StatusCode stop()
Algorithm finalization.
Definition: ReplayOutputStream.cpp:176
GaudiAlgorithm.h
ReplayOutputStream::start
virtual StatusCode start()
Algorithm initialization.
Definition: ReplayOutputStream.cpp:120
ReplayOutputStream::OutStreamTrigger::OutStreamTrigger
OutStreamTrigger(ReplayOutputStream *ptr)
Definition: ReplayOutputStream.h:53
ReplayOutputStream::~ReplayOutputStream
virtual ~ReplayOutputStream()
Destructor.
Definition: ReplayOutputStream.cpp:35
IAlgManager
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Definition: IAlgManager.h:27
ReplayOutputStream::OutStreamAdder::m_ptr
ReplayOutputStream * m_ptr
Definition: ReplayOutputStream.h:47
HashMap.h
IAlgorithm::sysExecute
virtual StatusCode sysExecute()=0
System execution. This method invokes the execute() method of a concrete algorithm.
std::string
STL class.
Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:820
ReplayOutputStream::i_outStreamTransition
StatusCode i_outStreamTransition()
Helper function to call the transition on the contained OutputStreams.
Definition: ReplayOutputStream.cpp:93
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:9
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:121
ReplayOutputStream::execute
virtual StatusCode execute()
Algorithm execution.
Definition: ReplayOutputStream.cpp:146
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IAlgorithm::isExecuted
virtual bool isExecuted() const =0
check if the algorithm is already executed for the current event
SmartIF.h
GaudiAlgorithm
The useful base class for data processing algorithms.
Definition: GaudiAlgorithm.h:93
ReplayOutputStream::OutStreamTrigger::m_ptr
ReplayOutputStream * m_ptr
Definition: ReplayOutputStream.h:68
ReplayOutputStream::i_addOutputStream
void i_addOutputStream(const Gaudi::Utils::TypeNameString &outStream)
Add a new algorithm to the list of OutputStreams.
Definition: ReplayOutputStream.cpp:186
ReplayOutputStream::m_outputStreamNames
std::vector< std::string > m_outputStreamNames
(property) Type/Name list of OutputStream we have to call.
Definition: ReplayOutputStream.h:77
ReplayOutputStream::OutStreamAdder
Helper class to fill the internal map of OutputStreams.
Definition: ReplayOutputStream.h:40
std::vector< std::string >
IDataManagerSvc
Definition: IDataManagerSvc.h:45
ReplayOutputStream::OutStreamsMapType
GaudiUtils::HashMap< std::string, SmartIF< IAlgorithm > > OutStreamsMapType
Class used to hold the OutputStream instances.
Definition: ReplayOutputStream.h:31
ReplayOutputStream::OutStreamTrigger::operator()
void operator()(const std::string &name) const
Definition: ReplayOutputStream.h:54
GaudiUtils::HashMap
Common class providing an architecture-independent hash map.
Definition: HashMap.h:77
ReplayOutputStream::OutStreamAdder::operator()
void operator()(const Gaudi::Utils::TypeNameString &outStream)
Definition: ReplayOutputStream.h:43
ReplayOutputStream::m_evtMgr
SmartIF< IDataManagerSvc > m_evtMgr
Definition: ReplayOutputStream.h:82
ReplayOutputStream::OutStreamAdder::OutStreamAdder
OutStreamAdder(ReplayOutputStream *ptr)
Definition: ReplayOutputStream.h:42
ReplayOutputStream::m_algMgr
SmartIF< IAlgManager > m_algMgr
Definition: ReplayOutputStream.h:81
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
ReplayOutputStream::initialize
virtual StatusCode initialize()
Algorithm initialization.
Definition: ReplayOutputStream.cpp:102