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 {
73 std::pair<bool, fw::Strategy*>
74 install(unique_ptr<fw::Strategy> strategy);
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;
175 typedef std::map<Name, unique_ptr<fw::Strategy>> StrategyInstanceTable;
176 StrategyInstanceTable m_strategyInstances;
185 #endif // NFD_DAEMON_TABLE_STRATEGY_CHOICE_HPP bool hasStrategy(const Name &strategyName, bool isExact=false) const
determines if a strategy is installed
boost::range_iterator< Range >::type const_iterator
void erase(const Name &prefix)
make prefix to inherit strategy from its parent
std::pair< bool, fw::Strategy * > install(unique_ptr< fw::Strategy > strategy)
install a strategy
represents a Measurements entry
Copyright (c) 2011-2015 Regents of the University of California.
fw::Strategy & findEffectiveStrategy(const Name &prefix) const
get effective strategy for prefix
Name abstraction to represent an absolute name.
represents a Strategy Choice entry
const_iterator end() const
represents a forwarding strategy
bool insert(const Name &prefix, const Name &strategyName)
set strategy of prefix to be strategyName
boost::transformed_range< name_tree::GetTableEntry< Entry >, const name_tree::Range > Range
a common index structure for FIB, PIT, StrategyChoice, and Measurements
const_iterator begin() const
represents the Strategy Choice table
boost::iterator_range< Iterator > Range
a Forward Range of name tree entries
StrategyChoice(NameTree &nameTree, unique_ptr< fw::Strategy > defaultStrategy)