18#include "GaudiKernel/IClassIDSvc.h"
19#include "GaudiKernel/GenericAddress.h"
20#include "GaudiKernel/StatusCode.h"
31 base_class(name, pSvcLocator),
49 return StatusCode::SUCCESS;
55 return StatusCode::SUCCESS;
62 ATH_MSG_DEBUG(
"Cannot retrieve DataHeader from DetectorStore.");
63 return StatusCode::SUCCESS;
65 ATH_MSG_DEBUG(
"The current File contains: " << dataHeader->size() <<
" objects");
66 for (
const auto& element : *dataHeader) {
69 delete tadd; tadd =
nullptr;
71 ATH_MSG_DEBUG(
"preLoadAddresses: DataObject address, clid = " << tadd->
clID() <<
", name = " << tadd->
name());
77 return StatusCode::SUCCESS;
83 return StatusCode::SUCCESS;
88 if (dataHeader ==
nullptr) {
90 if (!eventDataHeader.
isValid()) {
92 return StatusCode::FAILURE;
94 dataHeader = eventDataHeader.
cptr();
102 tokenStr = (*attrList)[
"eventRef_secondary"].data<std::string>();
103 ATH_MSG_DEBUG(
"found AthenaAttribute, name = eventRef_secondary = " << tokenStr);
104 }
catch (std::exception &e) {
106 return StatusCode::FAILURE;
110 return StatusCode::FAILURE;
113 if (!
eventStore()->recordAddress(iop).isSuccess()) {
114 ATH_MSG_ERROR(
"Cannot record address to StoreGate with token string: " << tokenStr);
115 return StatusCode::FAILURE;
120 bool doRegister = dataHeader->
dhFormToken().empty() ||
122 ATH_MSG_DEBUG(
"The current Event contains: " << dataHeader->
size() <<
" objects");
123 for (
const auto& element : *dataHeader) {
129 delete tadd; tadd =
nullptr;
131 ATH_MSG_DEBUG(
"loadAddresses: DataObject address, clid = " << tadd->
clID() <<
", name = " << tadd->
name());
133 tads.push_back(tadd);
137 return StatusCode::SUCCESS;
142 const EventContext& ) {
143 return StatusCode::FAILURE;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
This file contains the class definition for the AthenaPoolAddressProviderSvc class.
An AttributeList represents a logical row of attributes in a metadata table.
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
This file contains the class definition for the TokenAddress class.
An AttributeList represents a logical row of attributes in a metadata table.
ServiceHandle< StoreGateSvc > m_metaDataStore
StoreGateSvc * eventStore() const
Return pointer to active event SG.
std::unordered_set< std::string > m_dhFormKeys
Set of DataHeader form keys for which we've already done registerKeys.
ServiceHandle< IClassIDSvc > m_clidSvc
AthenaPoolAddressProviderSvc(const std::string &name, ISvcLocator *pSvcLocator)
Standard Service Constructor.
virtual StatusCode initialize() override
Required of all Gaudi Services.
virtual StatusCode updateAddress(StoreID::type storeID, SG::TransientAddress *tad, const EventContext &ctx) override
Update a transient address.
virtual StatusCode loadAddresses(StoreID::type storeID, IAddressProvider::tadList &tads) override
Get all addresses for this event from provider.
Gaudi::Property< std::string > m_attrListKey
virtual ~AthenaPoolAddressProviderSvc()
Destructor.
virtual StatusCode preLoadAddresses(StoreID::type storeID, IAddressProvider::tadList &tads) override
Get all addresses from provider.
Gaudi::Property< std::string > m_dataHeaderKey
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
static const Guid & null() noexcept
NULL-Guid: static class method.
std::list< SG::TransientAddress * > tadList
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
CLID clID() const
Retrieve string key:
const std::string & name() const
Get the primary (hashed) SG key.
void setProvider(IAddressProvider *provider, StoreID::type storeID)
The Athena Transient Store API.
static StoreGateSvc * currentStoreGate()
get current StoreGate
void registerKeys(const DataHeaderElement &dhe, StoreGateSvc *store)
Register all hash keys for one DH Element.
static const DbType POOL_StorageType
Helper functions for registering hash keys with the SG service.
static constexpr CLID ID()