dtn::BundleOfferList Class Reference

#include <ProphetLists.h>

List of all members.


Detailed Description

BundleOfferList represents a BundleOfferTLV as received from or sent to remote.

Definition at line 439 of file ProphetLists.h.

Public Types

typedef PointerList< BundleOfferList
typedef PointerList< BundleOffer
>::iterator 
iterator
typedef PointerList< BundleOffer
>::const_iterator 
const_iterator

Public Member Functions

 BundleOfferList (BundleOffer::bundle_offer_t type=BundleOffer::UNDEFINED)
 BundleOfferList (const BundleOfferList &list)
 ~BundleOfferList ()
void sort (ProphetDictionary *ribd, ProphetTable *nodes, u_int16_t sid)
 Use delivery predictability to sort requests in priority order then move local-destined requests to front of resultant list.
size_t size () const
 Returns number of entries in list.
bool empty () const
 Returns true if list is empty.
void clear ()
 Removes all entries from list.
void add_offer (BundleOffer *entry)
 Add an entry from BundleOfferList.
bool remove_bundle (u_int32_t cts, u_int16_t sid)
 Remove an entry from BundleOfferList; true if found (and removed) else false if did not exist.
void add_offer (u_int32_t cts, u_int16_t sid, bool custody=false, bool accept=false, bool ack=false)
 Convenience function to add an entry to BundleOfferList.
void add_offer (Bundle *b, u_int16_t sid)
 Convenience function to add an entry to BundleOfferList.
BundleOfferfind (u_int32_t cts, u_int16_t sid) const
 Return pointer to BundleOffer if found, else NULL.
BundleOffer::bundle_offer_t type ()
iterator begin ()
 Iterators require caller to hold lock.
iterator end ()
const_iterator begin () const
const_iterator end () const
BundleOfferfront () const
 Get first pointer from list, else return NULL.
size_t guess_size ()
 Estimate serialized buffer length.
BundleOfferListoperator= (const BundleOfferList &a)
oasys::SpinLocklock ()
void set_type (BundleOffer::bundle_offer_t type)
BundleOffer::bundle_offer_t type () const
void dump (oasys::StringBuffer *buf)

Protected Member Functions

void push_back (BundleOffer *bo)
 Adds entry to back of list.

Protected Attributes

List list_
BundleOffer::bundle_offer_t type_
oasys::SpinLocklock_


Member Typedef Documentation

typedef PointerList<BundleOffer> dtn::BundleOfferList::List

Definition at line 441 of file ProphetLists.h.

typedef PointerList<BundleOffer>::iterator dtn::BundleOfferList::iterator

Definition at line 442 of file ProphetLists.h.

typedef PointerList<BundleOffer>::const_iterator dtn::BundleOfferList::const_iterator

Definition at line 443 of file ProphetLists.h.


Constructor & Destructor Documentation

dtn::BundleOfferList::BundleOfferList ( BundleOffer::bundle_offer_t  type = BundleOffer::UNDEFINED  )  [inline]

Definition at line 445 of file ProphetLists.h.

dtn::BundleOfferList::BundleOfferList ( const BundleOfferList list  )  [inline]

Definition at line 451 of file ProphetLists.h.

dtn::BundleOfferList::~BundleOfferList (  )  [inline]

Definition at line 458 of file ProphetLists.h.

References dtn::PointerList< T >::clear(), list_, and lock_.


Member Function Documentation

void dtn::BundleOfferList::sort ( ProphetDictionary ribd,
ProphetTable nodes,
u_int16_t  sid 
)

Use delivery predictability to sort requests in priority order then move local-destined requests to front of resultant list.

Definition at line 324 of file ProphetLists.cc.

References ExamineDump::l, list_, and lock_.

Referenced by dtn::ProphetEncounter::handle_bundle_tlv().

size_t dtn::BundleOfferList::size (  )  const

Returns number of entries in list.

Definition at line 349 of file ProphetLists.cc.

References list_.

Referenced by dtn::BundleTLV::BundleTLV(), dtn::BundleTLV::dump(), dtn::ProphetEncounter::enqueue_bundle_tlv(), dtn::ProphetEncounter::handle_bundle_received(), dtn::ProphetEncounter::handle_bundle_tlv(), dtn::ProphetEncounter::handle_poll_timeout(), and dtn::BundleTLV::serialize().

bool dtn::BundleOfferList::empty (  )  const

Returns true if list is empty.

Definition at line 355 of file ProphetLists.cc.

References list_.

Referenced by dtn::BundleTLV::deserialize().

void dtn::BundleOfferList::clear (  ) 

Removes all entries from list.

Definition at line 361 of file ProphetLists.cc.

References dtn::PointerList< T >::clear(), ExamineDump::l, list_, and lock_.

Referenced by dtn::ProphetEncounter::handle_bundle_tlv(), and dtn::BundleTLV::~BundleTLV().

void dtn::BundleOfferList::add_offer ( BundleOffer entry  ) 

Add an entry from BundleOfferList.

Definition at line 375 of file ProphetLists.cc.

References ASSERT, ExamineDump::l, list_, lock_, dtn::BundleOffer::type(), type_, and dtn::BundleOffer::UNDEFINED.

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

bool dtn::BundleOfferList::remove_bundle ( u_int32_t  cts,
u_int16_t  sid 
)

Remove an entry from BundleOfferList; true if found (and removed) else false if did not exist.

Definition at line 333 of file ProphetLists.cc.

