ATLAS Offline Software
Loading...
Searching...
No Matches
ProxyProviderSvc.h
Go to the documentation of this file.
1// -*- C++ -*-
2
3/*
4 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5*/
6
11
12
13#ifndef SGCOMPS_PROXYPROVIDERSVC_H
14# define SGCOMPS_PROXYPROVIDERSVC_H 1
15
18#include "Gaudi/Property.h" /*StringArrayProperty*/
19#include "GaudiKernel/StatusCode.h"
20#include <cassert>
21#include <list>
22#include <string>
23#include <algorithm>
24#include <vector>
25
26// framework includes
28
29namespace SG {
30 class DataProxy;
31 class TransientAddress;
32}
33
35class IProxyRegistry; //this is DataStore
36class IConversionSvc;
37class IOpaqueAddress;
38class ISvcLocator;
39
41class ProxyProviderSvc : public extends<AthService, IProxyProviderSvc>
42{
43public:
44 typedef std::list<IAddressProvider*>::iterator pAPiterator;
45 typedef std::list<SG::TransientAddress*> TAdList;
46 typedef TAdList::iterator TAdIterator;
47
49
50
51 virtual StatusCode preLoadProxies(IProxyRegistry& storeToModify) override;
52
54 virtual StatusCode loadProxies(IProxyRegistry& storeToModify) override;
55
59 virtual SG::DataProxy* retrieveProxy(const CLID& id, const std::string& key,
60 IProxyRegistry& storeToModify) override;
61
66
67
70 virtual void addProvider(IAddressProvider* aProvider) override final;
71
73
74 virtual StatusCode initialize() override;
76
78 ProxyProviderSvc(const std::string& name, ISvcLocator* svcLoc);
79 virtual ~ProxyProviderSvc();
80
81private:
89 const EventContext& contextFromStore (IProxyRegistry& ds) const;
90
91
97 StatusCode addAddresses(IProxyRegistry& store,
98 TAdList& tList);
99
100
102 StringArrayProperty m_providerNames{this,"ProviderNames",{},
103 "names of the services to be use as address providers","OrderedSet<std::string>"};
104
105 void providerNamesPropertyHandler( Gaudi::Details::PropertyBase& theProp );
106
107 StatusCode doPreLoadProxies(IProxyRegistry& storeToModify);
108
110 std::list<IAddressProvider*> m_providers;
113
115 std::vector<IProxyRegistry*> m_pendingLoad;
116};
117
118
120 assert(aProvider);
121 if (find(m_providers.begin(), m_providers.end(), aProvider) == m_providers.end()) {
122 m_providers.push_back(aProvider);
123 }
124}
125
126#endif // !SGCOMPS_PROXYPROVIDERSVC_H
uint32_t CLID
The Class ID type.
interface for IOA providers
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 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
TAdList::iterator TAdIterator
SG::DataProxy * addAddress(IProxyRegistry &storeToModify, SG::TransientAddress &&tad)
create a new Proxy, overriding CLID and/or key
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:138
Forward declaration.