9 ISvcLocator* pSvcLocator ) :
45 return StatusCode::SUCCESS;
51 StatusCode
sc { StatusCode::SUCCESS };
52 std::vector< SG::ReadHandle<HiveDataObj> > rhv =
m_rhv.makeHandles();
53 for (
auto &hnd : rhv) {
55 ATH_MSG_ERROR (
"Could not retrieve HiveDataObj with key " << hnd.key());
56 sc = StatusCode::FAILURE;
58 ATH_MSG_INFO(
" read: " << hnd.key() <<
" = " << hnd->val() );
67 std::vector< SG::WriteHandle<HiveDataObj> > whv =
m_whv.makeHandles();
68 for (
auto &hnd : whv) {
69 ATH_CHECK(hnd.record(std::make_unique<HiveDataObj>( 10101 )));
70 ATH_MSG_INFO(
" write: " << hnd.key() <<
" = " << hnd->val() );
72 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Simple Algorithm that reads an array of HiveDataObjs, and then writes an array of them.
HiveAlgBase(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize() override
SG::ReadHandleKeyArray< HiveDataObj > m_rhv
SG::WriteHandleKeyArray< HiveDataObj > m_whv
virtual StatusCode initialize() override
HiveAlgV(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< bool > m_writeFirst
virtual StatusCode execute() override