table: clear StrategyInfo only if Strategy type differs
refs #3868
Change-Id: I164ccba3bd6c69cef9d2ebba303f8d8d941aac99
diff --git a/daemon/fw/strategy.cpp b/daemon/fw/strategy.cpp
index 9f2dd19..4aeb015 100644
--- a/daemon/fw/strategy.cpp
+++ b/daemon/fw/strategy.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014-2016, Regents of the University of California,
+ * Copyright (c) 2014-2017, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -102,6 +102,12 @@
return instance;
}
+bool
+Strategy::areSameType(const Name& instanceNameA, const Name& instanceNameB)
+{
+ return Strategy::find(instanceNameA) == Strategy::find(instanceNameB);
+}
+
std::set<Name>
Strategy::listRegistered()
{
diff --git a/daemon/fw/strategy.hpp b/daemon/fw/strategy.hpp
index b7b7adb..99ed1dc 100644
--- a/daemon/fw/strategy.hpp
+++ b/daemon/fw/strategy.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014-2016, Regents of the University of California,
+ * Copyright (c) 2014-2017, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -70,6 +70,11 @@
static unique_ptr<Strategy>
create(const Name& instanceName, Forwarder& forwarder);
+ /** \return whether \p instanceNameA and \p instanceNameA will initiate same strategy type
+ */
+ static bool
+ areSameType(const Name& instanceNameA, const Name& instanceNameB);
+
/** \return registered versioned strategy names
*/
static std::set<Name>