From 6971bf5ffc70189a05efc0647268bc11918e018c Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 17 Jun 2023 12:40:47 -0400
Subject: [PATCH] StoreGate: Remove deprecated methods.

Remove deprecated, now unused, methods.
---
 Control/StoreGate/StoreGate/StoreGateSvc.h    |  57 ------
 Control/StoreGate/StoreGate/StoreGateSvc.icc  | 182 ------------------
 Control/StoreGate/StoreGate/tools/SGImplSvc.h |  12 --
 Control/StoreGate/src/SGImplSvc.cxx           |   9 -
 Control/StoreGate/src/StoreGateSvc.cxx        |   9 -
 Control/StoreGate/test/VarHandles_test.cxx    |  16 +-
 6 files changed, 8 insertions(+), 277 deletions(-)

diff --git a/Control/StoreGate/StoreGate/StoreGateSvc.h b/Control/StoreGate/StoreGate/StoreGateSvc.h
index 0bc9517000f..b104366aaa9 100644
--- a/Control/StoreGate/StoreGate/StoreGateSvc.h
+++ b/Control/StoreGate/StoreGate/StoreGateSvc.h
@@ -60,11 +60,6 @@
 
 #include "GaudiKernel/IIncidentListener.h"
 
-#ifdef SG_DEPRECATION_WARNINGS
-# define SG_DEPRECATED __attribute__((deprecated))
-#else
-# define SG_DEPRECATED
-#endif
 
 //forward declarations
 namespace SG {
@@ -1019,58 +1014,6 @@ private:
                          const SG::NoAuxStore*) const;
   
 
-public:
-  ///////////////////////////////////////////////////////////////////////
-  /// \name Obsolete and Deprecated methods 
-  //@{
-  /// DEPRECATED: Retrieve the default object into a const DataHandle
-  template <typename T> 
-  StatusCode SG_DEPRECATED retrieve ATLAS_NOT_THREAD_SAFE (const DataHandle<T>& handle) const;
-
-  /// DEPRECATED: Retrieve the default object into a DataHandle
-  template <typename T> 
-  StatusCode SG_DEPRECATED retrieve ATLAS_NOT_THREAD_SAFE (DataHandle<T>& handle) const;
-
-  /// DEPRECATED: Retrieve an object with "key", into a const DataHandle
-  template <typename T, typename TKEY> 
-  StatusCode SG_DEPRECATED retrieve ATLAS_NOT_THREAD_SAFE (const DataHandle<T>& handle, const TKEY& key) const;
-  /// DEPRECATED: Retrieve an object with "key", into a DataHandle
-  template <typename T, typename TKEY> 
-  StatusCode SG_DEPRECATED retrieve ATLAS_NOT_THREAD_SAFE (DataHandle<T>& handle, const TKEY& key) const;
-
-  /// DEPRECATED Retrieve all objects of type T: use iterators version instead
-  template <typename T> 
-  StatusCode SG_DEPRECATED retrieve ATLAS_NOT_THREAD_SAFE (const DataHandle<T>& begin, 
-                                                           const DataHandle<T>& end) const;
-  /// DEPRECATED, use version taking ref to vector
-  template <typename T>
-  std::vector<std::string> //FIXME inefficient. Should take ref to vector
-  SG_DEPRECATED keys(bool allKeys = false) const;
- 
-  /// DEPRECATED, use version taking ref to vector
-  std::vector<std::string> //FIXME inefficient. Should take ref to vector 
-  SG_DEPRECATED keys(const CLID& id, bool allKeys = false) const;
-
-  /// DEPRECATED:  use recordAddress instead
-  StatusCode SG_DEPRECATED createProxy(IOpaqueAddress* pAddress, bool clearAddressFlag=true) {
-    return recordAddress(pAddress, clearAddressFlag);
-  }  
-
-  /// DEPRECATED put a dobj pointer in a bucket as appropriate
-  /// see AthenaKernel/StorableConversion.h for replacement
-  template <typename T>
-  static 
-  DataObject* SG_DEPRECATED asStorable(T* pDObj);
-
-  /// DEPRECATED gets a dobj pointer from a bucket as appropriate
-  /// see AthenaKernel/StorableConversion.h for replacement
-  template <typename T>
-  static 
-  bool SG_DEPRECATED fromStorable(DataObject* pObject, T*& pData);
-
-  //@}
-
-
 private:
   StoreGateSvc (const StoreGateSvc&);
   StoreGateSvc& operator= (const StoreGateSvc&);
