#include <pydtn/FlatStore.h>


Public Types | ||||
| typedef std::set< DTN::Bundle * > | BundleList | |||
| The internal storage type. | ||||
| typedef BundleList::key_type | key_type | |||
| Convenient shorter version of the index type. | ||||
Public Member Functions | ||||
| FlatStore (DTN::Node *owner) | ||||
| Constructor. | ||||
| virtual | ~FlatStore () | |||
| Virtual destructor. | ||||
| BundleList::iterator | begin () | |||
| ||||
| BundleList::iterator | lower_bound (const key_type &x) | |||
| ||||
| BundleList::iterator | upper_bound (const key_type &x) | |||
| ||||
| BundleList::iterator | end () | |||
| ||||
| BundleList::const_iterator | begin () const | |||
| ||||
| BundleList::const_iterator | lower_bound (const key_type &x) const | |||
| ||||
| BundleList::const_iterator | upper_bound (const key_type &x) const | |||
| ||||
| BundleList::const_iterator | end () const | |||
| ||||
Protected Member Functions | ||||
| virtual DTN::BundlePointer | p_addBundle (DTN::Bundle *b) | |||
| Add a DTN::Bundle to the store. | ||||
| virtual void | p_deleteBundle (DTN::Bundle *b) | |||
| Remove a DTN::Bundle from the store. | ||||
| virtual DTN::BundlePointer | p_getPointer (const DTN::BundlePointer &p) | |||
| Update a DTN::BundlePointer from the store. | ||||
| virtual DTN::BundlePointer | p_getPointer (const DTN::ByteString &sender, uint32_t seqNum) | |||
| Find a DTN::BundlePointer for a particular DTN::Bundle. | ||||
| virtual bool | p_validatePointer (const DTN::BundlePointer &p) | |||
| Test the validity of a DTN::BundlePointer. | ||||
| virtual size_t | p_bytesUsed () | |||
| The size of the data store. | ||||
| virtual size_t | p_bundles () | |||
| The number of bundles stored. | ||||
| virtual void | p_shrinkStore (size_t s) | |||
| Change the size of the data store. | ||||
Definition at line 43 of file FlatStore.h.
| FlatStore::BundleList::iterator FlatStore::lower_bound | ( | const key_type & | x | ) |
| x | An index into the store |
Definition at line 165 of file FlatStore.cc.
| FlatStore::BundleList::iterator FlatStore::upper_bound | ( | const key_type & | x | ) |
| x | An index into the store |
Definition at line 171 of file FlatStore.cc.
Referenced by FlatStoreItr::next().
| FlatStore::BundleList::const_iterator FlatStore::lower_bound | ( | const key_type & | x | ) | const |
| x | An index into the store |
Definition at line 189 of file FlatStore.cc.
| FlatStore::BundleList::const_iterator FlatStore::upper_bound | ( | const key_type & | x | ) | const |
| x | An index into the store |
Definition at line 195 of file FlatStore.cc.
| DTN::BundlePointer FlatStore::p_addBundle | ( | DTN::Bundle * | b | ) | [protected, virtual] |
Add a DTN::Bundle to the store.
| b | The bundle to add; ownership of the memory is taken by the store |
Implements DTN::VolatileBundleStore.
Definition at line 60 of file FlatStore.cc.
References DTN::Bundle::size().
| void FlatStore::p_deleteBundle | ( | DTN::Bundle * | b | ) | [protected, virtual] |
Remove a DTN::Bundle from the store.
| b | The bundle to delete |
Implements DTN::VolatileBundleStore.
Definition at line 73 of file FlatStore.cc.
References DTN::Bundle::size().
Referenced by p_shrinkStore().
| DTN::BundlePointer FlatStore::p_getPointer | ( | const DTN::BundlePointer & | p | ) | [protected, virtual] |
Update a DTN::BundlePointer from the store.
| p | A cached DTN::BundlePointer |
p.isNull(), a DTN::BundlePointer to the beginning of the store is returned. If there is no valid DTN::BundlePointer to return, a NULL pointer will be returned. Implements DTN::VolatileBundleStore.
Definition at line 83 of file FlatStore.cc.
References DTN::BundlePointer::isNull(), and DTN::BundlePointer::repr().
| DTN::BundlePointer FlatStore::p_getPointer | ( | const DTN::ByteString & | sender, | |
| uint32_t | seqNum | |||
| ) | [protected, virtual] |
Find a DTN::BundlePointer for a particular DTN::Bundle.
This uses the unique identifying information for a DTN::Bundle, rather than a pointer, so that we can match acknowledgements.
| sender | The originator of a DTN::Bundle | |
| seqNum | The originator's unique ID for a DTN::Bundle |
NULL DTN::BundlePointer if it isn't Implements DTN::VolatileBundleStore.
Definition at line 102 of file FlatStore.cc.
References end().
| bool FlatStore::p_validatePointer | ( | const DTN::BundlePointer & | p | ) | [protected, virtual] |
Test the validity of a DTN::BundlePointer.
| p | A cached DTN::BundlePointer |
| true | The referenced DTN::Bundle is in the store | |
| false | The referenced DTN::Bundle is not in the store |
Implements DTN::VolatileBundleStore.
Definition at line 125 of file FlatStore.cc.
References DTN::BundlePointer::isNull(), and DTN::BundlePointer::repr().
| virtual size_t FlatStore::p_bytesUsed | ( | ) | [inline, protected, virtual] |
The size of the data store.
Implements DTN::VolatileBundleStore.
Definition at line 126 of file FlatStore.h.
| virtual size_t FlatStore::p_bundles | ( | ) | [inline, protected, virtual] |
The number of bundles stored.
Implements DTN::VolatileBundleStore.
Definition at line 131 of file FlatStore.h.
| void FlatStore::p_shrinkStore | ( | size_t | s | ) | [protected, virtual] |
Change the size of the data store.
| s | The new size of the data store |
Implements DTN::VolatileBundleStore.
Definition at line 132 of file FlatStore.cc.
References end(), DTN::ExpiryDrop::inst, DTN::BundleStore::m_owner, and p_deleteBundle().
1.5.4