26 #ifndef NFD_DAEMON_TABLE_STRATEGY_CHOICE_HPP
27 #define NFD_DAEMON_TABLE_STRATEGY_CHOICE_HPP
32 #include <boost/range/adaptor/transformed.hpp>
38 namespace strategy_choice {
77 return m_status == OK;
83 return m_status == OK || m_status == EXCEPTION;
91 return static_cast<int>(m_status);
103 InsertResult(Status status,
const std::string& exceptionMessage =
"");
107 std::string m_exceptionMessage;
110 friend std::ostream&
operator<<(std::ostream&,
const InsertResult&);
120 insert(
const Name& prefix,
const Name& strategyName);
126 erase(
const Name& prefix);
131 std::pair<bool, Name>
132 get(
const Name& prefix)
const;
166 return this->getRange().begin();
175 return this->getRange().end();
180 changeStrategy(
Entry& entry,
188 findEffectiveStrategyImpl(
const K& key)
const;
204 using strategy_choice::StrategyChoice;
Main class of NFD's forwarding engine.
Base class of all forwarding strategies.
Represents an entry in the Measurements table.
A common index structure for FIB, PIT, StrategyChoice, and Measurements.
Represents an entry in the Interest table (PIT).
Represents an entry in the Strategy Choice table.
int getStatusCode() const
Get a status code for use in management command response.
bool isRegistered() const
friend std::ostream & operator<<(std::ostream &, const InsertResult &)
Represents the Strategy Choice table.
void erase(const Name &prefix)
Make prefix to inherit strategy from its parent.
boost::range_iterator< Range >::type const_iterator
StrategyChoice(Forwarder &forwarder)
boost::transformed_range< name_tree::GetTableEntry< Entry >, const name_tree::Range > Range
const_iterator end() const
InsertResult insert(const Name &prefix, const Name &strategyName)
Set strategy of prefix to be strategyName.
void setDefaultStrategy(const Name &strategyName)
Set the default strategy.
fw::Strategy & findEffectiveStrategy(const Name &prefix) const
Get effective strategy for prefix.
const_iterator begin() const
std::pair< bool, Name > get(const Name &prefix) const
Get strategy Name of prefix.
boost::iterator_range< Iterator > Range
A forward range of name tree entries.
std::ostream & operator<<(std::ostream &os, const StrategyChoice::InsertResult &res)