diff --git a/Control/StoreGate/StoreGate/StoreGateSvc.icc b/Control/StoreGate/StoreGate/StoreGateSvc.icc
index a061a601541..a424e9fe110 100644
--- a/Control/StoreGate/StoreGate/StoreGateSvc.icc
+++ b/Control/StoreGate/StoreGate/StoreGateSvc.icc
@@ -900,188 +900,6 @@ StoreGateSvc::remap (CLID clid,
 }
 
 
-/// DEPRECATED: Retrieve the default object into a const DataHandle
-template <typename T> 
-StatusCode 
-StoreGateSvc::retrieve(const DataHandle<T>& handle) const {
-  if (m_storeID == StoreID::EVENT_STORE && currentSlot() != nullptr) {
-    rememberBadRetrieve (ClassID_traits<T>::ID(), "");
-  }
-
-  SG::DataProxy* dp(this->proxy(ClassID_traits<T>::ID()));
-  StatusCode sc = handle.setState(dp);
-
-  if (sc.isFailure()) {
-    warning() 
-          << "retrieve(default): No valid proxy for default object \n" 
-          << " of type "  << ClassID_traits<T>::typeName() << "(CLID " 
-          << ClassID_traits<T>::ID() << ')' << endmsg;
-  }
-  else {
-    // Skip associateAux for this deprecated method.
-#ifndef NDEBUG
-    SG_MSG_DEBUG("retrieve(default): Retrieved const handle to default object \n" 
-                 << " of type "  << ClassID_traits<T>::typeName() 
-                 << "(CLID " << ClassID_traits<T>::ID() << ')');
-#endif
-  }
-  return sc;
-}
-
-/// DEPRECATED: Retrieve the default object into a DataHandle
-template <typename T> 
-StatusCode
-StoreGateSvc::retrieve(DataHandle<T>& handle) const {
-  if (m_storeID == StoreID::EVENT_STORE && currentSlot() != nullptr) {
-    rememberBadRetrieve (ClassID_traits<T>::ID(), "");
-  }
-
-  SG::DataProxy* dp(this->proxy(ClassID_traits<T>::ID()));
-  StatusCode sc = handle.setState(dp);
-
-  if (sc.isFailure()) {
-    warning() 
-          << "retrieve(default): No valid proxy for default object " 
-          << " of type "  << ClassID_traits<T>::typeName() << "(CLID "
-          << ClassID_traits<T>::ID() << ")\n Try to use a const DataHandle " 
-          << endmsg;
-  }
-  else {
-    // Skip associateAux for this deprecated method.
-#ifndef NDEBUG
-    SG_MSG_DEBUG("Retrieved non-const handle to default object " 
-                 << " of type "  << ClassID_traits<T>::typeName() 
-                 << "(CLID " << ClassID_traits<T>::ID() << ')');
-#endif
-  }
-
-  return sc;
-}
-
-/// DEPRECATED: Retrieve an object with "key", into a const DataHandle
-template <typename T, typename TKEY> 
-StatusCode 
-StoreGateSvc::retrieve(const DataHandle<T>& handle, const TKEY& key) const {
-  if (m_storeID == StoreID::EVENT_STORE && currentSlot() != nullptr) {
-    rememberBadRetrieve (ClassID_traits<T>::ID(), key);
-  }
-
-#ifndef __clang__
-  BOOST_CONCEPT_ASSERT( (KeyConcept<TKEY>) );
-#endif
-
-  SG::DataProxy* dp(this->proxy(ClassID_traits<T>::ID(), (std::string)key, false));
-  StatusCode sc = handle.setState(dp);
-
-  if (sc.isFailure()) {
-    warning() 
-          << "retrieve(const): No valid proxy for object " << key  << ' ' 
-          << " of type "  << ClassID_traits<T>::typeName() << "(CLID "
-          << ClassID_traits<T>::ID() << ')' << endmsg;
-  }
-  else {
-    // Skip associateAux for this deprecated method.
-#ifndef NDEBUG
-    SG_MSG_DEBUG( "Retrieved const handle to object " << key  << ' '
-                  << " of type "  << ClassID_traits<T>::typeName() 
-                  << "(CLID " << ClassID_traits<T>::ID() << ')');
-#endif
-  }
-  return sc;
-}
-
-/// DEPRECATED: Retrieve an object with "key", into a DataHandle
-template <typename T, typename TKEY> 
-StatusCode 
-StoreGateSvc::retrieve(DataHandle<T>& handle, const TKEY& key) const {
-  if (m_storeID == StoreID::EVENT_STORE && currentSlot() != nullptr) {
-    rememberBadRetrieve (ClassID_traits<T>::ID(), key);
-  }
-
-#ifndef __clang__
-  BOOST_CONCEPT_ASSERT( (KeyConcept<TKEY>) );
-#endif
-
-  SG::DataProxy* dp(this->proxy(ClassID_traits<T>::ID(), (std::string)key, false));
-  StatusCode sc = handle.setState(dp);
-
-  if (sc.isFailure()) {
-    SG_MSG_WARNING("retrieve(non-const): No valid proxy for object "
-                   << (std::string)key  << ' ' 
-                   << " of type "  << ClassID_traits<T>::typeName() << "(CLID "
-                   << ClassID_traits<T>::ID() 
-                   << ") \n Try to use a const DataHandle" );
-  }
-  else {
-    // Skip associateAux for this deprecated method.
-#ifndef NDEBUG
-    SG_MSG_DEBUG("Retrieved non-const handle to object " << (std::string)key  
-                 << ' ' << " of type "  << ClassID_traits<T>::typeName() 
-                 << "(CLID " << ClassID_traits<T>::ID() << ')');
-#endif
-  }
-  return sc;
-}
-
-/// DEPRECATED Retrieve all objects of type T: use iterators version instead
-/// BE AWARE: Iteration over DataHandle is not thread-safe!
-template <typename T> 
-StatusCode 
-StoreGateSvc::retrieve(const DataHandle<T>& chbegin, 
-                       const DataHandle<T>& chend) const {
-  if (m_storeID == StoreID::EVENT_STORE && currentSlot() != nullptr) {
-    rememberBadRetrieve (ClassID_traits<T>::ID(), "(iterator)");
-  }
-
-  SG::ConstProxyIterator first;
-  SG::ConstProxyIterator end = first;
-
-  if (!(this->proxyRange(ClassID_traits<T>::ID(),first,end)).isSuccess()) {
-#ifndef NDEBUG
-    SG_MSG_DEBUG("retrieve(range): no object found " 
-                 << " of type "  << ClassID_traits<T>::typeName() 
-                 << "(CLID " << ClassID_traits<T>::ID() << ')');
-#endif
-  }
-
-  (chend.setState(end, end)).ignore();
-  
-  if (!(chbegin.setState(first, end)).isSuccess()) {
-#ifndef NDEBUG
-    SG_MSG_DEBUG("retrieve(range): Can't set DataHandle for object range " 
-                 << " of type "  << ClassID_traits<T>::typeName() 
-                 << "(CLID " << ClassID_traits<T>::ID() << ')');
-#endif
-    return StatusCode::FAILURE;
-  }
-
-  return StatusCode::SUCCESS;
-}
-
-/// DEPRECATED put a dobj pointer in a bucket as appropriate
-/// see AthenaKernel/StorableConversion.h for replacement
-template <typename T>
-DataObject* 
-StoreGateSvc::asStorable(T* pDObj) {
-  return SG::asStorable(pDObj);
-}
-/// DEPRECATED gets a dobj pointer from a bucket as appropriate
-/// see AthenaKernel/StorableConversion.h for replacement
-template <typename T> 
-bool 
-StoreGateSvc::fromStorable(DataObject* pObject, T*& pData) {
-  return SG::fromStorable(pObject, pData);
-}
-
-
-/// DEPRECATED, use version taking ref to vector
-template <typename T>
-std::vector<std::string> //FIXME inefficient. Should take ref to vector
-StoreGateSvc::keys(bool allKeys) const {
-  return this->keys(ClassID_traits<T>::ID(), allKeys);
-}
-
-
 /**
  * @brief Remember that retrieve() was called for a MT store.
  * @param clid CLID of the operation.
diff --git a/Control/StoreGate/StoreGate/tools/SGImplSvc.h b/Control/StoreGate/StoreGate/tools/SGImplSvc.h
index ec873584bae..4562932c2c0 100644
--- a/Control/StoreGate/StoreGate/tools/SGImplSvc.h
+++ b/Control/StoreGate/StoreGate/tools/SGImplSvc.h
@@ -618,7 +618,6 @@ private:
   ///access typeless_record
   friend class SG::VarHandleBase;                                                      
 
-  ///DEPRECATED: Return a _pointer_ to the DataStore
   SG::DataStore* store();
   const SG::DataStore* store() const;
 
@@ -739,17 +738,6 @@ private:
   mutable mutex_t m_mutex;
   mutable mutex_t m_remapMutex;
   mutable mutex_t m_stringPoolMutex;
-
-  
-public:
-  ///////////////////////////////////////////////////////////////////////
-  /// \name Obsolete and Deprecated methods 
-  //@{
-
-  /// DEPRECATED, use version taking ref to vector
-  std::vector<std::string> //FIXME inefficient. Should take ref to vector 
-  keys(const CLID id, bool allKeys = false);
-  //@}
 };
 
 
diff --git a/Control/StoreGate/src/SGImplSvc.cxx b/Control/StoreGate/src/SGImplSvc.cxx
index e71315a95d2..5b43ed7edd3 100644
--- a/Control/StoreGate/src/SGImplSvc.cxx
+++ b/Control/StoreGate/src/SGImplSvc.cxx
@@ -536,15 +536,6 @@ SGImplSvc::keys(const CLID& id, std::vector<std::string>& vkeys,
 } 
 
 
-// DEPRECATED
-std::vector<std::string> 
-SGImplSvc::keys(const CLID id, bool allKeys) {
-  std::vector<std::string> vkeys;
-  this->keys(id, vkeys, allKeys);
-  return vkeys;
-}
-
-
 bool SGImplSvc::isSymLinked(const CLID& linkID, DataProxy* dp)   
 {        
   return (0 != dp) ? dp->transientID(linkID) : false;        
diff --git a/Control/StoreGate/src/StoreGateSvc.cxx b/Control/StoreGate/src/StoreGateSvc.cxx
index dc89d18a2f8..be08844249f 100644
--- a/Control/StoreGate/src/StoreGateSvc.cxx
+++ b/Control/StoreGate/src/StoreGateSvc.cxx
@@ -114,15 +114,6 @@ StoreGateSvc::setConst(const void* pObject) {
   _SGXCALL(setConst, (pObject), StatusCode::FAILURE);
 }
 
-/// DEPRECATED, use version taking ref to vector
-std::vector<std::string> //FIXME inefficient. Should take ref to vector
-StoreGateSvc::keys(const CLID& id, bool allKeys) const {
-  std::vector<std::string> nullV;
-  _SGXCALL( keys, (id, allKeys), nullV );
-}
-
-
-
 
 /////////////////////////////////////////////////////////////
 /// Service initialization
diff --git a/Control/StoreGate/test/VarHandles_test.cxx b/Control/StoreGate/test/VarHandles_test.cxx
index ba7a3ea3fb9..62878a69a31 100644
--- a/Control/StoreGate/test/VarHandles_test.cxx
+++ b/Control/StoreGate/test/VarHandles_test.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 */
 
 #undef NDEBUG
