16#include "GaudiKernel/IClassIDSvc.h"
17#include "GaudiKernel/IConversionSvc.h"
18#include "GaudiKernel/TypeNameString.h"
19#include "GaudiKernel/GaudiException.h"
20#include "GaudiKernel/ServiceHandle.h"
40 if (!clidsvc.retrieve())
return nullptr;
42 if (!clidsvc->getTypeNameOfID (clid, name).isSuccess()) {
45 (void)TClass::GetClass (
name.c_str());
54 base_class(name, svcLoc),
79 return StatusCode::SUCCESS;
92 if (tad->provider() !=
nullptr)
break;
93 tad->setProvider (provider, storeID);
104 if (
m_providers.empty())
return StatusCode::SUCCESS;
110 setProviderOnList (tList, provider, storeID);
113 return StatusCode::SUCCESS;
127 if (FSMState() == Gaudi::StateMachine::OFFLINE) {
129 return StatusCode::SUCCESS;
140 if (
m_providers.empty())
return StatusCode::SUCCESS;
146 setProviderOnList (tList, provider, storeID);
149 return StatusCode::SUCCESS;
168 proxy->setAddress(tad->address());
169 if (proxy->provider() == 0) {
170 proxy->setProvider(tad->provider(), store.storeID());
174 if ( 0 ==
addAddress(store, std::move(*tad)) )
return StatusCode::FAILURE;
179 return StatusCode::SUCCESS;
190 bool resetOnly(tAddr.name().substr(0,10) != std::string(
"HLTAutoKey"));
196 bool addedProxy = store.
addToStore(dp->clID(), dp).isSuccess();
200 << dp->clID() <<
"/" << dp->name());
207 for (
CLID clid : tClid) {
208 if (clid != dp->clID()) {
209 bool flag = (store.
addToStore(clid, dp)).isSuccess();
212 << clid <<
"/" << dp->name());
219 for (
const std::string& alias : dp->alias()) {
220 (store.addAlias(alias, dp)).ignore();
227 if (std::find (tClid.begin(), tClid.end(), clid) == tClid.end()) {
229 dp->setTransientID (clid);
234 if (std::find (tClid.begin(), tClid.end(), clid) == tClid.end()) {
236 dp->setTransientID (clid);
256 for (; iProvider != iEnd; ++iProvider) {
257 if ( ((*iProvider)->updateAddress(store.storeID(),&pTAd,ctx)).isSuccess() )
260 return this->
addAddress(store,std::move(pTAd));
281 if (ctx)
return *ctx;
283 static const EventContext emptyContext;
294 auto it = std::find (providerNames.begin(), providerNames.end(),
295 "AddressRemappingSvc");
296 if (it != providerNames.end() && it != providerNames.end()-1) {
297 providerNames.erase (it);
298 providerNames.push_back (
"AddressRemappingSvc");
301 for (
const std::string& pName : providerNames) {
302 SmartIF<IAddressProvider> pAP{service(pName)};
305 throw GaudiException(
"Failed to locate address provider",
306 "ProxyProviderSvc::providerNamesPropertyHandle",
307 StatusCode::FAILURE);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
Provide an interface for finding inheritance information at run time.
Assign a CLID to EventContext.
uint32_t CLID
The Class ID type.
manages the address providers and add proxies on demand to the store
interface for IOA providers
virtual StatusCode loadAddresses(StoreID::type, tadList &)
get all new addresses from Provider for this Event.
virtual StatusCode preLoadAddresses(StoreID::type, tadList &)
get all addresses from Provider : Called before Begin Event
a proxy registry (a read/write dictionary)
ServiceHandle< IConversionSvc > m_pDataLoader
Persistency Service.
StatusCode doPreLoadProxies(IProxyRegistry &storeToModify)
StringArrayProperty m_providerNames
property: the services declared as providers
virtual SG::DataProxy * retrieveProxy(const CLID &id, const std::string &key, IProxyRegistry &storeToModify) override
Use a provider to create a proxy for ID/KEY.
std::list< IAddressProvider * > m_providers
the providers we know about. WE DON'T OWN THEM
virtual StatusCode loadProxies(IProxyRegistry &storeToModify) override
add proxies to the store to modify (during Begin Event)
virtual ~ProxyProviderSvc()
virtual StatusCode initialize() override
Service boilerplate.
std::vector< IProxyRegistry * > m_pendingLoad
List of pending stores on which to run preLoadProxies().
ProxyProviderSvc(const std::string &name, ISvcLocator *svcLoc)
Standard Service Constructor.
const EventContext & contextFromStore(IProxyRegistry &ds) const
Retrieve the EventContext saved in store DS.
std::list< IAddressProvider * >::iterator pAPiterator
StatusCode addAddresses(IProxyRegistry &store, TAdList &tList)
Add lists of TADs to the store.
virtual StatusCode preLoadProxies(IProxyRegistry &storeToModify) override
IProxyProvider interface.
std::list< SG::TransientAddress * > TAdList
virtual void addProvider(IAddressProvider *aProvider) override final
IAddressProvider manager functionality add a provider to the set of known ones.
void providerNamesPropertyHandler(Gaudi::Details::PropertyBase &theProp)
the handler for m_providerNames
SG::DataProxy * addAddress(IProxyRegistry &storeToModify, SG::TransientAddress &&tad)
create a new Proxy, overriding CLID and/or key
virtual SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override
virtual StatusCode addToStore(CLID, SG::DataProxy *proxy) override
The non-template portion of the BaseInfo implementation.
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
const std::vector< CLID > & get_bases() const
Return the class IDs of all known bases of T (that have class IDs).
std::vector< CLID > get_copy_conversions() const
Return known copy conversions.
std::vector< CLID > TransientClidSet
Strictly a set, but there shouldn't be more than a handful of entries, so store it as a sorted vector...
void setProvider(IAddressProvider *provider, StoreID::type storeID)
DATA * DataProxy_cast(DataProxy *proxy)
cast the proxy into the concrete data object it proxies
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.