All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
RecordOutputStream.cpp
Go to the documentation of this file.
1 // Include files
2 
3 // local
4 #include "RecordOutputStream.h"
5 
6 // ----------------------------------------------------------------------------
7 // Implementation file for class: RecordOutputStream
8 //
9 // 30/08/2013: Marco Clemencic
10 // ----------------------------------------------------------------------------
12 
13 // ============================================================================
14 // Standard constructor, initializes variables
15 // ============================================================================
17  : GaudiAlgorithm(name, pSvcLocator)
18 {
19  declareProperty("OutputStreamName", m_streamName,
20  "Name of the OutputStream instance should be triggered.");
21 }
22 
23 // ============================================================================
24 // Destructor
25 // ============================================================================
27 
28 // ============================================================================
29 // Initialization
30 // ============================================================================
32  StatusCode sc = GaudiAlgorithm::initialize(); // must be executed first
33  if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm
34 
35  if ( msgLevel(MSG::DEBUG) ) debug() << "==> Initialize" << endmsg;
36 
37  if (m_streamName.empty()) {
38  m_streamName = "Deferred:" + name();
39  debug() << "Using default OutputStreamName: '"
40  << m_streamName << "'" << endmsg;
41  }
42 
44  return StatusCode::SUCCESS;
45 }
46 
47 // ============================================================================
48 // Main execution
49 // ============================================================================
51  if ( msgLevel(MSG::DEBUG) ) debug() << "==> Execute" << endmsg;
52 
53  getOrCreate<DataObject, DataObject>(m_flagLocation, false);
54  /*
55  if (!exist(m_flagLocation, false)) {
56  DataObject *obj = new DataObject();
57  put(obj, m_flagLocation, false);
58  }
59  */
60  return StatusCode::SUCCESS;
61 }
62 
63 // ============================================================================
64 // Finalize
65 // ============================================================================
67  if ( msgLevel(MSG::DEBUG) ) debug() << "==> Finalize" << endmsg;
68 
69  return GaudiAlgorithm::finalize(); // must be called after all other actions
70 }
71 
72 // ============================================================================
#define DECLARE_ALGORITHM_FACTORY(x)
Definition: Algorithm.h:946
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode initialize() override
standard initialization method
virtual StatusCode finalize()
Algorithm finalization.
virtual ~RecordOutputStream()
Destructor.
STL namespace.
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
virtual StatusCode initialize()
Algorithm initialization.
std::string m_flagLocation
location of the DataObject flag used to record that this algorithm was called
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode finalize() override
standard finalization method
The useful base class for data processing algorithms.
Simple class that adds an entry to the Transient Event Store to record that the processing flow trigg...
virtual StatusCode execute()
Algorithm execution.
std::string m_streamName
Name of the OuputStream that should be called when this algorithm is triggered.
static const std::string locationRoot()
Return the path in the Transient Store used to record the triggered instances.
MSG::Level msgLevel() const
get the output level from the embedded MsgStream