BundleTLVEntry is the in-memory representation of an element listed within the Bundle Offer and Response TLV, p. More...
#include <BundleTLVEntry.h>
Public Types | |
enum | bundle_entry_t { UNDEFINED = 0, OFFER, RESPONSE } |
A BundleTLVEntry can represent either an OFFER or a RESPONSE, depending on what is inferred from the flags. More... | |
Public Member Functions | |
BundleTLVEntry (const BundleTLVEntry &b) | |
Copy constructor. | |
BundleTLVEntry & | operator= (const BundleTLVEntry &b) |
Assignment operator. | |
virtual | ~BundleTLVEntry () |
Destructor. | |
bool | operator< (const BundleTLVEntry &b) const |
Comparison operator to facilitate STL sorting. | |
u_int32_t | creation_ts () const |
Accessors. | |
u_int32_t | seqno () const |
Accessors. | |
u_int16_t | sid () const |
Accessors. | |
bool | custody () const |
Accessors. | |
bool | accept () const |
Accessors. | |
bool | ack () const |
Accessors. | |
virtual bundle_entry_t | type () const |
Accessors. | |
Static Public Member Functions | |
static const char * | type_to_str (bundle_entry_t type) |
Convenience function. | |
static BundleTLVEntry * | create_entry (u_int32_t cts, u_int32_t seq, u_int16_t sid, bool custody, bool accept, bool ack) |
Factory method for convenience. | |
static bundle_entry_t | decode_flags (bool custody, bool accept, bool ack) |
Utility function to decipher which Bundle_X_Entry type based on the combination of flags. | |
Protected Member Functions | |
BundleTLVEntry (bundle_entry_t type=UNDEFINED) | |
Default constructor, only used by friend classes. | |
BundleTLVEntry (u_int32_t cts, u_int32_t seq, u_int16_t sid, bool custody=false, bool accept=false, bool ack=false, bundle_entry_t type=UNDEFINED) | |
Constructor, only to be used by factory methods and friend classes. | |
void | init_type (bundle_entry_t type) |
Initialization routine used by constructors and assignment operator. | |
Protected Attributes | |
u_int32_t | cts_ |
Creation timestamp. | |
u_int32_t | seq_ |
sub-second sequence number | |
u_int16_t | sid_ |
string id of bundle destination | |
bool | custody_ |
whether this node accepts custody | |
bool | accept_ |
whether this Bundle Entry is accepted | |
bool | ack_ |
represents successful Prophet delivery for bundle | |
bundle_entry_t | type_ |
indicates whether offer or response TLV |
BundleTLVEntry is the in-memory representation of an element listed within the Bundle Offer and Response TLV, p.
30, 4.4.5
Definition at line 31 of file BundleTLVEntry.h.
A BundleTLVEntry can represent either an OFFER or a RESPONSE, depending on what is inferred from the flags.
UNDEFINED |
no valid type has been specified |
OFFER |
Bundle OFFER. |
RESPONSE |
Bundle RESPONSE. |
Definition at line 38 of file BundleTLVEntry.h.
prophet::BundleTLVEntry::BundleTLVEntry | ( | bundle_entry_t | type = UNDEFINED |
) | [inline, protected] |
Default constructor, only used by friend classes.
Definition at line 70 of file BundleTLVEntry.h.
prophet::BundleTLVEntry::BundleTLVEntry | ( | u_int32_t | cts, | |
u_int32_t | seq, | |||
u_int16_t | sid, | |||
bool | custody = false , |
|||
bool | accept = false , |
|||
bool | ack = false , |
|||
bundle_entry_t | type = UNDEFINED | |||
) | [inline, protected] |
Constructor, only to be used by factory methods and friend classes.
Definition at line 77 of file BundleTLVEntry.h.
References init_type(), and type().
prophet::BundleTLVEntry::BundleTLVEntry | ( | const BundleTLVEntry & | b | ) | [inline] |
Copy constructor.
Definition at line 90 of file BundleTLVEntry.h.
References init_type(), and type_.
virtual prophet::BundleTLVEntry::~BundleTLVEntry | ( | ) | [inline, virtual] |
Destructor.
Definition at line 116 of file BundleTLVEntry.h.
bool prophet::BundleTLVEntry::accept | ( | ) | const [inline] |
Accessors.
Definition at line 139 of file BundleTLVEntry.h.
References accept_.
Referenced by prophet::ResponseTLV::serialize(), and prophet::OfferTLV::serialize().
bool prophet::BundleTLVEntry::ack | ( | ) | const [inline] |
Accessors.
Definition at line 140 of file BundleTLVEntry.h.
References ack_.
Referenced by prophet::ResponseTLV::serialize(), and prophet::OfferTLV::serialize().
BundleTLVEntry * prophet::BundleTLVEntry::create_entry | ( | u_int32_t | cts, | |
u_int32_t | seq, | |||
u_int16_t | sid, | |||
bool | custody, | |||
bool | accept, | |||
bool | ack | |||
) | [inline, static] |
Factory method for convenience.
Definition at line 303 of file BundleTLVEntry.h.
References decode_flags(), OFFER, RESPONSE, and UNDEFINED.
Referenced by prophet::BundleEntryList< BundleOfferEntry >::add_entry().
u_int32_t prophet::BundleTLVEntry::creation_ts | ( | ) | const [inline] |
Accessors.
Definition at line 135 of file BundleTLVEntry.h.
References cts_.
Referenced by prophet::BundleResponseList::push_back(), prophet::BundleOfferList::push_back(), prophet::TLVCreator::response(), prophet::ResponseTLV::serialize(), and prophet::OfferTLV::serialize().
bool prophet::BundleTLVEntry::custody | ( | ) | const [inline] |
Accessors.
Definition at line 138 of file BundleTLVEntry.h.
References custody_.
Referenced by prophet::ResponseTLV::serialize(), and prophet::OfferTLV::serialize().
static bundle_entry_t prophet::BundleTLVEntry::decode_flags | ( | bool | custody, | |
bool | accept, | |||
bool | ack | |||
) | [inline, static] |
Utility function to decipher which Bundle_X_Entry type based on the combination of flags.
Definition at line 148 of file BundleTLVEntry.h.
References OFFER, RESPONSE, and UNDEFINED.
Referenced by create_entry(), and init_type().
void prophet::BundleTLVEntry::init_type | ( | bundle_entry_t | type | ) | [inline, protected] |
Initialization routine used by constructors and assignment operator.
Definition at line 185 of file BundleTLVEntry.h.
References accept_, ack_, custody_, decode_flags(), type_, and UNDEFINED.
Referenced by BundleTLVEntry(), and operator=().
bool prophet::BundleTLVEntry::operator< | ( | const BundleTLVEntry & | b | ) | const [inline] |
Comparison operator to facilitate STL sorting.
Definition at line 121 of file BundleTLVEntry.h.
BundleTLVEntry& prophet::BundleTLVEntry::operator= | ( | const BundleTLVEntry & | b | ) | [inline] |
Assignment operator.
Definition at line 100 of file BundleTLVEntry.h.
References accept_, ack_, cts_, custody_, init_type(), seq_, sid_, and type_.
u_int32_t prophet::BundleTLVEntry::seqno | ( | ) | const [inline] |
Accessors.
Definition at line 136 of file BundleTLVEntry.h.
References seq_.
Referenced by prophet::BundleResponseList::push_back(), prophet::BundleOfferList::push_back(), prophet::TLVCreator::response(), prophet::ResponseTLV::serialize(), and prophet::OfferTLV::serialize().
u_int16_t prophet::BundleTLVEntry::sid | ( | ) | const [inline] |
Accessors.
Definition at line 137 of file BundleTLVEntry.h.
References sid_.
Referenced by prophet::BundleResponseList::push_back(), prophet::BundleOfferList::push_back(), prophet::TLVCreator::response(), prophet::ResponseTLV::serialize(), and prophet::OfferTLV::serialize().
virtual bundle_entry_t prophet::BundleTLVEntry::type | ( | ) | const [inline, virtual] |
Accessors.
Definition at line 141 of file BundleTLVEntry.h.
References type_.
Referenced by prophet::BundleEntryList< BundleOfferEntry >::add_entry(), BundleTLVEntry(), prophet::ResponseTLV::serialize(), and prophet::OfferTLV::serialize().
static const char* prophet::BundleTLVEntry::type_to_str | ( | bundle_entry_t | type | ) | [inline, static] |
Convenience function.
Definition at line 48 of file BundleTLVEntry.h.
bool prophet::BundleTLVEntry::accept_ [protected] |
whether this Bundle Entry is accepted
Definition at line 220 of file BundleTLVEntry.h.
Referenced by accept(), init_type(), and operator=().
bool prophet::BundleTLVEntry::ack_ [protected] |
represents successful Prophet delivery for bundle
Definition at line 221 of file BundleTLVEntry.h.
Referenced by ack(), init_type(), and operator=().
u_int32_t prophet::BundleTLVEntry::cts_ [protected] |
Creation timestamp.
Definition at line 216 of file BundleTLVEntry.h.
Referenced by creation_ts(), operator<(), and operator=().
bool prophet::BundleTLVEntry::custody_ [protected] |
whether this node accepts custody
Definition at line 219 of file BundleTLVEntry.h.
Referenced by custody(), init_type(), and operator=().
u_int32_t prophet::BundleTLVEntry::seq_ [protected] |
sub-second sequence number
Definition at line 217 of file BundleTLVEntry.h.
Referenced by operator<(), operator=(), and seqno().
u_int16_t prophet::BundleTLVEntry::sid_ [protected] |
string id of bundle destination
Definition at line 218 of file BundleTLVEntry.h.
Referenced by operator<(), operator=(), and sid().
bundle_entry_t prophet::BundleTLVEntry::type_ [protected] |
indicates whether offer or response TLV
Definition at line 222 of file BundleTLVEntry.h.
Referenced by prophet::BundleOfferEntry::BundleOfferEntry(), prophet::BundleResponseEntry::BundleResponseEntry(), BundleTLVEntry(), init_type(), operator=(), and type().