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 // Initialization
15 // ============================================================================
17  StatusCode sc = GaudiAlgorithm::initialize(); // must be executed first
18  if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm
19 
20  if ( msgLevel(MSG::DEBUG) ) debug() << "==> Initialize" << endmsg;
21 
22  if (m_streamName.empty()) {
23  m_streamName = "Deferred:" + name();
24  debug() << "Using default OutputStreamName: '"
25  << m_streamName << "'" << endmsg;
26  }
27 
28  m_flagLocation = locationRoot() + "/" + m_streamName;
29  return StatusCode::SUCCESS;
30 }
31 
32 // ============================================================================
33 // Main execution
34 // ============================================================================
36  if ( msgLevel(MSG::DEBUG) ) debug() << "==> Execute" << endmsg;
37 
38  getOrCreate<DataObject, DataObject>(m_flagLocation, false);
39  /*
40  if (!exist(m_flagLocation, false)) {
41  DataObject *obj = new DataObject();
42  put(obj, m_flagLocation, false);
43  }
44  */
45  return StatusCode::SUCCESS;
46 }
47 
48 // ============================================================================
49 // Finalize
50 // ============================================================================
52  if ( msgLevel(MSG::DEBUG) ) debug() << "==> Finalize" << endmsg;
53 
54  return GaudiAlgorithm::finalize(); // must be called after all other actions
55 }
56 
57 // ============================================================================
StatusCode initialize() override
standard initialization method
StatusCode execute() override
Algorithm execution.
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
std::string m_flagLocation
location of the DataObject flag used to record that this algorithm was called
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode finalize() override
standard finalization method
#define DECLARE_ALGORITHM_FACTORY(x)
Definition: Algorithm.h:620
Simple class that adds an entry to the Transient Event Store to record that the processing flow trigg...
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode finalize() override
Algorithm finalization.