table: don't share Strategy instance among StrategyChoice entries
For a Strategy type registered in the strategy registry,
a new instance is created for each StrategyChoice entry that uses it.
StrategyChoice::install is deprecated. An installed strategy instance
is still shared among StrategyChoice entries that use it. This will
be removed after unit tests switch to use the strategy registry.
refs #3868
Change-Id: Ibca685e6b6668f64fa1a503e3575867e8babdfe1
diff --git a/daemon/table/strategy-choice.hpp b/daemon/table/strategy-choice.hpp
index f2410e2..2c492cd 100644
--- a/daemon/table/strategy-choice.hpp
+++ b/daemon/table/strategy-choice.hpp
@@ -67,26 +67,26 @@
void
setDefaultStrategy(const Name& strategyName);
- /** \brief install all strategies from registry
- */
- void
- installFromRegistry();
-
/** \brief determines if a strategy is installed
* \param strategyName name of the strategy
* \param isExact true to require exact match, false to permit unversioned strategyName
* \return true if strategy is installed
*/
+ DEPRECATED(
bool
- hasStrategy(const Name& strategyName, bool isExact = false) const;
+ hasStrategy(const Name& strategyName, bool isExact = false) const);
+
+ // DEPRECATED macro does not work when this type appears inline on install function.
+ typedef std::pair<bool, fw::Strategy*> InstallResult;
/** \brief install a strategy
* \return if installed, true, and a pointer to the strategy instance;
* if not installed due to duplicate strategyName, false,
* and a pointer to the existing strategy instance
*/
- std::pair<bool, fw::Strategy*>
- install(unique_ptr<fw::Strategy> strategy);
+ DEPRECATED(
+ InstallResult
+ install(unique_ptr<fw::Strategy> strategy));
public: // Strategy Choice table
/** \brief set strategy of prefix to be strategyName