BundleEntryList is the in-memory representation of the Bundle offer that is exchanged between peers as Bundle TLV. More...
#include <BundleTLVEntryList.h>
Public Types | |
typedef PointerList < BundleEntryType > | List |
typedef PointerList < BundleEntryType >::iterator | iterator |
typedef PointerList < BundleEntryType > ::const_iterator | const_iterator |
Public Member Functions | |
BundleEntryList (BundleTLVEntry::bundle_entry_t type=BundleTLVEntry::UNDEFINED) | |
Default constructor. | |
BundleEntryList (const BundleEntryList &list) | |
Copy constructor. | |
virtual | ~BundleEntryList () |
Destructor. | |
size_t | size () const |
Return number of Bundle offers in list. | |
bool | empty () const |
Return whether list is empty. | |
void | clear () |
Remove all entries from internal list. | |
bool | add_entry (const BundleEntryType *entry) |
Add a Bundle entry to this list; return whether successful. | |
bool | remove_entry (u_int32_t cts, u_int32_t seq, u_int16_t sid) |
Remove entry from Bundle offer list; returns true if found (and removed) else false if it did not exist. | |
const BundleEntryType * | find (u_int32_t cts, u_int32_t seq, u_int16_t sid) const |
Return pointer to entry if found, else return NULL. | |
BundleTLVEntry::bundle_entry_t | type () const |
Return type of entries hosted by this list. | |
const BundleEntryType * | front () const |
Convenience method to access first entry in list, or NULL if empty. | |
const BundleEntryType * | back () const |
Convenience method to access last entry in list, or NULL if empty. | |
size_t | guess_size (size_t BOEsz) const |
Estimate serialized buffer length. | |
BundleEntryList & | operator= (const BundleEntryList &list) |
Assignment operator. | |
iterator | begin () |
These iterators are not thread safe. | |
iterator | end () |
These iterators are not thread safe. | |
const_iterator | begin () const |
These iterators are not thread safe. | |
const_iterator | end () const |
These iterators are not thread safe. | |
Protected Member Functions | |
bool | add_entry (BundleTLVEntry::bundle_entry_t type, u_int32_t cts, u_int32_t seq, u_int16_t sid, bool custody=false, bool accept=false, bool ack=false) |
Convenience method for adding new entry to this Bundle offer list, return whether successful. | |
virtual bool | push_back (BundleEntryType *bo)=0 |
Add entry to back of list. | |
Protected Attributes | |
BundleTLVEntry::bundle_entry_t | type_ |
type of Bundle entry in list | |
List | list_ |
BundleEntryList is the in-memory representation of the Bundle offer that is exchanged between peers as Bundle TLV.
Definition at line 36 of file BundleTLVEntryList.h.
typedef PointerList<BundleEntryType>::const_iterator prophet::BundleEntryList< BundleEntryType >::const_iterator |
Definition at line 43 of file BundleTLVEntryList.h.
typedef PointerList<BundleEntryType>::iterator prophet::BundleEntryList< BundleEntryType >::iterator |
Definition at line 41 of file BundleTLVEntryList.h.
typedef PointerList<BundleEntryType> prophet::BundleEntryList< BundleEntryType >::List |
Definition at line 39 of file BundleTLVEntryList.h.
prophet::BundleEntryList< BundleEntryType >::BundleEntryList | ( | BundleTLVEntry::bundle_entry_t | type = BundleTLVEntry::UNDEFINED |
) | [inline] |
Default constructor.
Definition at line 48 of file BundleTLVEntryList.h.
prophet::BundleEntryList< BundleEntryType >::BundleEntryList | ( | const BundleEntryList< BundleEntryType > & | list | ) | [inline] |
Copy constructor.
Definition at line 55 of file BundleTLVEntryList.h.
virtual prophet::BundleEntryList< BundleEntryType >::~BundleEntryList | ( | ) | [inline, virtual] |
Destructor.
Definition at line 61 of file BundleTLVEntryList.h.
bool prophet::BundleEntryList< BundleEntryType >::add_entry | ( | BundleTLVEntry::bundle_entry_t | type, | |
u_int32_t | cts, | |||
u_int32_t | seq, | |||
u_int16_t | sid, | |||
bool | custody = false , |
|||
bool | accept = false , |
|||
bool | ack = false | |||
) | [inline, protected] |
Convenience method for adding new entry to this Bundle offer list, return whether successful.
Definition at line 178 of file BundleTLVEntryList.h.
bool prophet::BundleEntryList< BundleEntryType >::add_entry | ( | const BundleEntryType * | entry | ) | [inline] |
Add a Bundle entry to this list; return whether successful.
Definition at line 81 of file BundleTLVEntryList.h.
Referenced by prophet::BundleEntryList< BundleOfferEntry >::add_entry().
const BundleEntryType* prophet::BundleEntryList< BundleEntryType >::back | ( | ) | const [inline] |
Convenience method to access last entry in list, or NULL if empty.
Definition at line 156 of file BundleTLVEntryList.h.
Referenced by prophet::TLVCreator::response().
const_iterator prophet::BundleEntryList< BundleEntryType >::begin | ( | ) | const [inline] |
These iterators are not thread safe.
Definition at line 144 of file BundleTLVEntryList.h.
iterator prophet::BundleEntryList< BundleEntryType >::begin | ( | ) | [inline] |
These iterators are not thread safe.
Definition at line 142 of file BundleTLVEntryList.h.
Referenced by prophet::Encounter::handle_response_tlv(), prophet::TLVCreator::offer(), prophet::TLVCreator::response(), prophet::ResponseTLV::serialize(), and prophet::OfferTLV::serialize().
void prophet::BundleEntryList< BundleEntryType >::clear | ( | ) | [inline] |
Remove all entries from internal list.
Definition at line 76 of file BundleTLVEntryList.h.
Referenced by prophet::BundleOffer::get_bundle_offer().
bool prophet::BundleEntryList< BundleEntryType >::empty | ( | ) | const [inline] |
Return whether list is empty.
Definition at line 71 of file BundleTLVEntryList.h.
Referenced by prophet::ResponseTLV::deserialize(), prophet::OfferTLV::deserialize(), prophet::Encounter::handle_response_tlv(), prophet::TLVCreator::offer(), and prophet::Encounter::send_response().
const_iterator prophet::BundleEntryList< BundleEntryType >::end | ( | ) | const [inline] |
These iterators are not thread safe.
Definition at line 145 of file BundleTLVEntryList.h.
iterator prophet::BundleEntryList< BundleEntryType >::end | ( | ) | [inline] |
These iterators are not thread safe.
Definition at line 143 of file BundleTLVEntryList.h.
Referenced by prophet::Encounter::handle_response_tlv(), prophet::TLVCreator::offer(), prophet::TLVCreator::response(), prophet::ResponseTLV::serialize(), and prophet::OfferTLV::serialize().
const BundleEntryType* prophet::BundleEntryList< BundleEntryType >::find | ( | u_int32_t | cts, | |
u_int32_t | seq, | |||
u_int16_t | sid | |||
) | const [inline] |
Return pointer to entry if found, else return NULL.
Definition at line 118 of file BundleTLVEntryList.h.
const BundleEntryType* prophet::BundleEntryList< BundleEntryType >::front | ( | ) | const [inline] |
Convenience method to access first entry in list, or NULL if empty.
Definition at line 151 of file BundleTLVEntryList.h.
size_t prophet::BundleEntryList< BundleEntryType >::guess_size | ( | size_t | BOEsz | ) | const [inline] |
Estimate serialized buffer length.
Definition at line 161 of file BundleTLVEntryList.h.
Referenced by prophet::ResponseTLV::serialize(), and prophet::OfferTLV::serialize().
BundleEntryList& prophet::BundleEntryList< BundleEntryType >::operator= | ( | const BundleEntryList< BundleEntryType > & | list | ) | [inline] |
Assignment operator.
Definition at line 166 of file BundleTLVEntryList.h.
virtual bool prophet::BundleEntryList< BundleEntryType >::push_back | ( | BundleEntryType * | bo | ) | [protected, pure virtual] |
Add entry to back of list.
Implemented in prophet::BundleOfferList, and prophet::BundleResponseList.
Referenced by prophet::BundleEntryList< BundleOfferEntry >::add_entry().
bool prophet::BundleEntryList< BundleEntryType >::remove_entry | ( | u_int32_t | cts, | |
u_int32_t | seq, | |||
u_int16_t | sid | |||
) | [inline] |
Remove entry from Bundle offer list; returns true if found (and removed) else false if it did not exist.
Definition at line 97 of file BundleTLVEntryList.h.
Referenced by prophet::Encounter::handle_bundle_received().
size_t prophet::BundleEntryList< BundleEntryType >::size | ( | ) | const [inline] |
Return number of Bundle offers in list.
Definition at line 66 of file BundleTLVEntryList.h.
Referenced by prophet::BundleEntryList< BundleOfferEntry >::guess_size(), prophet::Encounter::handle_offer_tlv(), prophet::Encounter::handle_response_tlv(), prophet::ResponseTLV::serialize(), and prophet::OfferTLV::serialize().
BundleTLVEntry::bundle_entry_t prophet::BundleEntryList< BundleEntryType >::type | ( | ) | const [inline] |
Return type of entries hosted by this list.
Definition at line 139 of file BundleTLVEntryList.h.
List prophet::BundleEntryList< BundleEntryType >::list_ [protected] |
Definition at line 215 of file BundleTLVEntryList.h.
Referenced by prophet::BundleEntryList< BundleOfferEntry >::back(), prophet::BundleEntryList< BundleOfferEntry >::begin(), prophet::BundleEntryList< BundleOfferEntry >::clear(), prophet::BundleEntryList< BundleOfferEntry >::empty(), prophet::BundleEntryList< BundleOfferEntry >::end(), prophet::BundleEntryList< BundleOfferEntry >::find(), prophet::BundleEntryList< BundleOfferEntry >::front(), prophet::BundleEntryList< BundleOfferEntry >::operator=(), prophet::BundleEntryList< BundleOfferEntry >::remove_entry(), prophet::BundleEntryList< BundleOfferEntry >::size(), and prophet::BundleEntryList< BundleOfferEntry >::~BundleEntryList().
BundleTLVEntry::bundle_entry_t prophet::BundleEntryList< BundleEntryType >::type_ [protected] |
type of Bundle entry in list
Definition at line 214 of file BundleTLVEntryList.h.
Referenced by prophet::BundleEntryList< BundleOfferEntry >::add_entry(), prophet::BundleEntryList< BundleOfferEntry >::operator=(), and prophet::BundleEntryList< BundleOfferEntry >::type().