dtn::ProphetBundleQueue Class Reference

#include <ProphetLists.h>

Inheritance diagram for dtn::ProphetBundleQueue:

oasys::BoundedPriorityQueue< T, TSize, TCompare > List of all members.

Detailed Description

Helper class to enforce bundle queueing policies This frankenstein (with BundleList member AND priority_queue's Bundle* vector) is a temporary hack to increment Bundle references (BundleList) while enforcing Prophet's bundle queueing policy (priority_queue with bound).

The "right" answer is to either rewrite BundleList as a template, to allow a vector with which to seed BoundedPriorityQueue ... or largely duplicate BundleList below, in a derived class of priority_queue.

Definition at line 1252 of file ProphetLists.h.

Public Types

typedef oasys::BoundedPriorityQueue<
Bundle *, BundleSz, QueueComp
BundleBPQ

Public Member Functions

 ProphetBundleQueue (const BundleList *list, BundleActions *actions, ProphetParams *params, QueueComp comp=QueueCompFIFO())
virtual ~ProphetBundleQueue ()
oasys::SpinLocklock () const
size_t bundle_list (BundleList &list) const
 copy out a sequence from internal heap; among other purposes, one use for this is to seed BundleOfferTLV's (via ProphetBundleOffer)
void drop_bundle (Bundle *b)
void pop ()
 Decrement bounds tracking by this entry's TSize(), then utilize priority_queue's default pop() behavior.
void push (Bundle *b)
void set_comp (QueueComp *c)

Protected Member Functions

void erase_member (iterator pos)
void enforce_bound ()
 Drop lowest priority elements until maximum bounds is no longer exceeded.

Protected Attributes

BundleList bundles_
BundleActionsactions_
ProphetParamsparams_


Member Typedef Documentation

typedef oasys::BoundedPriorityQueue<Bundle*,BundleSz,QueueComp> dtn::ProphetBundleQueue::BundleBPQ

Definition at line 1256 of file ProphetLists.h.


Constructor & Destructor Documentation

dtn::ProphetBundleQueue::ProphetBundleQueue ( const BundleList list,
BundleActions actions,
ProphetParams params,
QueueComp  comp = QueueCompFIFO() 
) [inline]

Definition at line 1258 of file ProphetLists.h.

References ASSERT, dtn::BundleList::begin(), dtn::BundleList::end(), ExamineDump::l, dtn::BundleList::lock(), and push().

virtual dtn::ProphetBundleQueue::~ProphetBundleQueue (  )  [inline, virtual]

Definition at line 1278 of file ProphetLists.h.


Member Function Documentation

oasys::SpinLock* dtn::ProphetBundleQueue::lock (  )  const [inline]

Definition at line 1280 of file ProphetLists.h.

References bundles_, and dtn::BundleList::lock().

Referenced by bundle_list(), enforce_bound(), dtn::ProphetEncounter::handle_bundle_tlv(), dtn::ProphetEncounter::send_bundle_offer(), dtn::ProphetEncounter::send_dictionary(), and set_comp().

size_t dtn::ProphetBundleQueue::bundle_list ( BundleList list  )  const [inline]

copy out a sequence from internal heap; among other purposes, one use for this is to seed BundleOfferTLV's (via ProphetBundleOffer)

To export this list, caller must hold lock() on this object

Definition at line 1290 of file ProphetLists.h.

References ASSERT, dtn::BundleList::begin(), bundles_, dtn::BundleList::end(), lock(), dtn::BundleList::push_back(), and dtn::BundleList::size().

Referenced by dtn::ProphetEncounter::handle_bundle_tlv(), dtn::ProphetEncounter::send_bundle_offer(), and dtn::ProphetEncounter::send_dictionary().

void dtn::ProphetBundleQueue::drop_bundle ( Bundle b  )  [inline]

Definition at line 1304 of file ProphetLists.h.

References comp_, erase_member(), and seq_.

Referenced by dtn::ProphetController::handle_bundle_delivered(), dtn::ProphetController::handle_bundle_expired(), and dtn::ProphetEncounter::handle_bundle_tlv().

void dtn::ProphetBundleQueue::pop (  )  [inline]

Decrement bounds tracking by this entry's TSize(), then utilize priority_queue's default pop() behavior.

Reimplemented from oasys::BoundedPriorityQueue< T, TSize, TCompare >.

Definition at line 1314 of file ProphetLists.h.

void dtn::ProphetBundleQueue::push ( Bundle b  )  [inline]

Definition at line 1319 of file ProphetLists.h.

References bundles_, dtn::BundleList::contains(), oasys::BoundedPriorityQueue< T, TSize, TCompare >::push(), and dtn::BundleList::push_back().

Referenced by dtn::ProphetController::handle_bundle_received(), and ProphetBundleQueue().

void dtn::ProphetBundleQueue::set_comp ( QueueComp c  )  [inline]

Definition at line 1329 of file ProphetLists.h.

References comp_, ExamineDump::l, lock(), and seq_.

Referenced by dtn::ProphetController::handle_queue_policy_change().

void dtn::ProphetBundleQueue::erase_member ( iterator  pos  )  [inline, protected]

Definition at line 1337 of file ProphetLists.h.

References bundles_, dtn::BundleList::erase(), and oasys::BoundedPriorityQueue< T, TSize, TCompare >::erase_member().

Referenced by drop_bundle(), and enforce_bound().

void dtn::ProphetBundleQueue::enforce_bound (  )  [inline, protected]

Drop lowest priority elements until maximum bounds is no longer exceeded.

Reimplemented from oasys::BoundedPriorityQueue< T, TSize, TCompare >.

Definition at line 1344 of file ProphetLists.h.

References comp_, oasys::BoundedPriorityQueue< T, TSize, TCompare >::cur_size_, oasys::BoundedPriorityQueue< T, TSize, TCompare >::enforce_bound(), erase_member(), ExamineDump::l, dtn::Prophet::LEPR, lock(), oasys::BoundedPriorityQueue< T, TSize, TCompare >::max_size_, dtn::ProphetParams::min_forward_, NUM_FWD, params_, dtn::ProphetParams::qp_, and seq_.


Member Data Documentation

BundleList dtn::ProphetBundleQueue::bundles_ [protected]

Definition at line 1375 of file ProphetLists.h.

Referenced by bundle_list(), erase_member(), lock(), and push().

BundleActions* dtn::ProphetBundleQueue::actions_ [protected]

Definition at line 1376 of file ProphetLists.h.

ProphetParams* dtn::ProphetBundleQueue::params_ [protected]

Definition at line 1377 of file ProphetLists.h.

Referenced by enforce_bound().


The documentation for this class was generated from the following file:
Generated on Thu Jun 7 16:56:58 2007 for DTN Reference Implementation by  doxygen 1.5.1