19#include "GaudiKernel/IClassIDSvc.h"
20#include "GaudiKernel/GenericAddress.h"
21#include "GaudiKernel/StatusCode.h"
32 base_class(name, pSvcLocator),
50 return StatusCode::SUCCESS;
56 return StatusCode::SUCCESS;
63 ATH_MSG_DEBUG(
"Cannot retrieve DataHeader from DetectorStore.");
64 return StatusCode::SUCCESS;
66 ATH_MSG_DEBUG(
"The current File contains: " << dataHeader->size() <<
" objects");
67 for (
const auto& element : *dataHeader) {
70 delete tadd; tadd =
nullptr;
72 ATH_MSG_DEBUG(
"preLoadAddresses: DataObject address, clid = " << tadd->
clID() <<
", name = " << tadd->
name());
78 return StatusCode::SUCCESS;
84 return StatusCode::SUCCESS;
89 if (dataHeader ==
nullptr) {
91 if (!eventDataHeader.
isValid()) {
93 return StatusCode::FAILURE;
95 dataHeader = eventDataHeader.
cptr();
100 std::string tokenStr;
103 tokenStr = (*attrList)[
"eventRef_secondary"].data<std::string>();
104 ATH_MSG_DEBUG(
"found AthenaAttribute, name = eventRef_secondary = " << tokenStr);
105 }
catch (std::exception &e) {
107 return StatusCode::FAILURE;
111 return StatusCode::FAILURE;
114 if (!
eventStore()->recordAddress(iop).isSuccess()) {
115 ATH_MSG_ERROR(
"Cannot record address to StoreGate with token string: " << tokenStr);
116 return StatusCode::FAILURE;
121 bool doRegister = dataHeader->
dhFormToken().empty() ||
123 ATH_MSG_DEBUG(
"The current Event contains: " << dataHeader->
size() <<
" objects");
124 for (
const auto& element : *dataHeader) {
130 delete tadd; tadd =
nullptr;
132 ATH_MSG_DEBUG(
"loadAddresses: DataObject address, clid = " << tadd->
clID() <<
", name = " << tadd->
name());
134 tads.push_back(tadd);
138 return StatusCode::SUCCESS;
143 const EventContext& ) {
144 return StatusCode::FAILURE;
#define ATH_CHECK
Evaluate an expression and check for errors.
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.