The Gaudi Framework  master (1304469f)
Loading...
Searching...
No Matches
RecordOutputStream.cpp
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2023 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 "RecordOutputStream.h"
13
14// ----------------------------------------------------------------------------
15// Implementation file for class: RecordOutputStream
16//
17// 30/08/2013: Marco Clemencic
18// ----------------------------------------------------------------------------
20
21// ============================================================================
22// Initialization
23// ============================================================================
25 StatusCode sc = Algorithm::initialize(); // must be executed first
26 if ( sc.isFailure() ) return sc; // error printed already by Algorithm
27
28 if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg;
29
30 if ( m_streamName.empty() ) {
31 m_streamName = "Deferred:" + name();
32 debug() << "Using default OutputStreamName: '" << m_streamName << "'" << endmsg;
33 }
34
37}
38
39// ============================================================================
40// Main execution
41// ============================================================================
43 if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg;
44
45 DataObject* tmp = nullptr;
46 if ( !eventSvc()->retrieveObject( m_flagLocation, tmp ) ) {
47 tmp = new DataObject();
48 return eventSvc()->registerObject( m_flagLocation, tmp );
49 }
51}
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
#define DECLARE_COMPONENT(type)
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
A DataObject is the base class of any identifiable object on any data store.
Definition DataObject.h:37
SmartIF< IDataProviderSvc > & eventSvc() const
The standard event data service.
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
Definition Algorithm.h:175
const std::string & name() const override
The identifying name of the algorithm object.
StatusCode registerObject(std::string_view fullPath, DataObject *pObject)
Register object with the data store.
Simple class that adds an entry to the Transient Event Store to record that the processing flow trigg...
StatusCode execute() override
Algorithm execution.
static const std::string locationRoot()
Return the path in the Transient Store used to record the triggered instances.
std::string m_flagLocation
location of the DataObject flag used to record that this algorithm was called
StatusCode initialize() override
Algorithm initialization.
Gaudi::Property< std::string > m_streamName
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
bool isFailure() const
Definition StatusCode.h:129
constexpr static const auto SUCCESS
Definition StatusCode.h:99
@ DEBUG
Definition IMessageSvc.h:22