#include <ProphetLists.h>
Assumes ownership of memory pointed to by Node*
Definition at line 192 of file ProphetLists.h.
Public Types | |
| typedef std::map < EndpointID, ProphetNode *, less_eid_ > | rib_table |
| typedef std::map < EndpointID, ProphetNode *, less_eid_ > ::iterator | iterator |
Public Member Functions | |
| ProphetTable () | |
| Default constructor. | |
| ~ProphetTable () | |
| Destructor. | |
| ProphetNode * | find (const EndpointID &eid) const |
| Given an EndpointID, returns pointer to ProphetNode if found, else returns NULL. | |
| void | update (ProphetNode *node) |
| Given a pointer to ProphetNode*, assumes ownership of memory pointed to by *node, updates member (replacing if exists). | |
| size_t | dump_table (ProphetNodeList &list) const |
| Create copy of list. | |
| size_t | size () const |
| Returns number of members in ProphetTable. | |
| void | clear () |
| Frees memory pointed to by member nodes, then removes node pointers from list. | |
| iterator | begin () |
| Caller must hold lock() when calling iterator. | |
| iterator | end () |
| Caller must hold lock() when calling iterator. | |
| void | truncate (double epsilon) |
| For maintenance routines, remove any nodes with p_value < epsilon. | |
| oasys::SpinLock * | lock () |
| Returns a pointer to member SpinLock for synchronizing concurrent access. | |
| double | p_value (const Bundle *b) const |
| Convenience functions for looking up predictability value. | |
| double | p_value (const EndpointID &eid) const |
| Convenience functions for looking up predictability value. | |
Protected Member Functions | |
| void | free () |
| Clean up memory pointed to by member variables. | |
Protected Attributes | |
| oasys::SpinLock * | lock_ |
| rib_table | table_ |
| typedef std::map<EndpointID,ProphetNode*,less_eid_> dtn::ProphetTable::rib_table |
Definition at line 195 of file ProphetLists.h.
| typedef std::map<EndpointID,ProphetNode*,less_eid_>::iterator dtn::ProphetTable::iterator |
Definition at line 196 of file ProphetLists.h.
| dtn::ProphetTable::ProphetTable | ( | ) |
| dtn::ProphetTable::~ProphetTable | ( | ) |
Destructor.
Definition at line 30 of file ProphetLists.cc.
References clear(), ExamineDump::l, lock_, and oasys::ScopeLock::unlock().
| ProphetNode * dtn::ProphetTable::find | ( | const EndpointID & | eid | ) | const |
Given an EndpointID, returns pointer to ProphetNode if found, else returns NULL.
Definition at line 39 of file ProphetLists.cc.
References ASSERT, dtn::Prophet::eid_to_routeid(), dtn::EndpointID::equals(), ExamineDump::l, lock_, dtn::EndpointID::NULL_EID(), and table_.
Referenced by dtn::ProphetController::handle_bundle_received(), dtn::ProphetEncounter::handle_rib_tlv(), and p_value().
| void dtn::ProphetTable::update | ( | ProphetNode * | node | ) |
Given a pointer to ProphetNode*, assumes ownership of memory pointed to by *node, updates member (replacing if exists).
Definition at line 64 of file ProphetLists.cc.
References ASSERT, ExamineDump::l, lock_, dtn::EndpointID::NULL_EID(), dtn::ProphetNode::remote_eid(), and table_.
Referenced by dtn::ProphetController::handle_bundle_received(), dtn::ProphetEncounter::handle_rib_tlv(), and dtn::ProphetEncounter::send_dictionary().
| double dtn::ProphetTable::p_value | ( | const Bundle * | b | ) | const [inline] |
Convenience functions for looking up predictability value.
Definition at line 224 of file ProphetLists.h.
References dtn::Bundle::dest_, and dtn::Prophet::eid_to_routeid().
Referenced by dtn::ProphetEncounter::fwd_to_nexthop(), dtn::FwdStrategyCompGRTRMAX::operator()(), dtn::FwdStrategyCompGRTRSORT::operator()(), and dtn::BundleOfferComp::operator()().
| double dtn::ProphetTable::p_value | ( | const EndpointID & | eid | ) | const |
Convenience functions for looking up predictability value.
Definition at line 54 of file ProphetLists.cc.
References find(), and dtn::ProphetNode::p_value().
| size_t dtn::ProphetTable::dump_table | ( | ProphetNodeList & | list | ) | const |
Create copy of list.
Definition at line 90 of file ProphetLists.cc.
References ExamineDump::l, lock_, and table_.
Referenced by dtn::ProphetEncounter::send_dictionary().
| size_t dtn::ProphetTable::size | ( | ) | const [inline] |
Returns number of members in ProphetTable.
Definition at line 239 of file ProphetLists.h.
References table_.
Referenced by dtn::ProphetController::dump_state().
| void dtn::ProphetTable::clear | ( | ) | [inline] |
Frees memory pointed to by member nodes, then removes node pointers from list.
Definition at line 245 of file ProphetLists.h.
References free(), and table_.
Referenced by dtn::ProphetEncounter::run(), and ~ProphetTable().
| ProphetTable::iterator dtn::ProphetTable::begin | ( | ) |
Caller must hold lock() when calling iterator.
Definition at line 105 of file ProphetLists.cc.
References ASSERT, oasys::Lock::is_locked_by_me(), lock_, and table_.
Referenced by dtn::ProphetController::dump_state(), and dtn::ProphetTableAgeTimer::timeout().
| ProphetTable::iterator dtn::ProphetTable::end | ( | ) |
Caller must hold lock() when calling iterator.
Definition at line 112 of file ProphetLists.cc.
References ASSERT, oasys::Lock::is_locked_by_me(), lock_, and table_.
Referenced by dtn::ProphetController::dump_state(), and dtn::ProphetTableAgeTimer::timeout().
| void dtn::ProphetTable::truncate | ( | double | epsilon | ) |
For maintenance routines, remove any nodes with p_value < epsilon.
Definition at line 119 of file ProphetLists.cc.
References ExamineDump::l, lock_, dtn::ProphetNode::p_value(), and table_.
Referenced by dtn::ProphetTableAgeTimer::timeout().
| oasys::SpinLock* dtn::ProphetTable::lock | ( | ) | [inline] |
Returns a pointer to member SpinLock for synchronizing concurrent access.
Definition at line 266 of file ProphetLists.h.
References lock_.
Referenced by dtn::ProphetController::dump_state(), and dtn::ProphetTableAgeTimer::timeout().
| void dtn::ProphetTable::free | ( | ) | [protected] |
Clean up memory pointed to by member variables.
Definition at line 136 of file ProphetLists.cc.
References ExamineDump::l, lock_, and table_.
Referenced by clear().
oasys::SpinLock* dtn::ProphetTable::lock_ [protected] |
Definition at line 274 of file ProphetLists.h.
Referenced by begin(), dump_table(), end(), find(), free(), lock(), truncate(), update(), and ~ProphetTable().
rib_table dtn::ProphetTable::table_ [protected] |
Definition at line 275 of file ProphetLists.h.
Referenced by begin(), clear(), dump_table(), end(), find(), free(), ProphetTable(), size(), truncate(), and update().
1.5.3