|
ATLAS Offline Software
|
Go to the documentation of this file.
15 #include "GaudiKernel/IClassIDSvc.h"
16 #include "GaudiKernel/IConversionSvc.h"
17 #include "GaudiKernel/TypeNameString.h"
18 #include "GaudiKernel/GaudiException.h"
19 #include "GaudiKernel/ServiceHandle.h"
23 #include "boost/range/adaptor/reversed.hpp"
39 if (!clidsvc.retrieve())
return nullptr;
41 if (!clidsvc->getTypeNameOfID (clid,
name).isSuccess()) {
44 (void)TClass::GetClass (
name.c_str());
53 base_class(
name, svcLoc),
54 m_pDataLoader(
"EventPersistencySvc",
name)
78 return StatusCode::SUCCESS;
91 if (tad->provider() !=
nullptr)
break;
92 tad->setProvider (provider, storeID);
103 if (
m_providers.empty())
return StatusCode::SUCCESS;
109 setProviderOnList (tList, provider, storeID);
112 return StatusCode::SUCCESS;
126 if (FSMState() == Gaudi::StateMachine::OFFLINE) {
128 return StatusCode::SUCCESS;
139 if (
m_providers.empty())
return StatusCode::SUCCESS;
145 setProviderOnList (tList, provider, storeID);
148 return StatusCode::SUCCESS;
166 proxy->setAddress(tad->address());
167 if (
proxy->provider() == 0) {
168 proxy->setProvider(tad->provider(),
store.storeID());
172 if ( 0 ==
addAddress(
store, std::move(*tad)) )
return StatusCode::FAILURE;
177 return StatusCode::SUCCESS;
188 bool resetOnly(tAddr.name().substr(0,10) != std::string(
"HLTAutoKey"));
194 bool addedProxy =
store.addToStore(
dp->clID(),
dp).isSuccess();
198 <<
dp->clID() <<
"/" <<
dp->name());
205 for (
CLID clid : tClid) {
206 if (clid !=
dp->clID()) {
207 bool flag = (
store.addToStore(clid,
dp)).isSuccess();
210 << clid <<
"/" <<
dp->name());
217 for (
const std::string&
alias :
dp->alias()) {
225 if (
std::find (tClid.begin(), tClid.end(), clid) == tClid.end()) {
226 store.addToStore (clid,
dp).ignore();
227 dp->setTransientID (clid);
232 if (
std::find (tClid.begin(), tClid.end(), clid) == tClid.end()) {
233 store.addToStore (clid,
dp).ignore();
234 dp->setTransientID (clid);
254 for (; iProvider != iEnd; ++iProvider) {
255 if ( ((*iProvider)->updateAddress(
store.storeID(),&pTAd,ctx)).isSuccess() )
258 return this->
addAddress(store,std::move(pTAd));
278 EventContext* ctx = SG::DataProxy_cast<EventContext> (
proxy);
279 if (ctx)
return *ctx;
281 static const EventContext emptyContext;
292 auto it =
std::find (providerNames.begin(), providerNames.end(),
293 "AddressRemappingSvc");
294 if (
it != providerNames.end() &&
it != providerNames.end()-1) {
295 providerNames.erase (
it);
296 providerNames.push_back (
"AddressRemappingSvc");
299 for (
const std::string& pName : providerNames) {
300 SmartIF<IAddressProvider> pAP{service(pName)};
303 throw GaudiException(
"Failed to locate address provider",
304 "ProxyProviderSvc::providerNamesPropertyHandle",
305 StatusCode::FAILURE);
std::list< IAddressProvider * >::iterator pAPiterator
ProxyProviderSvc(const std::string &name, ISvcLocator *svcLoc)
Standard Service Constructor.
std::string find(const std::string &s)
return a remapped string
a proxy registry (a read/write dictionary)
virtual void addProvider(IAddressProvider *aProvider) override final
IAddressProvider manager functionality add a provider to the set of known ones.
std::vector< IProxyRegistry * > m_pendingLoad
List of pending stores on which to run preLoadProxies().
StatusCode doPreLoadProxies(IProxyRegistry &storeToModify)
StringArrayProperty m_providerNames
property: the services declared as providers
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...
virtual StatusCode initialize() override
Service boilerplate.
#define ATH_MSG_VERBOSE(x)
StatusCode addAddresses(IProxyRegistry &store, TAdList &tList)
Add lists of TADs to the store.
const std::vector< CLID > & get_bases() const
Return the class IDs of all known bases of T (that have class IDs).
virtual StatusCode loadAddresses(StoreID::type, tadList &)
get all new addresses from Provider for this Event.
Assign a CLID to EventContext.
virtual StatusCode loadProxies(IProxyRegistry &storeToModify) override
add proxies to the store to modify (during Begin Event)
SG::DataProxy * addAddress(IProxyRegistry &storeToModify, SG::TransientAddress &&tad)
create a new Proxy, overriding CLID and/or key
ServiceHandle< IConversionSvc > m_pDataLoader
Persistency Service.
manages the address providers and add proxies on demand to the store
std::list< IAddressProvider * > m_providers
the providers we know about. WE DON'T OWN THEM
Provide an interface for finding inheritance information at run time.
::StatusCode StatusCode
StatusCode definition for legacy code.
Default, invalid implementation of ClassID_traits.
interface for IOA providers
std::vector< CLID > get_copy_conversions() const
Return known copy conversions.
virtual SG::DataProxy * retrieveProxy(const CLID &id, const std::string &key, IProxyRegistry &storeToModify) override
Use a provider to create a proxy for ID/KEY.
uint32_t CLID
The Class ID type.
void setProvider(IAddressProvider *provider, StoreID::type storeID)
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
virtual StatusCode preLoadProxies(IProxyRegistry &storeToModify) override
IProxyProvider interface.
std::list< SG::TransientAddress * > TAdList
The non-template portion of the BaseInfo implementation.
const EventContext & contextFromStore(IProxyRegistry &ds) const
Retrieve the EventContext saved in store DS.
virtual StatusCode preLoadAddresses(StoreID::type, tadList &)
get all addresses from Provider : Called before Begin Event
virtual ~ProxyProviderSvc()
void providerNamesPropertyHandler(Gaudi::Details::PropertyBase &theProp)
the handler for m_providerNames