References dtn::PointerList< T >::erase(), ExamineDump::l, list_, and lock_.

Referenced by dtn::ProphetEncounter::handle_bundle_received(), and dtn::ProphetEncounter::handle_bundle_tlv().

void dtn::BundleOfferList::add_offer ( u_int32_t  cts,
u_int16_t  sid,
bool  custody = false,
bool  accept = false,
bool  ack = false 
)

Convenience function to add an entry to BundleOfferList.

Definition at line 384 of file ProphetLists.cc.

References ASSERT, ExamineDump::l, list_, lock_, type_, and dtn::BundleOffer::UNDEFINED.

void dtn::BundleOfferList::add_offer ( Bundle b,
u_int16_t  sid 
)

Convenience function to add an entry to BundleOfferList.

Definition at line 393 of file ProphetLists.cc.

References ASSERT, ExamineDump::l, list_, lock_, oasys::Ref< _Type >::object(), type_, and dtn::BundleOffer::UNDEFINED.

BundleOffer * dtn::BundleOfferList::find ( u_int32_t  cts,
u_int16_t  sid 
) const

Return pointer to BundleOffer if found, else NULL.

Definition at line 405 of file ProphetLists.cc.

References ExamineDump::l, list_, and lock_.

BundleOffer::bundle_offer_t dtn::BundleOfferList::type (  )  [inline]

Definition at line 512 of file ProphetLists.h.

References type_.

Referenced by dtn::BundleTLV::BundleTLV(), dtn::BundleTLV::deserialize(), dtn::BundleTLV::dump(), dtn::ProphetEncounter::handle_bundle_tlv(), and dtn::BundleTLV::type().

BundleOfferList::iterator dtn::BundleOfferList::begin (  ) 

Iterators require caller to hold lock.

Definition at line 436 of file ProphetLists.cc.

References ASSERT, oasys::Lock::is_locked_by_me(), list_, and lock_.

Referenced by dtn::ProphetEncounter::handle_bundle_tlv(), and dtn::BundleTLV::serialize().

BundleOfferList::iterator dtn::BundleOfferList::end (  ) 

Definition at line 443 of file ProphetLists.cc.

References ASSERT, oasys::Lock::is_locked_by_me(), list_, and lock_.

Referenced by dtn::ProphetEncounter::handle_bundle_tlv(), and dtn::BundleTLV::serialize().

BundleOfferList::const_iterator dtn::BundleOfferList::begin (  )  const

Definition at line 422 of file ProphetLists.cc.

References ASSERT, oasys::Lock::is_locked_by_me(), list_, and lock_.

BundleOfferList::const_iterator dtn::BundleOfferList::end (  )  const

Definition at line 429 of file ProphetLists.cc.

References ASSERT, oasys::Lock::is_locked_by_me(), list_, and lock_.

BundleOffer* dtn::BundleOfferList::front (  )  const [inline]

Get first pointer from list, else return NULL.

Definition at line 525 of file ProphetLists.h.

References ExamineDump::l, list_, and lock_.

size_t dtn::BundleOfferList::guess_size (  )  [inline]

Estimate serialized buffer length.

Definition at line 534 of file ProphetLists.h.

References dtn::Prophet::BundleOfferEntrySize, and list_.

Referenced by dtn::BundleTLV::serialize().

BundleOfferList& dtn::BundleOfferList::operator= ( const BundleOfferList a  )  [inline]

Definition at line 539 of file ProphetLists.h.

References ExamineDump::l, list_, lock_, and type_.

oasys::SpinLock* dtn::BundleOfferList::lock (  )  [inline]

Definition at line 548 of file ProphetLists.h.

References lock_.

Referenced by dtn::ProphetEncounter::handle_bundle_tlv(), and dtn::BundleTLV::serialize().

void dtn::BundleOfferList::set_type ( BundleOffer::bundle_offer_t  type  )  [inline]

Definition at line 550 of file ProphetLists.h.

References type_.

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

BundleOffer::bundle_offer_t dtn::BundleOfferList::type (  )  const [inline]

Definition at line 551 of file ProphetLists.h.

References type_.

void dtn::BundleOfferList::dump ( oasys::StringBuffer buf  ) 

Definition at line 201 of file ProphetLists.cc.

References list_.

Referenced by dtn::BundleTLV::dump().

void dtn::BundleOfferList::push_back ( BundleOffer bo  )  [protected]

Adds entry to back of list.

Definition at line 368 of file ProphetLists.cc.

References ExamineDump::l, list_, and lock_.


Member Data Documentation

List dtn::BundleOfferList::list_ [protected]

Definition at line 561 of file ProphetLists.h.

Referenced by add_offer(), begin(), clear(), dump(), empty(), end(), find(), front(), guess_size(), operator=(), push_back(), remove_bundle(), size(), sort(), and ~BundleOfferList().

BundleOffer::bundle_offer_t dtn::BundleOfferList::type_ [protected]

Definition at line 562 of file ProphetLists.h.

Referenced by add_offer(), operator=(), set_type(), and type().

oasys::SpinLock* dtn::BundleOfferList::lock_ [protected]

Definition at line 563 of file ProphetLists.h.

Referenced by add_offer(), begin(), clear(), end(), find(), front(), lock(), operator=(), push_back(), remove_bundle(), sort(), and ~BundleOfferList().


The documentation for this class was generated from the following files:
Generated on Thu Jun 7 12:54:34 2007 for DTN Reference Implementation by  doxygen 1.5.1