Epidemic::EpidemicStoreItr Class Reference

Representation of a DTN::BundlePointer as an iterator for EpidemicStore. More...

#include <epidemic/EpidemicStore.h>

Inheritance diagram for Epidemic::EpidemicStoreItr:

Inheritance graph
[legend]
Collaboration diagram for Epidemic::EpidemicStoreItr:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 EpidemicStoreItr (EpidemicStore &store, EpidemicStore::iterator itr)
 Constructor.
virtual ~EpidemicStoreItr ()
 Virtual destructor.
virtual bool operator== (const DTN::BundlePointerRepr &b)
 Equality operator.
virtual DTN::BundlePointerReprnext ()
 Get the next iterator for the store.
virtual DTN::BundlePointerReprclone ()
 Copy an iterator.
virtual DTN::Bundlebundle () const
 Retrieve the actual stored DTN::Bundle.


Detailed Description

Representation of a DTN::BundlePointer as an iterator for EpidemicStore.

Definition at line 262 of file EpidemicStore.h.


Constructor & Destructor Documentation

EpidemicStoreItr::EpidemicStoreItr ( EpidemicStore store,
EpidemicStore::iterator  itr 
)

Constructor.

Parameters:
store The store into which this is an iterator
itr The internal iterator from store

Definition at line 418 of file EpidemicStore.cc.

Referenced by clone(), and next().


Member Function Documentation

bool EpidemicStoreItr::operator== ( const DTN::BundlePointerRepr b  )  [virtual]

Equality operator.

Parameters:
b Another iterator
Returns:
whether the two iterators refer to the same bundle

Implements DTN::BundlePointerRepr.

Definition at line 432 of file EpidemicStore.cc.

DTN::BundlePointerRepr * EpidemicStoreItr::next (  )  [virtual]

Get the next iterator for the store.

A new pointer is created, with the caller taking responsibility for the memory management.

Returns:
the store's next iterator, or NULL if there is none

Implements DTN::BundlePointerRepr.

Definition at line 438 of file EpidemicStore.cc.

References Epidemic::EpidemicStore::end(), EpidemicStoreItr(), and Epidemic::EpidemicStore::upper_bound().

DTN::BundlePointerRepr * EpidemicStoreItr::clone (  )  [virtual]

Copy an iterator.

A new pointer is created, with the caller taking responsibility for the memory management.

Returns:
a copy of this iterator

Implements DTN::BundlePointerRepr.

Definition at line 449 of file EpidemicStore.cc.

References EpidemicStoreItr().

DTN::Bundle * EpidemicStoreItr::bundle (  )  const [virtual]

Retrieve the actual stored DTN::Bundle.

Note that if you have not tested the DTN::BundlePointer that owns this DTN::BundlePointerRepr for validity, the returned pointer might not be valid.

Let me repeat that: You must test the encompassing DTN::BundlePointer for validity or you are very likely to get a segmentation fault at some point.

Returns:
a pointer to the stored DTN::Bundle

Implements DTN::BundlePointerRepr.

Definition at line 455 of file EpidemicStore.cc.


The documentation for this class was generated from the following files:
Generated on Mon Mar 24 11:15:48 2008 for Pydtn Simulator by  doxygen 1.5.4