Section 3.5 (p. More...
#include <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 *, AckComp > | palist |
Protected Attributes | |
palist | acks_ |
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.
typedef std::set<Ack*,AckComp> prophet::AckList::palist [protected] |
prophet::AckList::AckList | ( | ) | [inline] |
prophet::AckList::AckList | ( | const AckList & | list | ) | [inline] |
prophet::AckList::~AckList | ( | ) |
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.
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] |
palist prophet::AckList::acks_ [protected] |
Definition at line 123 of file AckList.h.
Referenced by empty(), size(), and ~AckList().