prophet::AckList Class Reference

Section 3.5 (p. More...

#include <AckList.h>

List of all members.

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_

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.


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 21 of file AckList.cc.

References acks_.


Member Function Documentation

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

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

Definition at line 69 of file AckList.cc.

Referenced by prophet::BundleOffer::get_bundle_offer(), and prophet::TLVCreator::offer().

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

Accessor.

Definition at line 119 of file AckList.h.

References acks_.

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

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 114 of file AckList.cc.

Referenced by prophet::Controller::handle_timeout().

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 87 of file AckList.cc.

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

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

Definition at line 53 of file AckList.cc.

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 42 of file AckList.cc.

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 31 of file AckList.cc.

Referenced by prophet::Oracle::ack(), prophet::TLVCreator::offer(), and prophet::TLVCreator::response().

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 143 of file AckList.cc.

Referenced by prophet::TLVCreator::response().

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

Number of elements currently in list.

Definition at line 107 of file AckList.h.

References acks_.


Member Data Documentation

Definition at line 123 of file AckList.h.

Referenced by empty(), size(), and ~AckList().


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