#include <ProphetLists.h>
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 571 of file ProphetLists.h.
Public Types | |
| typedef std::set < ProphetAck *, less_ack_ > | palist |
Public Member Functions | |
| ProphetAckList () | |
| ProphetAckList (const ProphetAckList &a) | |
| ~ProphetAckList () | |
| bool | insert (const EndpointID &eid, u_int32_t cts, u_int32_t ets=0) |
| Insert a ProphetAck with the provided attributes; return true if inserted, else false if ACK already exists. | |
| bool | insert (Bundle *b) |
| Convenience wrapper. | |
| bool | insert (ProphetAck *ack) |
| Insert ProphetAck; return true on success, else false if ACK already exists. | |
| size_t | count (const EndpointID &eid) const |
| Return the number of ACKs known for a given EID. | |
| size_t | fetch (const EndpointIDPattern &eid, PointerList< ProphetAck > &list) const |
| Place the set of ACKs for given EID in list, return number found. | |
| bool | is_ackd (const EndpointID &eid, u_int32_t cts) const |
| Answer whether this Bundle has been ACK'd. | |
| bool | is_ackd (Bundle *b) const |
| size_t | expire (u_int32_t older_than=0) |
| Visit every ACK in the list, and delete those for which the expiration time is older than the time provided; return the number of elements deleted (If older_than==0 use current time). | |
| size_t | size () const |
| Number of elements contained. | |
Protected Attributes | |
| palist | acks_ |
| oasys::SpinLock * | lock_ |
Classes | |
| struct | less_ack_ |
| typedef std::set<ProphetAck*,less_ack_> dtn::ProphetAckList::palist |
Definition at line 578 of file ProphetLists.h.
| dtn::ProphetAckList::ProphetAckList | ( | ) |
| dtn::ProphetAckList::ProphetAckList | ( | const ProphetAckList & | a | ) | [inline] |
Definition at line 581 of file ProphetLists.h.
| dtn::ProphetAckList::~ProphetAckList | ( | ) |
| bool dtn::ProphetAckList::insert | ( | const EndpointID & | eid, | |
| u_int32_t | cts, | |||
| u_int32_t | ets = 0 | |||
| ) |
Insert a ProphetAck with the provided attributes; return true if inserted, else false if ACK already exists.
Definition at line 491 of file ProphetLists.cc.
References acks_, ExamineDump::l, and lock_.
Referenced by dtn::ProphetController::handle_bundle_delivered(), dtn::ProphetEncounter::handle_bundle_tlv(), and insert().
Convenience wrapper.
Definition at line 594 of file ProphetLists.h.
References dtn::Bundle::creation_ts_, dtn::Bundle::dest_, dtn::Prophet::eid_to_routeid(), dtn::Bundle::expiration_, insert(), and dtn::BundleTimestamp::seconds_.
| bool dtn::ProphetAckList::insert | ( | ProphetAck * | ack | ) |
Insert ProphetAck; return true on success, else false if ACK already exists.
Definition at line 504 of file ProphetLists.cc.
References acks_, ExamineDump::l, and lock_.
| size_t dtn::ProphetAckList::count | ( | const EndpointID & | eid | ) | const |
Return the number of ACKs known for a given EID.
Definition at line 473 of file ProphetLists.cc.
References acks_, ExamineDump::l, and lock_.
| size_t dtn::ProphetAckList::fetch | ( | const EndpointIDPattern & | eid, | |
| PointerList< ProphetAck > & | list | |||
| ) | const |
Place the set of ACKs for given EID in list, return number found.
Definition at line 533 of file ProphetLists.cc.
References acks_, ExamineDump::l, lock_, and dtn::EndpointIDPattern::match().
Referenced by dtn::ProphetEncounter::send_bundle_offer().
| bool dtn::ProphetAckList::is_ackd | ( | const EndpointID & | eid, | |
| u_int32_t | cts | |||
| ) | const |
Answer whether this Bundle has been ACK'd.
Definition at line 550 of file ProphetLists.cc.
References acks_, ExamineDump::l, and lock_.
Referenced by dtn::ProphetEncounter::handle_bundle_tlv(), and is_ackd().
Definition at line 622 of file ProphetLists.h.
References dtn::Bundle::creation_ts_, dtn::Bundle::dest_, dtn::Prophet::eid_to_routeid(), is_ackd(), and dtn::BundleTimestamp::seconds_.
| size_t dtn::ProphetAckList::expire | ( | u_int32_t | older_than = 0 |
) |
Visit every ACK in the list, and delete those for which the expiration time is older than the time provided; return the number of elements deleted (If older_than==0 use current time).
Definition at line 511 of file ProphetLists.cc.
References acks_, dtn::ProphetAck::ets_, oasys::Time::get_time(), ExamineDump::l, lock_, and oasys::Time::sec_.
Referenced by dtn::ProphetAckAgeTimer::timeout().
| size_t dtn::ProphetAckList::size | ( | ) | const [inline] |
palist dtn::ProphetAckList::acks_ [protected] |
Definition at line 642 of file ProphetLists.h.
Referenced by count(), expire(), fetch(), insert(), is_ackd(), ProphetAckList(), size(), and ~ProphetAckList().
oasys::SpinLock* dtn::ProphetAckList::lock_ [protected] |
Definition at line 643 of file ProphetLists.h.
Referenced by count(), expire(), fetch(), insert(), is_ackd(), and ~ProphetAckList().
1.5.3