Represents the Strategy Choice table. More...
#include <daemon/table/strategy-choice.hpp>
Classes | |
class | InsertResult |
Public Types | |
using | const_iterator = boost::range_iterator< Range >::type |
using | Range = boost::transformed_range< name_tree::GetTableEntry< Entry >, const name_tree::Range > |
Public Member Functions | |
StrategyChoice (Forwarder &forwarder) | |
const_iterator | begin () const |
const_iterator | end () const |
void | erase (const Name &prefix) |
Make prefix to inherit strategy from its parent. More... | |
fw::Strategy & | findEffectiveStrategy (const measurements::Entry &measurementsEntry) const |
Get effective strategy for measurementsEntry . More... | |
fw::Strategy & | findEffectiveStrategy (const Name &prefix) const |
Get effective strategy for prefix . More... | |
fw::Strategy & | findEffectiveStrategy (const pit::Entry &pitEntry) const |
Get effective strategy for pitEntry . More... | |
template<typename K > | |
Strategy & | findEffectiveStrategyImpl (const K &key) const |
std::pair< bool, Name > | get (const Name &prefix) const |
Get strategy Name of prefix. More... | |
InsertResult | insert (const Name &prefix, const Name &strategyName) |
Set strategy of prefix to be strategyName . More... | |
void | setDefaultStrategy (const Name &strategyName) |
Set the default strategy. More... | |
size_t | size () const |
Represents the Strategy Choice table.
The Strategy Choice table maintains available Strategy types, and associates Name prefixes with Strategy types.
Each strategy is identified by a strategyName. It's recommended to include a version number as the last component of strategyName.
A Name prefix is owned by a strategy if a longest prefix match on the Strategy Choice table returns that strategy.
Definition at line 51 of file strategy-choice.hpp.
using nfd::strategy_choice::StrategyChoice::const_iterator = boost::range_iterator<Range>::type |
Definition at line 156 of file strategy-choice.hpp.
using nfd::strategy_choice::StrategyChoice::Range = boost::transformed_range<name_tree::GetTableEntry<Entry>, const name_tree::Range> |
Definition at line 155 of file strategy-choice.hpp.
|
explicit |
Definition at line 45 of file strategy-choice.cpp.
|
inline |
Definition at line 164 of file strategy-choice.hpp.
|
inline |
void nfd::strategy_choice::StrategyChoice::erase | ( | const Name & | prefix | ) |
Make prefix to inherit strategy from its parent.
Definition at line 136 of file strategy-choice.cpp.
Strategy & nfd::strategy_choice::StrategyChoice::findEffectiveStrategy | ( | const measurements::Entry & | measurementsEntry | ) | const |
Get effective strategy for measurementsEntry
.
This is equivalent to findEffectiveStrategy(measurementsEntry.getName())
Definition at line 198 of file strategy-choice.cpp.
Strategy & nfd::strategy_choice::StrategyChoice::findEffectiveStrategy | ( | const Name & | prefix | ) | const |
Get effective strategy for prefix
.
Definition at line 186 of file strategy-choice.cpp.
Strategy & nfd::strategy_choice::StrategyChoice::findEffectiveStrategy | ( | const pit::Entry & | pitEntry | ) | const |
Get effective strategy for pitEntry
.
This is equivalent to findEffectiveStrategy(pitEntry.getName())
Definition at line 192 of file strategy-choice.cpp.
Strategy& nfd::strategy_choice::StrategyChoice::findEffectiveStrategyImpl | ( | const K & | key | ) | const |
Definition at line 178 of file strategy-choice.cpp.
std::pair< bool, Name > nfd::strategy_choice::StrategyChoice::get | ( | const Name & | prefix | ) | const |
Get strategy Name of prefix.
Definition at line 161 of file strategy-choice.cpp.
StrategyChoice::InsertResult nfd::strategy_choice::StrategyChoice::insert | ( | const Name & | prefix, |
const Name & | strategyName | ||
) |
Set strategy of prefix
to be strategyName
.
prefix | the name prefix to change strategy |
strategyName | strategy instance name, may contain version and parameters; strategy must have been registered |
Definition at line 66 of file strategy-choice.cpp.
void nfd::strategy_choice::StrategyChoice::setDefaultStrategy | ( | const Name & | strategyName | ) |
Set the default strategy.
This must be called by forwarder constructor.
Definition at line 52 of file strategy-choice.cpp.
|
inline |
Definition at line 58 of file strategy-choice.hpp.