ATLAS Offline Software
MetaWriterAlg.cxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration.
3  */
4 // $Id$
13 #include "MetaWriterAlg.h"
17 
18 
19 namespace DMTest {
20 
21 
27 MetaWriterAlg::MetaWriterAlg (const std::string &name, ISvcLocator *pSvcLocator)
28  : AthAlgorithm (name, pSvcLocator),
29  m_metaStore ("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
MetaWriterAlg.h
DMTest::MetaWriterAlg::m_metaStore
ServiceHandle< StoreGateSvc > m_metaStore
Definition: MetaWriterAlg.h:50
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
DMTest::MetaWriterAlg::execute
virtual StatusCode execute() override
Algorithm execute method.
Definition: MetaWriterAlg.cxx:58
DMTest::MetaWriterAlg::initialize
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
Definition: MetaWriterAlg.cxx:38
CInfoAuxContainer.h
Class used for testing xAOD data reading/writing.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
C.h
Class used for testing xAOD data reading/writing.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthAlgorithm
Definition: AthAlgorithm.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
S1.h
For symlink tests.
python.compressB64.c
def c
Definition: compressB64.py:93
DMTest::MetaWriterAlg::MetaWriterAlg
MetaWriterAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: MetaWriterAlg.cxx:27
DMTest
Definition: B.h:23