From 977bd0fcfdb74c961218ed3e47448555736f654c Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 1 Apr 2020 16:55:07 +0200
Subject: [PATCH] StoreGate: Allow returning range through
 WriteCondHandle::isValid.

Extend WriteCondHandle::isValid to allow also returning the corresponding
IOV range.
---
 Control/StoreGate/StoreGate/WriteCondHandle.h | 26 +++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/Control/StoreGate/StoreGate/WriteCondHandle.h b/Control/StoreGate/StoreGate/WriteCondHandle.h
index d0cc3fec19ef..546d2edda15e 100644
--- a/Control/StoreGate/StoreGate/WriteCondHandle.h
+++ b/Control/StoreGate/StoreGate/WriteCondHandle.h
@@ -40,9 +40,12 @@ namespace SG {
     const std::string& key() const { return m_hkey.key(); }
     const DataObjID& fullKey() const { return m_hkey.fullKey(); }
 
-    bool isValid();
+    bool isValid() const;
     bool isValid(const EventIDBase& t) const;
 
+    bool isValid(EventIDRange& range) const;
+    bool isValid(const EventIDBase& t, EventIDRange& range) const;
+
     template <typename R>
     void addDependency(SG::ReadCondHandle<R>& rch);
 
@@ -243,13 +246,32 @@ namespace SG {
 
   template <typename T>
   bool 
-  WriteCondHandle<T>::isValid() {
+  WriteCondHandle<T>::isValid() const {
 
     return (m_cc->valid(m_ctx.eventID()));
   }
 
   //---------------------------------------------------------------------------
 
+  template <typename T>
+  bool 
+  WriteCondHandle<T>::isValid(const EventIDBase& t, EventIDRange& range) const {
+
+    return (m_cc->range(t, range));
+  }
+
+
+  //---------------------------------------------------------------------------
+
+  template <typename T>
+  bool 
+  WriteCondHandle<T>::isValid (EventIDRange& range) const {
+
+    return (m_cc->range(m_ctx.eventID(), range));
+  }
+
+  //---------------------------------------------------------------------------
+
   // Can't take a const RCH, as RCH.range() can load the ptr.
   template <typename T>
   template< typename R>
-- 
GitLab