The Gaudi Framework  v33r1 (b1225454)
RecordOutputStream.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 // Include files
12 
13 // local
14 #include "RecordOutputStream.h"
15 
16 // ----------------------------------------------------------------------------
17 // Implementation file for class: RecordOutputStream
18 //
19 // 30/08/2013: Marco Clemencic
20 // ----------------------------------------------------------------------------
22 
23 // ============================================================================
24 // Initialization
25 // ============================================================================
27  StatusCode sc = GaudiAlgorithm::initialize(); // must be executed first
28  if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm
29 
30  if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg;
31 
32  if ( m_streamName.empty() ) {
33  m_streamName = "Deferred:" + name();
34  debug() << "Using default OutputStreamName: '" << m_streamName << "'" << endmsg;
35  }
36 
37  m_flagLocation = locationRoot() + "/" + m_streamName;
38  return StatusCode::SUCCESS;
39 }
40 
41 // ============================================================================
42 // Main execution
43 // ============================================================================
45  if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg;
46 
47  getOrCreate<DataObject, DataObject>( m_flagLocation, false );
48  /*
49  if (!exist(m_flagLocation, false)) {
50  DataObject *obj = new DataObject();
51  put(obj, m_flagLocation, false);
52  }
53  */
54  return StatusCode::SUCCESS;
55 }
56 
57 // ============================================================================
58 // Finalize
59 // ============================================================================
61  if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Finalize" << endmsg;
62 
63  return GaudiAlgorithm::finalize(); // must be called after all other actions
64 }
65 
66 // ============================================================================
StatusCode initialize() override
standard initialization method
StatusCode execute() override
Algorithm execution.
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
std::string m_flagLocation
location of the DataObject flag used to record that this algorithm was called
#define DECLARE_COMPONENT(type)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
StatusCode finalize() override
standard finalization method
Simple class that adds an entry to the Transient Event Store to record that the processing flow trigg...
bool isFailure() const
Definition: StatusCode.h:145
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
StatusCode finalize() override
Algorithm finalization.