26 #ifndef NFD_DAEMON_TABLE_STRATEGY_CHOICE_HPP
27 #define NFD_DAEMON_TABLE_STRATEGY_CHOICE_HPP
32 #include <boost/range/adaptor/transformed.hpp>
35 namespace strategy_choice {
51 StrategyChoice(NameTree& nameTree, unique_ptr<fw::Strategy> defaultStrategy);
66 hasStrategy(
const Name& strategyName,
bool isExact =
false)
const;
73 std::pair<bool, fw::Strategy*>
74 install(unique_ptr<fw::Strategy> strategy);
88 insert(
const Name& prefix,
const Name& strategyName);
95 erase(
const Name& prefix);
100 std::pair<bool, Name>
101 get(
const Name& prefix)
const;
135 return this->getRange().begin();
144 return this->getRange().end();
152 getStrategy(
const Name& strategyName)
const;
155 setDefaultStrategy(unique_ptr<fw::Strategy> strategy);
158 changeStrategy(
Entry& entry,
166 findEffectiveStrategyImpl(
const K& key)
const;
172 NameTree& m_nameTree;
175 typedef std::map<Name, unique_ptr<fw::Strategy>> StrategyInstanceTable;
176 StrategyInstanceTable m_strategyInstances;
181 using strategy_choice::StrategyChoice;
185 #endif // NFD_DAEMON_TABLE_STRATEGY_CHOICE_HPP
represents a Measurements entry
represents the Strategy Choice table
boost::transformed_range< name_tree::GetTableEntry< Entry >, const name_tree::Range > Range
boost::range_iterator< Range >::type const_iterator
StrategyChoice(NameTree &nameTree, unique_ptr< fw::Strategy > defaultStrategy)
bool insert(const Name &prefix, const Name &strategyName)
set strategy of prefix to be strategyName
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
std::pair< bool, fw::Strategy * > install(unique_ptr< fw::Strategy > strategy)
install a strategy
represents a Strategy Choice entry
represents a forwarding strategy
boost::iterator_range< Iterator > Range
a Forward Range of name tree entries
const_iterator begin() const
fw::Strategy & findEffectiveStrategy(const Name &prefix) const
get effective strategy for prefix
bool hasStrategy(const Name &strategyName, bool isExact=false) const
determines if a strategy is installed
const_iterator end() const
void erase(const Name &prefix)
make prefix to inherit strategy from its parent