FlatStoreItr Class Reference
[pydtn]

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

#include <pydtn/FlatStore.h>

Inheritance diagram for FlatStoreItr:

Inheritance graph
[legend]
Collaboration diagram for FlatStoreItr:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 FlatStoreItr (FlatStore &store, FlatStore::BundleList::iterator itr)
 Constructor.
virtual ~FlatStoreItr ()
 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 FlatStore.

Definition at line 144 of file FlatStore.h.


Constructor & Destructor Documentation

FlatStoreItr::FlatStoreItr ( FlatStore store,
FlatStore::BundleList::iterator  itr 
)

Constructor.

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

Definition at line 211 of file FlatStore.cc.

Referenced by clone(), and next().


Member Function Documentation

bool FlatStoreItr::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 224 of file FlatStore.cc.

References DTN::BundlePointerRepr::bundle().

DTN::BundlePointerRepr * FlatStoreItr::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 230 of file FlatStore.cc.

References FlatStore::end(), FlatStoreItr(), and FlatStore::upper_bound().

DTN::BundlePointerRepr * FlatStoreItr::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 241 of file FlatStore.cc.

References FlatStoreItr().

DTN::Bundle * FlatStoreItr::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 247 of file FlatStore.cc.


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