@@ -72,7 +72,7 @@ namespace Athena_test {
     assert(!emptyProxy.isValid());
 
     //init with a valid proxy
-    DataProxy* pMyProxy(new DataProxy(StoreGateSvc::asStorable(new MyDataObj),
+    DataProxy* pMyProxy(new DataProxy(SG::asStorable(new MyDataObj),
 				      new TransientAddress(CLID(8000), "foo")));
     pMyProxy->addRef();
     ReadHandle<MyDataObj> hMyR;
@@ -159,7 +159,7 @@ namespace Athena_test {
     }
 
     //init with another copy of the same object and compare
-    DataProxy* pMyProxy2(new DataProxy(StoreGateSvc::asStorable(new MyDataObj),
+    DataProxy* pMyProxy2(new DataProxy(SG::asStorable(new MyDataObj),
 				       new TransientAddress(CLID(8000), "foo2")));
     UpdateHandle<MyDataObj> hMy2;
     assert(!hMy2.isInitialized());
@@ -173,7 +173,7 @@ namespace Athena_test {
     //assert(*hMy==*hMy2);
 
     const bool CONSTPROXY(true);
-    DataProxy* pMyProxy3(new DataProxy(StoreGateSvc::asStorable(new MyDataObj),
+    DataProxy* pMyProxy3(new DataProxy(SG::asStorable(new MyDataObj),
 				       new TransientAddress(CLID(8000), "foo3"), CONSTPROXY));
     ReadHandle<MyDataObj> hMy3;
     assert(hMy3.setState(pMyProxy3).isSuccess());
@@ -202,7 +202,7 @@ namespace Athena_test {
     const bool CONSTPROXY(true);
     const bool RESETONLY(true);
     
-    DataProxy* pNR(new DataProxy(StoreGateSvc::asStorable(new MyDataObj(33)),
+    DataProxy* pNR(new DataProxy(SG::asStorable(new MyDataObj(33)),
 				 new TransientAddress(CLID(8000), "noReset"),
 				 CONSTPROXY, !RESETONLY) );
     ReadHandle<MyDataObj> hNR ("noReset");
@@ -213,7 +213,7 @@ namespace Athena_test {
     assert(!hNR.isInitialized());
     assert(!hNR.isValid());
 
-    pNR = new DataProxy(StoreGateSvc::asStorable(new MyDataObj(33)),
+    pNR = new DataProxy(SG::asStorable(new MyDataObj(33)),
                         new TransientAddress(CLID(8000), "noReset"),
                         CONSTPROXY, !RESETONLY);
     assert(hNR.setState(pNR).isSuccess());
@@ -224,7 +224,7 @@ namespace Athena_test {
     assert(!hNR.isValid());
 
     //now with the RESETONLY
-    DataProxy* pRO(new DataProxy(StoreGateSvc::asStorable(new MyDataObj(44)),
+    DataProxy* pRO(new DataProxy(SG::asStorable(new MyDataObj(44)),
 				 new TransientAddress(CLID(8000), "noReset"),
 				 !CONSTPROXY, RESETONLY) );  
     pRO->addRef();
@@ -255,7 +255,7 @@ namespace Athena_test {
   void refCountTest () {
     std::vector<DataProxy*> vp;
     for (int i=0; i < 4; i++) {
-      DataProxy* dp = new DataProxy(StoreGateSvc::asStorable(new MyDataObj),
+      DataProxy* dp = new DataProxy(SG::asStorable(new MyDataObj),
 				    new TransientAddress(CLID(8000), "foo"));
       vp.push_back (dp);
     }
-- 
GitLab