diff --git a/Control/StoreGate/StoreGate/StoreGate.h b/Control/StoreGate/StoreGate/StoreGate.h deleted file mode 100644 index d0999a5db85b67723cb1e7774c1c74f696d86304..0000000000000000000000000000000000000000 --- a/Control/StoreGate/StoreGate/StoreGate.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef STOREGATE_STOREGATE_H -#define STOREGATE_STOREGATE_H - -/** @class StoreGate - * @brief a multipleton that provides access to StoreGateSvc instances - * @author ATLAS Collaboration - * $Id: StoreGate.h,v 1.10 2003-04-16 01:58:11 calaf Exp $ - **/ - -#include "StoreGate/StoreGateSvc.h" -#include <string> - -class NullType; -class ActiveStoreSvc; - -class StoreGate { -public: - /// returns active store ptr (see ActiveStoreSvc). Can be slow: use sparingly - static StoreGateSvc* pointer(); - /// returns active store ref (see ActiveStoreSvc). Can be slow: use sparingly - static StoreGateSvc& instance(); - /// returns ptr to ActiveStoreSvc. Cache it and use it to access active store - /// multiple times - static ActiveStoreSvc* activeStoreSvc(); - /** multipleton: get a store by name - * @param sgID name of the StoreGateSvc ptr to be returned */ - static StoreGateSvc* pointer(const std::string& sgID); - /** multipleton: get a store by name - * @param sgID name of the StoreGateSvc ptr to be returned - * @throws std::runtime_error if not found*/ - static StoreGateSvc& instance(const std::string& sgID); - - friend class NullType; //remove compiler warning - -protected: - ~StoreGate(); //FIXME avoid compiler warning for private -private: - //standard singleton stuff - StoreGate(); - StoreGate(StoreGate&); - StoreGate& operator=(const StoreGate&); -}; -#endif // STOREGATE_STOREGATE_H - - - - - diff --git a/Control/StoreGate/src/StoreGate.cxx b/Control/StoreGate/src/StoreGate.cxx deleted file mode 100644 index 7d3bccb215702adc027ae0d3a404656c4d5688a3..0000000000000000000000000000000000000000 --- a/Control/StoreGate/src/StoreGate.cxx +++ /dev/null @@ -1,115 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "StoreGate/StoreGate.h" -#include "StoreGate/ActiveStoreSvc.h" -#include "StoreGate/tools/hash_functions.h" - -#include <exception> -#include <iostream> - -#include "GaudiKernel/Bootstrap.h" -#include "GaudiKernel/Kernel.h" -#include "GaudiKernel/ISvcLocator.h" -#include "GaudiKernel/IService.h" - -using namespace std; - -ActiveStoreSvc* -getActiveStoreSvc() { - ActiveStoreSvc* pASG(0); - static const bool CREATEIF(true); - if ((Gaudi::svcLocator()->service("ActiveStoreSvc", pASG, CREATEIF)).isSuccess()) { - pASG->addRef(); //FIXME WHO RELEASES? - return pASG; - } else { -#ifndef NDEBUG - cerr << __FILE__ << ':' << __LINE__ << ": " - << "ERROR Could not locate ActiveStoreSvc " <<endl; -#endif - return 0; - } -} - -StoreGateSvc* -getStore() { - ActiveStoreSvc* pASG(0); - StoreGateSvc* pSG(0); - static const bool CREATEIF(true); - if ((Gaudi::svcLocator()->service("ActiveStoreSvc", pASG, CREATEIF)).isSuccess() && - 0 != (pSG = pASG->operator->())) { - pSG->addRef(); //FIXME WHO RELEASES? - return pSG; - } else { -#ifndef NDEBUG - cerr << __FILE__ << ':' << __LINE__ << ": " - << "ERROR Could not locate active StoreGate " <<endl; -#endif - return 0; - } -} - -StoreGateSvc* -getStore(std::string name) { - StoreGateSvc* pSGService(0); - static const bool CREATEIF(true); - if ((Gaudi::svcLocator()->service(name, pSGService, CREATEIF)).isSuccess()) { - pSGService->addRef(); - return pSGService; - } else { -#ifndef NDEBUG - cerr << __FILE__ << ':' << __LINE__ << ": " - << "ERROR Could not locate StoreGate " - << "instance named " << name << endl; -#endif - return 0; - } -} - -StoreGateSvc* -StoreGate::pointer() { - return getStore(); -} - - -StoreGateSvc& -StoreGate::instance() { - StoreGateSvc* ptr(pointer()); - if (0 == ptr) { - throw std::runtime_error("Could not locate active StoreGate "); - } - return *ptr; -} - -ActiveStoreSvc* -StoreGate::activeStoreSvc() { - return getActiveStoreSvc(); -} - -StoreGateSvc* -StoreGate::pointer(const std::string& sgID) { - return getStore(sgID); -} - - -StoreGateSvc& -StoreGate::instance(const std::string& sgID) { - StoreGateSvc* ptr(pointer(sgID)); - if (0 == ptr) { - throw std::runtime_error("Could not locate required StoreGate instance"); - } - return *ptr; -} - - - - - - - - - - - - diff --git a/Control/StoreGate/test/SGtests.cxx b/Control/StoreGate/test/SGtests.cxx index 543899ef3cfc57fd636beab9c5bccdd37783ecbf..c06235924c0ed51f47c092872ef0484e9ad3bf56 100644 --- a/Control/StoreGate/test/SGtests.cxx +++ b/Control/StoreGate/test/SGtests.cxx @@ -32,7 +32,6 @@ #include "StoreGate/SGWPtr.h" #include "StoreGate/WriteHandle.h" #include "StoreGate/ReadHandle.h" -#include "StoreGate/StoreGate.h" #include "StoreGate/StoreGateSvc.h" #include "SGTools/DataStore.h" #include "SGTools/SGVersionedKey.h" diff --git a/Control/StoreGate/test/WriteCondHandle_test.cxx b/Control/StoreGate/test/WriteCondHandle_test.cxx index 7a8329f150838affa86528a5902b39129fd3969a..2bd75d599174f4a72e19d232c2ce52d3c7b142da 100644 --- a/Control/StoreGate/test/WriteCondHandle_test.cxx +++ b/Control/StoreGate/test/WriteCondHandle_test.cxx @@ -23,7 +23,7 @@ #include "AthenaKernel/errorcheck.h" #include "AthenaKernel/ExtendedEventContext.h" #include "CxxUtils/checker_macros.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include <cassert> #include <iostream>