prophet::BundleTLVEntry Class Reference

BundleTLVEntry is the in-memory representation of an element listed within the Bundle Offer and Response TLV, p. More...

#include <BundleTLVEntry.h>

Inheritance diagram for prophet::BundleTLVEntry:

prophet::BundleOfferEntry prophet::BundleResponseEntry

List of all members.

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.
BundleTLVEntryoperator= (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 BundleTLVEntrycreate_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


Detailed Description

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.


Member Enumeration Documentation

A BundleTLVEntry can represent either an OFFER or a RESPONSE, depending on what is inferred from the flags.

Enumerator:
UNDEFINED  no valid type has been specified
OFFER  Bundle OFFER.
RESPONSE  Bundle RESPONSE.

Definition at line 38 of file BundleTLVEntry.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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< BundleResponseEntry >::add_entry().

u_int32_t prophet::BundleTLVEntry::creation_ts (  )  const [inline]

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(), init_type(), and prophet::BundleTLV::read_bundle_entry().

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.

References cts_, seq_, and sid_.

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]

u_int16_t prophet::BundleTLVEntry::sid (  )  const [inline]

virtual bundle_entry_t prophet::BundleTLVEntry::type (  )  const [inline, virtual]

static const char* prophet::BundleTLVEntry::type_to_str ( bundle_entry_t  type  )  [inline, static]

Convenience function.

Definition at line 48 of file BundleTLVEntry.h.

References OFFER, RESPONSE, and UNDEFINED.


Member Data Documentation

whether this Bundle Entry is accepted

Definition at line 220 of file BundleTLVEntry.h.

Referenced by accept(), init_type(), and operator=().

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=().

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().


The documentation for this class was generated from the following file:

Generated on Fri Jan 30 09:43:16 2009 for DTN Reference Implementation by  doxygen 1.5.8