diff --git a/AtlasTest/ControlTest/share/ProxyProviderSvc_test.ref b/AtlasTest/ControlTest/share/ProxyProviderSvc_test.ref index 66fa73e78b7235de4c182fd0aa7596aec3e27eb4..e1fbbdbbb2c1525b00d356624b9e3063ba25b864 100644 --- a/AtlasTest/ControlTest/share/ProxyProviderSvc_test.ref +++ b/AtlasTest/ControlTest/share/ProxyProviderSvc_test.ref @@ -5,7 +5,6 @@ ApplicationMgr INFO Application Manager Configured successfully DetectorStore VERBOSE Initializing DetectorStore DetectorStore_ImplVERBOSE Initializing DetectorStore_Impl ProxyProviderSvc VERBOSE Initializing ProxyProviderSvc -ProxyProviderSvc VERBOSE ServiceLocatorHelper::service: found service EventPersistencySvc HistoryStore VERBOSE Initializing HistoryStore HistoryStore_Impl VERBOSE Initializing HistoryStore_Impl EventLoopMgr WARNING Unable to locate service "EventSelector" diff --git a/Control/AthenaServices/src/MixingEventSelector.cxx b/Control/AthenaServices/src/MixingEventSelector.cxx index 4b0689fb5cc5b666c70d2476dc59548a8f696f05..8a5bf21eaab41cf1af035ca6a5a81d206ad3671d 100644 --- a/Control/AthenaServices/src/MixingEventSelector.cxx +++ b/Control/AthenaServices/src/MixingEventSelector.cxx @@ -45,7 +45,7 @@ ofstream outfile2("status.txt"); #endif MixingEventSelector::MixingEventSelector(const string& name, ISvcLocator* svc) : - extends<AthService, IEvtSelector, IConverter>(name,svc), + base_class(name,svc), m_helperTools(this), m_trigList(), m_pCurrentTrigger(m_trigList.end()), m_eventPos(0), diff --git a/Control/AthenaServices/src/MixingEventSelector.h b/Control/AthenaServices/src/MixingEventSelector.h index 576be42ecb3c82a384da3ea2dbd1ae6532a95511..d768948c94277288202d503ed7c8945274f0cbb1 100644 --- a/Control/AthenaServices/src/MixingEventSelector.h +++ b/Control/AthenaServices/src/MixingEventSelector.h @@ -1,7 +1,7 @@ /* -*- C++ -*- */ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #ifndef ATHENASERVICES_MIXINGEVENTSELECTOR_H @@ -66,8 +66,7 @@ namespace CLHEP { * */ class MixingEventSelector - : public extends<AthService, IEvtSelector, IConverter>, - virtual public IAddressProvider + : public extends<AthService, IEvtSelector, IConverter, IAddressProvider> { public: /** @class Context diff --git a/Control/SGComps/src/AddressRemappingSvc.cxx b/Control/SGComps/src/AddressRemappingSvc.cxx index 881743e11b576b3e7861e80b4c42b272a9778cef..b75aa63a126f5af8d44beb0ede65dd2e45477eb6 100644 --- a/Control/SGComps/src/AddressRemappingSvc.cxx +++ b/Control/SGComps/src/AddressRemappingSvc.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /** @file AddressRemappingSvc.cxx @@ -33,7 +33,7 @@ //________________________________________________________________________________ AddressRemappingSvc::AddressRemappingSvc(const std::string& name, ISvcLocator* pSvcLocator) : - extends1<AthService, Athena::IInputRename>(name, pSvcLocator), + base_class(name, pSvcLocator), m_clidSvc("ClassIDSvc", name), m_RCUSvc("Athena::RCUSvc", name), m_oldTads(), diff --git a/Control/SGComps/src/AddressRemappingSvc.h b/Control/SGComps/src/AddressRemappingSvc.h index 90e229e9f1b12837a341a1bea1b911391004e9a6..3912581eae9edba043b827f5611c2270e05f46f7 100644 --- a/Control/SGComps/src/AddressRemappingSvc.h +++ b/Control/SGComps/src/AddressRemappingSvc.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #ifndef SGCOMPS_ADDRESSREMAPPINGSVC_H @@ -37,7 +37,7 @@ class IRCUSvc; * @brief This class provides the interface to the LCG POOL persistency software. **/ class AddressRemappingSvc - : public extends<AthService, Athena::IInputRename>, public IAddressProvider + : public extends<AthService, Athena::IInputRename, IAddressProvider> { public: diff --git a/Control/SGComps/src/ProxyProviderSvc.cxx b/Control/SGComps/src/ProxyProviderSvc.cxx index 2c4f0a68250b3a59ecb105741eac92948209a1c7..648948db8311fec4840a0f52e2d37fcdd9bbcb60 100644 --- a/Control/SGComps/src/ProxyProviderSvc.cxx +++ b/Control/SGComps/src/ProxyProviderSvc.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include <algorithm> @@ -50,7 +50,9 @@ const SG::BaseInfoBase* getBaseInfo (CLID clid) ProxyProviderSvc::ProxyProviderSvc(const std::string& name, ISvcLocator* svcLoc): - base_class(name, svcLoc){ + base_class(name, svcLoc), + m_pDataLoader("EventPersistencySvc", name) +{ m_providerNames.declareUpdateHandler(&ProxyProviderSvc::providerNamesPropertyHandler, this); } @@ -61,26 +63,15 @@ ProxyProviderSvc::initialize() { ATH_MSG_VERBOSE( "Initializing " << name() ); - const bool CREATEIF(true); - // cache pointer to Persistency Service - if (!(service("EventPersistencySvc", m_pDataLoader, CREATEIF)).isSuccess()) { - m_pDataLoader = 0; - ATH_MSG_ERROR("Could not get pointer to Persistency Service"); - return StatusCode::FAILURE; - } else { -#ifdef DEBUGPPS - ATH_MSG_VERBOSE("Got pointer to Persistency Service " << m_pDataLoader); -#endif - } + // retrieve Persistency Service + ATH_CHECK( m_pDataLoader.retrieve() ); - //get properties set; - if(!(AthService::initialize()).isSuccess()) { - return StatusCode::FAILURE; - } + // get properties set + ATH_CHECK( AthService::initialize() ); // Take care of any pending preLoadProxies requests. for (IProxyRegistry* reg : m_pendingLoad) { - CHECK( doPreLoadProxies (*reg) ); + ATH_CHECK( doPreLoadProxies (*reg) ); } m_pendingLoad.clear(); @@ -197,7 +188,7 @@ ProxyProviderSvc::addAddress(IProxyRegistry& store, bool resetOnly(tAddr.name().substr(0,10) != std::string("HLTAutoKey")); // std::cout << "PPS:addAdress: proxy for key " << tAddr->name() << " has resetOnly " << resetOnly << std::endl; SG::DataProxy* dp = new SG::DataProxy(std::move(tAddr), - m_pDataLoader, true, resetOnly ); + m_pDataLoader.get(), true, resetOnly ); // Must add the primary CLID first. bool addedProxy = store.addToStore(dp->clID(), dp).isSuccess(); @@ -306,18 +297,14 @@ ProxyProviderSvc::providerNamesPropertyHandler( Gaudi::Details::PropertyBase& /* } for (const std::string& pName : providerNames) { - IService *pIS(0); - IAddressProvider *pAP(0); - Gaudi::Utils::TypeNameString tn(pName); - if (!(service(tn.type(), tn.name(), pIS)).isSuccess() || - 0 == (pAP = dynamic_cast<IAddressProvider*>(pIS))) { + SmartIF<IAddressProvider> pAP{service(pName)}; + if (!pAP) { ATH_MSG_ERROR(" getting Address Provider "<< pName); throw GaudiException("Failed to locate address provider", "ProxyProviderSvc::providerNamesPropertyHandle", StatusCode::FAILURE); - } else { - ATH_MSG_DEBUG(" added Address Provider "<< pIS->name()); + ATH_MSG_DEBUG(" added Address Provider "<< pName); } ProxyProviderSvc::addProvider(pAP); } diff --git a/Control/SGComps/src/ProxyProviderSvc.h b/Control/SGComps/src/ProxyProviderSvc.h index 2eefe9dc933ab87e2b31dc43971815856beb0d15..77322e7021f6fd1665f9823bcbadebde4c536979 100644 --- a/Control/SGComps/src/ProxyProviderSvc.h +++ b/Control/SGComps/src/ProxyProviderSvc.h @@ -1,13 +1,12 @@ // -*- C++ -*- /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /** @file ProxyProviderSvc.h @brief manages the address providers and add proxies on demand to the store * @author Paolo Calafiura <pcalafiura@lbl.gov> - ATLAS Collaboration - * $Id: ProxyProviderSvc.h,v 1.3 2008-03-05 21:57:44 gemmeren Exp $ */ @@ -110,7 +109,7 @@ private: /// the providers we know about. WE DON'T OWN THEM std::list<IAddressProvider*> m_providers; /// Persistency Service - IConversionSvc* m_pDataLoader{nullptr}; + ServiceHandle<IConversionSvc> m_pDataLoader; /// List of pending stores on which to run preLoadProxies(). std::vector<IProxyRegistry*> m_pendingLoad; diff --git a/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/ByteStreamAddressProviderSvc.h b/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/ByteStreamAddressProviderSvc.h index 840710540201cadde13ef37c3ba30ac70c374472..66f2ec77b7d5805140ce7abb923f39e2f4e24d4e 100755 --- a/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/ByteStreamAddressProviderSvc.h +++ b/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/ByteStreamAddressProviderSvc.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #ifndef BYTESTREAMCNVSVCBASE_BYTESTREAMADDRESSPROVIDERSVC_H @@ -16,14 +16,10 @@ class IClassIDSvc; -template <class TYPE> class SvcFactory; - /** @class ByteStreamAddressProviderSvc - @brief An concrete IAddressProvider + @brief A concrete IAddressProvider */ -class ByteStreamAddressProviderSvc : public ::AthService, public virtual IAddressProvider { - /// Allow the factory class access to the constructor - friend class SvcFactory<ByteStreamAddressProviderSvc>; +class ByteStreamAddressProviderSvc : public extends<AthService, IAddressProvider> { public: ByteStreamAddressProviderSvc(const std::string& name, ISvcLocator* pSvcLocator); diff --git a/Event/ByteStreamCnvSvcBase/src/ByteStreamAddressProviderSvc.cxx b/Event/ByteStreamCnvSvcBase/src/ByteStreamAddressProviderSvc.cxx index c84b768c97e08ab0028326e02d2fd180867d0213..69f93f8ed49ca8f1dc064e22b01b82a7646d7077 100755 --- a/Event/ByteStreamCnvSvcBase/src/ByteStreamAddressProviderSvc.cxx +++ b/Event/ByteStreamCnvSvcBase/src/ByteStreamAddressProviderSvc.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ // Include files @@ -15,7 +15,7 @@ /// Standard constructor ByteStreamAddressProviderSvc::ByteStreamAddressProviderSvc(const std::string& name, ISvcLocator* pSvcLocator) : - ::AthService(name, pSvcLocator), + base_class(name, pSvcLocator), m_clidSvc("ClassIDSvc", name), m_storeID(StoreID::EVENT_STORE) { declareProperty("StoreID", m_storeID); diff --git a/LArCalorimeter/LArRecUtils/src/LArFlatConditionSvc.cxx b/LArCalorimeter/LArRecUtils/src/LArFlatConditionSvc.cxx index 26f5c9e067498eec8344e6d0ce85bc7bc940d862..c67f12f4a6b648919fe008167f21ac38165485ab 100644 --- a/LArCalorimeter/LArRecUtils/src/LArFlatConditionSvc.cxx +++ b/LArCalorimeter/LArRecUtils/src/LArFlatConditionSvc.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "LArFlatConditionSvc.h" @@ -37,7 +37,7 @@ LArFlatConditionSvc::LArFlatConditionSvc( const std::string& name, ISvcLocator* svc ) - : AthService( name, svc ), + : base_class( name, svc ), m_IOVSvc ("IOVSvc", name), m_detStore ("DetectorStore", name), m_clidSvc ("ClassIDSvc", name), diff --git a/LArCalorimeter/LArRecUtils/src/LArFlatConditionSvc.h b/LArCalorimeter/LArRecUtils/src/LArFlatConditionSvc.h index 19ba09537b4fd38fc9c660ceaeb515fc3658fb94..37b15bab37f72de7df3a8abafc1b70972522a504 100644 --- a/LArCalorimeter/LArRecUtils/src/LArFlatConditionSvc.h +++ b/LArCalorimeter/LArRecUtils/src/LArFlatConditionSvc.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ //Dear emacs, this is -*-c++-*- @@ -18,15 +18,9 @@ class StoreGateSvc; class IClassIDSvc; class CondAttrListCollection; - -template <class TYPE> class SvcFactory; - -class LArFlatConditionSvc : public virtual IAddressProvider, - public virtual IIncidentListener, - public AthService { - - friend class SvcFactory<LArFlatConditionSvc>; - +class LArFlatConditionSvc : public extends<AthService, + IAddressProvider, + IIncidentListener> { public: LArFlatConditionSvc( const std::string& name, ISvcLocator* svc ); virtual ~LArFlatConditionSvc(); @@ -37,13 +31,6 @@ class LArFlatConditionSvc : public virtual IAddressProvider, /// Service finalize virtual StatusCode finalize(); - /// Query the interfaces. - //virtual StatusCode queryInterface( const InterfaceID& riid, void** ppvInterface ); - //static const InterfaceID& interfaceID(); - - /// Service type. - ///virtual const InterfaceID& type() const; - /* IAddress provider interface */ typedef IAddressProvider::tadList tadlist; diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStream/MuonCalibStreamCnvSvc/MuonCalibStreamCnvSvc/MuonCalibStreamAddressProviderSvc.h b/MuonSpectrometer/MuonCalib/MuonCalibStream/MuonCalibStreamCnvSvc/MuonCalibStreamCnvSvc/MuonCalibStreamAddressProviderSvc.h index 336407d0d4ec30c33bbd66309ada694dc395b2aa..64de4fe201abbdb8d7f1dcca263c26424194968c 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStream/MuonCalibStreamCnvSvc/MuonCalibStreamCnvSvc/MuonCalibStreamAddressProviderSvc.h +++ b/MuonSpectrometer/MuonCalib/MuonCalibStream/MuonCalibStreamCnvSvc/MuonCalibStreamCnvSvc/MuonCalibStreamAddressProviderSvc.h @@ -9,13 +9,7 @@ #include "GaudiKernel/ClassID.h" #include "MuonCalibStreamCnvSvc/IMuonCalibStreamDataProviderSvc.h" -// Forward declarations - -template <class TYPE> class SvcFactory; - -class MuonCalibStreamAddressProviderSvc : public virtual AthService, public virtual IAddressProvider { - /// Allow the factory class access to the constructor - friend class SvcFactory<MuonCalibStreamAddressProviderSvc>; +class MuonCalibStreamAddressProviderSvc : public extends<AthService, IAddressProvider> { public: MuonCalibStreamAddressProviderSvc(const std::string &name, ISvcLocator *svcloc); diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStream/MuonCalibStreamCnvSvc/src/MuonCalibStreamAddressProviderSvc.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStream/MuonCalibStreamCnvSvc/src/MuonCalibStreamAddressProviderSvc.cxx index 0172dd234623782ada83657a336030453468a7f5..64db4ae61549195c1eb558d7272d7315154aedf7 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStream/MuonCalibStreamCnvSvc/src/MuonCalibStreamAddressProviderSvc.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStream/MuonCalibStreamCnvSvc/src/MuonCalibStreamAddressProviderSvc.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibStreamCnvSvc/MuonCalibStreamAddressProviderSvc.h" @@ -10,7 +10,7 @@ /// Standard constructor MuonCalibStreamAddressProviderSvc::MuonCalibStreamAddressProviderSvc(const std::string &name, ISvcLocator *svc) : - AthService(name, svc), m_dataSvc(nullptr) { + base_class(name, svc), m_dataSvc(nullptr) { m_typeNames.push_back("Muon::MdtPrepDataContainer/MDT_DriftCircles"); m_typeNames.push_back("RpcPadContainer/RPCPAD"); m_typeNames.push_back("TgcRdoContainer/TGCRDO"); diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGCCablingDbTool.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGCCablingDbTool.h index 4b659ee986a4f6583c6f2aabd213dbf081d24196..da8649940fc9fe59b13135a03cb9b156e1e75c24 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGCCablingDbTool.h +++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGCCablingDbTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #ifndef MUONCONDINTERFACE_ITGCCABLINGDBTOOL_H @@ -15,11 +15,11 @@ #include <string> #include <vector> -static const InterfaceID IID_ITGCCablingDbTool("ITGCCablingDbTool", 1, 0); -class ITGCCablingDbTool : virtual public IAlgTool, virtual public IAddressProvider { + +class ITGCCablingDbTool : virtual public extend_interfaces<IAlgTool, IAddressProvider> { public: - static const InterfaceID& interfaceID() { return IID_ITGCCablingDbTool; }; + DeclareInterfaceID(ITGCCablingDbTool, 1, 0); virtual StatusCode loadParameters(IOVSVC_CALLBACK_ARGS) = 0; diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGCTriggerDbTool.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGCTriggerDbTool.h index e90ccacaaf50b7ff8a5ad9293165501b1593a484..08b07ba6b9b061da3fe3f1f8a92aef5d35849f26 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGCTriggerDbTool.h +++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGCTriggerDbTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #ifndef MUONCONDINTERFACE_ITGCTRIGGERDBTOOL_H @@ -10,15 +10,13 @@ #include "AthenaKernel/IOVSvcDefs.h" #include "GaudiKernel/IAlgTool.h" -// class TgcIdHelper; - #include <string> #include <vector> -static const InterfaceID IID_ITGCTriggerDbTool("ITGCTriggerDbTool", 1, 0); - -class ITGCTriggerDbTool : virtual public IAlgTool, virtual public IAddressProvider { +class ITGCTriggerDbTool : virtual public extend_interfaces<IAlgTool, IAddressProvider> { public: + DeclareInterfaceID(ITGCTriggerDbTool, 1, 0); + enum { CW_BW = 0, CW_EIFI = 1, CW_TILE = 2, CW_NUM = 3 }; virtual std::string getFolderName(int cwtype) const = 0; @@ -30,8 +28,6 @@ public: virtual std::string getType(int cwtype, int channel = 0) const = 0; virtual bool isActive(int cwtype, int channel = 0) const = 0; - static const InterfaceID& interfaceID() { return IID_ITGCTriggerDbTool; }; - virtual StatusCode loadParameters(IOVSVC_CALLBACK_ARGS) = 0; }; diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGC_STATUSConditionsTool.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGC_STATUSConditionsTool.h index e231f94bc417b9a58777b3b43f639e6de81e3c86..7ca2cbb8f50b9a55b5a119f43b7355f7ab2527dc 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGC_STATUSConditionsTool.h +++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGC_STATUSConditionsTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #ifndef MUONCONDINTERFACE_ITGC_STATUSCONDITIONSTOOL_H @@ -18,11 +18,9 @@ //* retrieving of tables from DB virtual interface //********************************************************* -static const InterfaceID IID_ITGC_STATUSConditionsTool("ITGC_STATUSConditionsTool", 1, 0); - -class ITGC_STATUSConditionsTool : virtual public IAlgTool, virtual public IAddressProvider { +class ITGC_STATUSConditionsTool : virtual public extend_interfaces<IAlgTool, IAddressProvider> { public: - static const InterfaceID& interfaceID() { return IID_ITGC_STATUSConditionsTool; }; + DeclareInterfaceID(ITGC_STATUSConditionsTool, 1, 0); virtual std::string FolderName() const = 0;