Base class for FwdStrategy deciders, used by router to decide whether to forward a Bundle based on the forwarding strategy. More...
#include <Decider.h>
Public Member Functions | |
virtual | ~Decider () |
Destructor. | |
virtual bool | operator() (const Bundle *) const =0 |
The decision function: return true if the strategy says to forward the Bundle; else false. | |
FwdStrategy::fwd_strategy_t | fwd_strategy () const |
Accessors. | |
const Link * | nexthop () const |
Accessors. | |
const BundleCore * | core () const |
Accessors. | |
const Table * | local_nodes () const |
Accessors. | |
const Table * | remote_nodes () const |
Accessors. | |
const Stats * | stats () const |
Accessors. | |
bool | is_relay () const |
Accessors. | |
Static Public Member Functions | |
static Decider * | decider (FwdStrategy::fwd_strategy_t fs, const Link *nexthop, BundleCore *core, const Table *local_nodes, const Table *remote_nodes, const Stats *stats=NULL, u_int max_forward=0, bool is_relay=true) |
Factory method for creating decider instance. | |
Protected Member Functions | |
Decider (FwdStrategy::fwd_strategy_t fs, const Link *nexthop, BundleCore *core, const Table *local, const Table *remote, const Stats *stats, bool is_relay) | |
Constructor. | |
Protected Attributes | |
FwdStrategy::fwd_strategy_t | fwd_strategy_ |
which strategy is in use | |
const Link * | next_hop_ |
next hop Link | |
BundleCore *const | core_ |
facade interface to Bundle host | |
const Table * | local_ |
local routing table | |
const Table * | remote_ |
peer's routing table | |
const Stats * | stats_ |
forwarding statistics per Bundle | |
bool | is_relay_ |
whether peer acts as a relay (forwards Bundles) |
Base class for FwdStrategy deciders, used by router to decide whether to forward a Bundle based on the forwarding strategy.
Definition at line 33 of file Decider.h.
virtual prophet::Decider::~Decider | ( | ) | [inline, virtual] |
prophet::Decider::Decider | ( | FwdStrategy::fwd_strategy_t | fs, | |
const Link * | nexthop, | |||
BundleCore * | core, | |||
const Table * | local, | |||
const Table * | remote, | |||
const Stats * | stats, | |||
bool | is_relay | |||
) | [inline, protected] |
const BundleCore* prophet::Decider::core | ( | ) | const [inline] |
Decider * prophet::Decider::decider | ( | FwdStrategy::fwd_strategy_t | fs, | |
const Link * | nexthop, | |||
BundleCore * | core, | |||
const Table * | local_nodes, | |||
const Table * | remote_nodes, | |||
const Stats * | stats = NULL , |
|||
u_int | max_forward = 0 , |
|||
bool | is_relay = true | |||
) | [inline, static] |
Factory method for creating decider instance.
Definition at line 225 of file Decider.h.
References prophet::FwdStrategy::GRTR, prophet::FwdStrategy::GRTR_MAX, prophet::FwdStrategy::GRTR_PLUS, prophet::FwdStrategy::GRTR_SORT, prophet::FwdStrategy::GTMX, prophet::FwdStrategy::GTMX_PLUS, prophet::FwdStrategy::INVALID_FS, and prophet::Link::nexthop().
Referenced by prophet::TLVCreator::offer().
FwdStrategy::fwd_strategy_t prophet::Decider::fwd_strategy | ( | ) | const [inline] |
bool prophet::Decider::is_relay | ( | ) | const [inline] |
const Table* prophet::Decider::local_nodes | ( | ) | const [inline] |
const Link* prophet::Decider::nexthop | ( | ) | const [inline] |
The decision function: return true if the strategy says to forward the Bundle; else false.
Implemented in prophet::FwdDeciderGRTR, prophet::FwdDeciderGTMX, prophet::FwdDeciderGRTRPLUS, and prophet::FwdDeciderGTMXPLUS.
const Table* prophet::Decider::remote_nodes | ( | ) | const [inline] |
const Stats* prophet::Decider::stats | ( | ) | const [inline] |
BundleCore* const prophet::Decider::core_ [protected] |
facade interface to Bundle host
Definition at line 85 of file Decider.h.
Referenced by core(), prophet::FwdDeciderGTMXPLUS::operator()(), prophet::FwdDeciderGRTRPLUS::operator()(), prophet::FwdDeciderGTMX::operator()(), and prophet::FwdDeciderGRTR::operator()().
bool prophet::Decider::is_relay_ [protected] |
whether peer acts as a relay (forwards Bundles)
Definition at line 89 of file Decider.h.
Referenced by is_relay(), prophet::FwdDeciderGTMXPLUS::operator()(), prophet::FwdDeciderGRTRPLUS::operator()(), prophet::FwdDeciderGTMX::operator()(), and prophet::FwdDeciderGRTR::operator()().
const Table* prophet::Decider::local_ [protected] |
local routing table
Definition at line 86 of file Decider.h.
Referenced by local_nodes(), and prophet::FwdDeciderGRTR::operator()().
const Link* prophet::Decider::next_hop_ [protected] |
next hop Link
Definition at line 84 of file Decider.h.
Referenced by nexthop(), prophet::FwdDeciderGTMXPLUS::operator()(), prophet::FwdDeciderGRTRPLUS::operator()(), prophet::FwdDeciderGTMX::operator()(), and prophet::FwdDeciderGRTR::operator()().
const Table* prophet::Decider::remote_ [protected] |
peer's routing table
Definition at line 87 of file Decider.h.
Referenced by prophet::FwdDeciderGTMXPLUS::operator()(), prophet::FwdDeciderGRTRPLUS::operator()(), prophet::FwdDeciderGRTR::operator()(), and remote_nodes().
const Stats* prophet::Decider::stats_ [protected] |
forwarding statistics per Bundle
Definition at line 88 of file Decider.h.
Referenced by prophet::FwdDeciderGTMXPLUS::operator()(), prophet::FwdDeciderGRTRPLUS::operator()(), and stats().