Loading [MathJax]/jax/output/SVG/config.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
HiveAlgG.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 "HiveAlgG.h"
6 
7 HiveAlgG::HiveAlgG( const std::string& name,
8  ISvcLocator* pSvcLocator ) :
9  ::HiveAlgBase( name, pSvcLocator )
10 {
11 }
12 
13 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
14 HiveAlgG::~HiveAlgG() = default;
15 
16 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
18  ATH_MSG_DEBUG("initialize " << name());
19 
22 
23  // initialize base class
24  return HiveAlgBase::initialize();
25 }
26 
27 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
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 >(70000)));
44 
45  ATH_MSG_INFO(" write: " << wrh1.key() << " = " << wrh1->val() );
46 
47  return StatusCode::SUCCESS;
48 
49 }
50 
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
HiveAlgG::m_rdh1
SG::ReadHandleKey< HiveDataObj > m_rdh1
Definition: HiveAlgG.h:38
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
HiveAlgBase::sleep
unsigned int sleep()
Definition: HiveAlgBase.cxx:40
HiveAlgG.h
Simple Algorithm that reads a HiveDataObjs created by HiveAlgD and writes another one.
HiveAlgG::execute
virtual StatusCode execute() override
Definition: HiveAlgG.cxx:28
HiveAlgBase::initialize
virtual StatusCode initialize() override
Definition: HiveAlgBase.cxx:23
HiveAlgG::m_wrh1
SG::WriteHandleKey< HiveDataObj > m_wrh1
Definition: HiveAlgG.h:40
HiveAlgG::HiveAlgG
HiveAlgG(const std::string &name, ISvcLocator *pSvcLocator)
Definition: HiveAlgG.cxx:7
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
HiveAlgG::initialize
virtual StatusCode initialize() override
Definition: HiveAlgG.cxx:17
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
HiveAlgBase
Definition: HiveAlgBase.h:26
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
SG::VarHandleBase::key
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:64
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
HiveDataObj::val
void val(int i)
Definition: HiveDataObj.h:22
HiveAlgG::~HiveAlgG
~HiveAlgG()