prophet::BundleOffer Class Reference

BundleOffer is the executor of forwarding strategy. More...

#include <BundleOffer.h>

List of all members.

Public Member Functions

 BundleOffer (BundleCore *core, const BundleList &bundles, FwdStrategyComp *comp, Decider *decider)
 Constructor.
 ~BundleOffer ()
 Destructor.
void add_bundle (const Bundle *b)
 Add Bundle to offer.
bool empty () const
 Return whether Bundle offer is empty.
size_t size () const
 Return number of elements in Bundle offer.
const BundleOfferListget_bundle_offer (const Dictionary &ribd, const AckList *acks)
 Convenience method to return const ref to sorted BundleOfferList.

Protected Types

typedef std::list< const Bundle * > List

Protected Attributes

BundleCore *const core_
 BundleCore instance.
List list_
 bundles to offer to remote peer
BundleOfferList bolist_
 TLV-ready bundle offer list.
FwdStrategyCompcomp_
 comparator for ordering Bundle Offer TLV
Deciderdecider_
 forwarding decision per Bundle

Detailed Description

BundleOffer is the executor of forwarding strategy.

A Decider chooses which Bundles to allow into the list. A Comparator assists in sorting in strategy order.

Definition at line 37 of file BundleOffer.h.


Member Typedef Documentation

typedef std::list<const Bundle*> prophet::BundleOffer::List [protected]

Definition at line 79 of file BundleOffer.h.


Constructor & Destructor Documentation

prophet::BundleOffer::BundleOffer ( BundleCore core,
const BundleList bundles,
FwdStrategyComp comp,
Decider decider 
)

Constructor.

This object's destructor cleans up memory pointed to by comp and decider

Definition at line 22 of file BundleOffer.cc.

References add_bundle().

prophet::BundleOffer::~BundleOffer (  ) 

Destructor.

Definition at line 33 of file BundleOffer.cc.


Member Function Documentation

void prophet::BundleOffer::add_bundle ( const Bundle b  ) 

Add Bundle to offer.

Strategy-based decider will determine whether it gets added, and strategy-based comparator will determine where it gets inserted.

Definition at line 40 of file BundleOffer.cc.

References prophet::Bundle::creation_ts(), decider_, prophet::Bundle::destination_id(), list_, LOG, and prophet::Bundle::sequence_num().

Referenced by BundleOffer().

bool prophet::BundleOffer::empty (  )  const [inline]

Return whether Bundle offer is empty.

Definition at line 64 of file BundleOffer.h.

References list_.

const BundleOfferList & prophet::BundleOffer::get_bundle_offer ( const Dictionary ribd,
const AckList acks 
)
size_t prophet::BundleOffer::size (  )  const [inline]

Return number of elements in Bundle offer.

Definition at line 69 of file BundleOffer.h.

References list_.


Member Data Documentation

TLV-ready bundle offer list.

Definition at line 83 of file BundleOffer.h.

Referenced by get_bundle_offer().

comparator for ordering Bundle Offer TLV

Definition at line 84 of file BundleOffer.h.

BundleCore instance.

Definition at line 81 of file BundleOffer.h.

Referenced by get_bundle_offer().

forwarding decision per Bundle

Definition at line 85 of file BundleOffer.h.

Referenced by add_bundle().

bundles to offer to remote peer

Definition at line 82 of file BundleOffer.h.

Referenced by add_bundle(), empty(), get_bundle_offer(), and size().


The documentation for this class was generated from the following files:
Generated on Sun Nov 21 11:41:15 2010 for DTN Reference Implementation by  doxygen 1.6.3