#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_ |
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 72 of file AckList.cc.
References acks_, and prophet::PointerList< T >::clear().
Referenced by prophet::BundleOffer::get_bundle_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 117 of file AckList.cc.
References acks_, prophet::Ack::cts(), and prophet::Ack::ets().
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().
Insert Ack, return true on success, else false if Ack exists.
Definition at line 56 of file AckList.cc.
References acks_.
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 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::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_.
size_t prophet::AckList::size | ( | ) | const [inline] |
palist prophet::AckList::acks_ [protected] |