#include <BundleOffer.h>
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.
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 BundleOfferList & | get_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. | |
FwdStrategyComp * | comp_ |
comparator for ordering Bundle Offer TLV | |
Decider * | decider_ |
forwarding decision per Bundle |
typedef std::list<const Bundle*> prophet::BundleOffer::List [protected] |
Definition at line 79 of file BundleOffer.h.
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 24 of file BundleOffer.cc.
References add_bundle().
prophet::BundleOffer::~BundleOffer | ( | ) |
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 42 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_.
size_t prophet::BundleOffer::size | ( | ) | const [inline] |
Return number of elements in Bundle offer.
Definition at line 69 of file BundleOffer.h.
References list_.
const BundleOfferList & prophet::BundleOffer::get_bundle_offer | ( | const Dictionary & | ribd, | |
const AckList * | acks | |||
) |
Convenience method to return const ref to sorted BundleOfferList.
Definition at line 64 of file BundleOffer.cc.
References prophet::BundleOfferList::add_offer(), bolist_, prophet::BundleEntryList< BundleEntryType >::clear(), prophet::AckList::clone(), core_, prophet::AckList::empty(), prophet::Dictionary::find(), prophet::BundleCore::get_route(), prophet::Dictionary::INVALID_SID, and list_.
BundleCore* const prophet::BundleOffer::core_ [protected] |
List prophet::BundleOffer::list_ [protected] |
bundles to offer to remote peer
Definition at line 82 of file BundleOffer.h.
Referenced by add_bundle(), empty(), get_bundle_offer(), and size().
BundleOfferList prophet::BundleOffer::bolist_ [protected] |
TLV-ready bundle offer list.
Definition at line 83 of file BundleOffer.h.
Referenced by get_bundle_offer().
FwdStrategyComp* prophet::BundleOffer::comp_ [protected] |
comparator for ordering Bundle Offer TLV
Definition at line 84 of file BundleOffer.h.
Referenced by ~BundleOffer().
Decider* prophet::BundleOffer::decider_ [protected] |
forwarding decision per Bundle
Definition at line 85 of file BundleOffer.h.
Referenced by add_bundle(), and ~BundleOffer().