prophet::AckList Class Reference

#include <AckList.h>

List of all members.


Detailed Description

Section 3.5 (p.

16) describes Prophet ACKs as needing to persist in a node's storage beyond the lifetime of the bundle they represent. ProphetAckList is that persistence (but not [yet] serializable to permanent storage).

Definition at line 45 of file AckList.h.


Public Member Functions

 AckList ()
 Default constructor.
 AckList (const AckList &list)
 Copy constructor.
 ~AckList ()
 Destructor.
bool insert (const std::string &dest_id, u_int32_t cts, u_int32_t seq=0, u_int32_t ets=0)
 Convenience method for inserting Ack into list; return true upon success, else false if Ack already exists.
bool insert (const Bundle *b, const BundleCore *core)
 Convenience method for inserting Ack into list; return true upon success, else false if Ack already exists.
bool insert (const Ack *ack)
 Insert Ack, return true on success, else false if Ack exists.
size_t clone (PointerList< Ack > &list) const
 Export list of Acks to PointerList<Ack>, return number of elements exported.
size_t fetch (const std::string &dest_id, PointerList< Ack > *list) const
 Given a destination ID, return the number of Acks that match (exact match only, no pattern matches).
size_t expire ()
 Visit every ACK in the list, and delete those for which the expiration has passed; return the number of elements deleted.
size_t size () const
 Number of elements currently in list.
bool is_ackd (const std::string &dest_id, u_int32_t cts, u_int32_t seq) const
 Convenience function to answer the question of whether this Bundle has been Ack'd.
bool empty () const
 Accessor.

Protected Types

typedef std::set< Ack *, AckComppalist

Protected Attributes

palist acks_

Member Typedef Documentation

typedef std::set<Ack*,AckComp> prophet::AckList::palist [protected]

Definition at line 122 of file AckList.h.


Constructor & Destructor Documentation

prophet::AckList::AckList (  )  [inline]

Default constructor.

Definition at line 51 of file AckList.h.

prophet::AckList::AckList ( const AckList list  )  [inline]

Copy constructor.

Definition at line 56 of file AckList.h.

prophet::AckList::~AckList (  ) 

Destructor.

Definition at line 24 of file AckList.cc.

References acks_.


Member Function Documentation

bool prophet::AckList::insert ( const std::string &  dest_id,
u_int32_t  cts,
u_int32_t  seq = 0,
u_int32_t  ets = 0 
)

Convenience method for inserting Ack into list; return true upon success, else false if Ack already exists.

Expiration time stamp is actually an offset in seconds, from creation time. Default is 0 (use offset of one day, 86400 sec)

Definition at line 34 of file AckList.cc.

Referenced by insert().

bool prophet::AckList::insert ( const Bundle b,
const BundleCore core 
)

Convenience method for inserting Ack into list; return true upon success, else false if Ack already exists.

Definition at line 45 of file AckList.cc.

References prophet::Bundle::creation_ts(), prophet::Bundle::destination_id(), prophet::Bundle::expiration_ts(), prophet::BundleCore::get_route(), insert(), and prophet::Bundle::sequence_num().

bool prophet::AckList::insert ( const Ack ack  ) 

Insert Ack, return true on success, else false if Ack exists.

Definition at line 56 of file AckList.cc.

References acks_.

size_t prophet::AckList::clone ( PointerList< Ack > &  list  )  const

Export list of Acks to PointerList<Ack>, return number of elements exported.

Definition at line 72 of file AckList.cc.

References acks_, and prophet::PointerList< T >::clear().

Referenced by prophet::BundleOffer::get_bundle_offer().

size_t prophet::AckList::fetch ( const std::string &  dest_id,
PointerList< Ack > *  list 
) const

Given a destination ID, return the number of Acks that match (exact match only, no pattern matches).

If list is non NULL, fill with Acks that match

Definition at line 90 of file AckList.cc.

References acks_, and prophet::PointerList< T >::clear().

size_t prophet::AckList::expire (  ) 

Visit every ACK in the list, and delete those for which the expiration has passed; return the number of elements deleted.

Definition at line 117 of file AckList.cc.

References acks_, prophet::Ack::cts(), and prophet::Ack::ets().

size_t prophet::AckList::size (  )  const [inline]

Number of elements currently in list.

Definition at line 107 of file AckList.h.

References acks_.

bool prophet::AckList::is_ackd ( const std::string &  dest_id,
u_int32_t  cts,
u_int32_t  seq 
) const

Convenience function to answer the question of whether this Bundle has been Ack'd.

Definition at line 146 of file AckList.cc.

References acks_.

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

Accessor.

Definition at line 119 of file AckList.h.

References acks_.

Referenced by prophet::BundleOffer::get_bundle_offer().


Member Data Documentation

Definition at line 123 of file AckList.h.

Referenced by clone(), empty(), expire(), fetch(), insert(), is_ackd(), size(), and ~AckList().


The documentation for this class was generated from the following files:

Generated on Mon Jul 21 14:12:22 2008 for DTN Reference Implementation by  doxygen 1.5.6