ATLAS Offline Software
Loading...
Searching...
No Matches
HiveAlgD.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "HiveAlgD.h"
6
7HiveAlgD::HiveAlgD( const std::string& name,
8 ISvcLocator* pSvcLocator ) :
9 ::HiveAlgBase( name, pSvcLocator )
10{
11}
12
13/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
14HiveAlgD::~HiveAlgD() = default;
15
16/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
18 ATH_MSG_DEBUG("initialize " << name());
19
20 ATH_CHECK( m_rdh1.initialize() );
21 ATH_CHECK( m_wrh1.initialize() );
22
23 // initialize base class
25}
26
27/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
28StatusCode HiveAlgD::execute() {
29
30 ATH_MSG_DEBUG("execute " << name());
31
32 sleep();
33
35 if (!rdh1.isValid()) {
36 ATH_MSG_ERROR ("Could not retrieve HiveDataObj with key " << rdh1.key());
37 return StatusCode::FAILURE;
38 }
39
40 ATH_MSG_INFO(" read: " << rdh1.key() << " = " << rdh1->val() );
41
43 ATH_CHECK(wrh1.record(std::make_unique< HiveDataObj >(40000)));
44
45 ATH_MSG_INFO(" write: " << wrh1.key() << " = " << wrh1->val() );
46
47 return StatusCode::SUCCESS;
48
49}
50
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
Simple Algorithm that reads one HiveDataObj created by HiveAlgA, and writes out one object.
unsigned int sleep()
HiveAlgBase(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize() override
SG::ReadHandleKey< HiveDataObj > m_rdh1
Definition HiveAlgD.h:38
virtual StatusCode execute() override
Definition HiveAlgD.cxx:28
virtual StatusCode initialize() override
Definition HiveAlgD.cxx:17
SG::WriteHandleKey< HiveDataObj > m_wrh1
Definition HiveAlgD.h:40
HiveAlgD(const std::string &name, ISvcLocator *pSvcLocator)
Definition HiveAlgD.cxx:7
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.