15#ifndef ATHENABASECOMPS_ATHCOMMONDATASTORE_H
16#define ATHENABASECOMPS_ATHCOMMONDATASTORE_H
22#include "GaudiKernel/StatusCode.h"
40#include "GaudiKernel/ServiceHandle.h"
54 template <
typename... T>
56 : PBASE(name,
std::move(args)...),
57 m_evtStore (
"StoreGateSvc/StoreGateSvc", name ),
58 m_detStore (
"StoreGateSvc/DetectorStore", name ),
64 "Handle to a StoreGateSvc instance: it will be used to "
65 "retrieve data during the course of the job" );
69 "Handle to a StoreGateSvc/DetectorStore instance: it will be used to "
70 "retrieve data during the course of the job" );
72 auto props = this->getProperties();
73 for( Gaudi::Details::PropertyBase* prop : props ) {
74 if (prop->name() ==
"ExtraOutputs" || prop->name() ==
"ExtraInputs") {
75 prop->declareUpdateHandler
144 template <
class T,
class V,
class H>
155 template <
class T,
class V,
class H>
161 hndl.documentation());
169 template <
class T,
class V,
class H>
175 hndl.documentation());
183 template <
class T,
class V,
class H>
189 hndl.documentation());
198 template <
class T,
class V,
class H>
201 return PBASE::declareProperty(t);
223 const std::string& doc,
229 return PBASE::declareProperty(name,hndl,doc);
247 const std::string& doc,
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(name,hndl,doc);
261 const std::string& doc,
274 m_vhka.push_back(&hndArr);
276 Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
280 ATH_MSG_ERROR(
"unable to call declareProperty on VarHandleKeyArray "
312 std::vector<SG::VarHandleKey*> keys =
a->keys();
313 for (
auto k : keys) {
335 const std::string& doc,
338 return PBASE::declareProperty(name, property, doc);
354 const std::string& doc=
"none")
374 using PBASE::renounce;
376 std::enable_if_t<std::is_void_v<std::result_of_t<
decltype(&T::renounce)(T)> > &&
377 !std::is_base_of_v<SG::VarHandleKeyArray, T> &&
378 std::is_base_of_v<Gaudi::DataHandle, T>,
398 std::vector<SG::VarHandleKeyArray*>
m_vhka;
Helper to classify the type of a handle property.
Base class for VarHandle classes.
Base class for VarHandleKeyArray for reading from StoreGate.
A property holding a SG store/key/clid from which a VarHandle is made.
class to handle Properties for VarHandleKeyArray
Handle Gaudi property setting for VarHandleKey.
virtual std::vector< Gaudi::DataHandle * > inputHandles() const override
Return this algorithm's input handles.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
AthCommonDataStore(const std::string &name, T... args)
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &t, const SG::NotHandleType &)
specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHa...
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
Declare a new Gaudi property.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::vector< SG::VarHandleKeyArray * > m_vhka
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
Declare a new Gaudi property.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart() override
Handle START transition.
const ServiceHandle< StoreGateSvc > & evtStore() const
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
void extraDeps_update_handler(Gaudi::Details::PropertyBase &ExtraDeps)
Add StoreName to extra input/output deps as needed.
virtual StatusCode sysInitialize() override
Perform system initialization for an algorithm.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
specialization for handling Gaudi::Property<SG::VarHandleBase>
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
void updateVHKA(Gaudi::Details::PropertyBase &)
bool m_varHandleArraysDeclared
void renounceArray(SG::VarHandleKeyArray &handlesArray)
remove all handles from I/O resolution
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
Declare a new Gaudi property.
ServiceHandle< StoreGateSvc > StoreGateSvc_t
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, T &property, const std::string &doc="none")
Declare a new Gaudi property.
Header file for AthHistogramAlgorithm.
Base class for VarHandle types.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual void setOwner(IDataHandleHolder *o)=0
virtual void renounce()=0
A property holding a SG store/key/clid from which a VarHandle is made.
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode parse(std::tuple< Tup... > &tup, const Gaudi::Parsers::InputData &input)
=============================================================================
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type