ATLAS Offline Software
Loading...
Searching...
No Matches
MetaWriterAlg.cxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration.
3 */
4// $Id$
11
12
13#include "MetaWriterAlg.h"
17
18
19namespace DMTest {
20
21
27MetaWriterAlg::MetaWriterAlg (const std::string &name, ISvcLocator *pSvcLocator)
28 : AthAlgorithm (name, pSvcLocator),
29 m_metaStore ("StoreGateSvc/MetaDataStore", name)
30{
31 declareProperty ("MetaDataStore", m_metaStore);
32}
33
34
39{
40 ATH_CHECK( m_metaStore.retrieve() );
41 ATH_CHECK( m_metaStore->record (std::make_unique<DMTest::S1>(24), "MetaS1") );
42
43 auto c = std::make_unique<DMTest::C>();
44 auto cstore = std::make_unique<DMTest::CInfoAuxContainer>();
45 c->setStore (cstore.get());
46 c->setAFloat (2.5);
47 c->setAnInt (3);
48 ATH_CHECK( m_metaStore->record (std::move(cstore), "MetaCAux.") );
49 ATH_CHECK( m_metaStore->record (std::move(c), "MetaC") );
50
51 return StatusCode::SUCCESS;
52}
53
54
59{
60 return StatusCode::SUCCESS;
61}
62
63
64} // namespace DMTest
#define ATH_CHECK
Evaluate an expression and check for errors.
Class used for testing xAOD data reading/writing.
Class used for testing xAOD data reading/writing.
For symlink tests.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
virtual StatusCode execute() override
Algorithm execute method.
ServiceHandle< StoreGateSvc > m_metaStore
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
MetaWriterAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition B.h:23