prophet::BundleEntryList< BundleEntryType > Class Template Reference

BundleEntryList is the in-memory representation of the Bundle offer that is exchanged between peers as Bundle TLV. More...

#include <BundleTLVEntryList.h>

List of all members.

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.
BundleEntryListoperator= (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_


Detailed Description

template<class BundleEntryType>
class prophet::BundleEntryList< BundleEntryType >

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.


Member Typedef Documentation

template<class BundleEntryType>
typedef PointerList<BundleEntryType>::const_iterator prophet::BundleEntryList< BundleEntryType >::const_iterator

Definition at line 43 of file BundleTLVEntryList.h.

template<class BundleEntryType>
typedef PointerList<BundleEntryType>::iterator prophet::BundleEntryList< BundleEntryType >::iterator

Definition at line 41 of file BundleTLVEntryList.h.

template<class BundleEntryType>
typedef PointerList<BundleEntryType> prophet::BundleEntryList< BundleEntryType >::List

Definition at line 39 of file BundleTLVEntryList.h.


Constructor & Destructor Documentation

template<class BundleEntryType>
prophet::BundleEntryList< BundleEntryType >::BundleEntryList ( BundleTLVEntry::bundle_entry_t  type = BundleTLVEntry::UNDEFINED  )  [inline]

Default constructor.

Definition at line 48 of file BundleTLVEntryList.h.

template<class BundleEntryType>
prophet::BundleEntryList< BundleEntryType >::BundleEntryList ( const BundleEntryList< BundleEntryType > &  list  )  [inline]

Copy constructor.

Definition at line 55 of file BundleTLVEntryList.h.

template<class BundleEntryType>
virtual prophet::BundleEntryList< BundleEntryType >::~BundleEntryList (  )  [inline, virtual]

Destructor.

Definition at line 61 of file BundleTLVEntryList.h.


Member Function Documentation

template<class BundleEntryType>
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.

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

template<class BundleEntryType>
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.

template<class BundleEntryType>
const_iterator prophet::BundleEntryList< BundleEntryType >::begin (  )  const [inline]

These iterators are not thread safe.

Definition at line 144 of file BundleTLVEntryList.h.

template<class BundleEntryType>
iterator prophet::BundleEntryList< BundleEntryType >::begin (  )  [inline]

These iterators are not thread safe.

Definition at line 142 of file BundleTLVEntryList.h.

Referenced by prophet::ResponseTLV::serialize(), and prophet::OfferTLV::serialize().

template<class BundleEntryType>
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().

template<class BundleEntryType>
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(), and prophet::OfferTLV::deserialize().

template<class BundleEntryType>
const_iterator prophet::BundleEntryList< BundleEntryType >::end (  )  const [inline]

These iterators are not thread safe.

Definition at line 145 of file BundleTLVEntryList.h.

template<class BundleEntryType>
iterator prophet::BundleEntryList< BundleEntryType >::end (  )  [inline]

These iterators are not thread safe.

Definition at line 143 of file BundleTLVEntryList.h.

Referenced by prophet::ResponseTLV::serialize(), and prophet::OfferTLV::serialize().

template<class BundleEntryType>
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.

template<class BundleEntryType>
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.

template<class BundleEntryType>
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().

template<class BundleEntryType>
BundleEntryList& prophet::BundleEntryList< BundleEntryType >::operator= ( const BundleEntryList< BundleEntryType > &  list  )  [inline]

Assignment operator.

Definition at line 166 of file BundleTLVEntryList.h.

template<class BundleEntryType>
virtual bool prophet::BundleEntryList< BundleEntryType >::push_back ( BundleEntryType *  bo  )  [protected, pure virtual]

template<class BundleEntryType>
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.

template<class BundleEntryType>
size_t prophet::BundleEntryList< BundleEntryType >::size (  )  const [inline]

template<class BundleEntryType>
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.


Member Data Documentation

template<class BundleEntryType>
List prophet::BundleEntryList< BundleEntryType >::list_ [protected]

template<class BundleEntryType>
BundleTLVEntry::bundle_entry_t prophet::BundleEntryList< BundleEntryType >::type_ [protected]


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

Generated on Fri Jan 30 09:27:06 2009 for DTN Reference Implementation by  doxygen 1.5.8