OverSim
|
A STL-vector that supports inserts sorted by an OverlayKey found somewhere in the type. More...
#include <NodeVector.h>
Public Types | |
typedef std::vector< T >::iterator | iterator |
iterator for this vector | |
typedef std::vector< T > ::const_iterator | const_iterator |
read-only iterator for this vector |
Public Member Functions | |
BaseKeySortedVector (uint16_t maxSize=0, const Comparator< OverlayKey > *comparator=NULL, const AbstractProxComparator *proxComparator=NULL, const AbstractProxKeyComparator *proxKeyComparator=NULL, uint16_t sizeProx=0, uint16_t sizeComb=0) | |
constructor | |
virtual | ~BaseKeySortedVector () |
destructor | |
bool | isAddable (const T &element) const |
indicates if an object of type T can be added to the NodeVector | |
bool | isFull () const |
indicates if NodeVector holds maxSize nodes | |
bool | isEmpty () const |
indicates if NodeVector holds at least one node | |
int | add (const T &element) |
adds an element of type T in increasing order to the NodeVector and returns the position of the added element or -1 if the element was not added | |
const bool | contains (const OverlayKey &key) const |
Searches for an OverlayKey in NodeVector and returns true, if it is found. | |
const T & | find (const OverlayKey &key) const |
searches for an OverlayKey in NodeVector | |
iterator | findIterator (const OverlayKey &key) |
Searches for an OberlayKey in a NodeVector and returns an appropriate iterator. | |
void | downsizeTo (const uint32_t maxElements) |
Downsize the vector to a maximum of maxElements. | |
void | setComparator (const Comparator< OverlayKey > *comparator) |
Static Public Attributes | |
static const T | UNSPECIFIED_ELEMENT |
unspecified element of type T |
Private Attributes | |
const Comparator< OverlayKey > * | comparator |
the OverlayKey Comparator for this vector | |
const AbstractProxComparator * | proxComparator |
const AbstractProxKeyComparator * | proxKeyComparator |
uint16_t | maxSize |
maximum nodes this vector holds | |
uint16_t | sizeProx |
uint16_t | sizeComb |
A STL-vector that supports inserts sorted by an OverlayKey found somewhere in the type.
maxSize | maximum nodes this vector holds |
comparator | OverlayKey Comparator for this vector |
useRtt | sort by rtt after sorting using the comparator destructor indicates if an object of type T can be added to the NodeVector |
element | the element to add |
element | the element to add |
key | the OverlayKey to find |
key | the OverlayKey to find |
key | The key to search |
maxElements | The maximum number of elements after downsizing |
Definition at line 363 of file NodeVector.h.
typedef std::vector<T>::const_iterator BaseKeySortedVector< T, T_key, T_prox, T_address >::const_iterator |
read-only iterator for this vector
Definition at line 404 of file NodeVector.h.
typedef std::vector<T>::iterator BaseKeySortedVector< T, T_key, T_prox, T_address >::iterator |
iterator for this vector
Definition at line 401 of file NodeVector.h.
|
inline |
constructor
maxSize | maximum nodes this vector holds |
comparator | OverlayKey comparator for this vector |
proxComparator | proximity comparator for this vector |
proxKeyComparator | proximity/key comparator for this vector |
sizeProx | number of nodes sorted by proximity |
sizeComb | number of nodes sorted by proximity/key |
Definition at line 384 of file NodeVector.h.
|
inlinevirtual |
|
inline |
adds an element of type T in increasing order to the NodeVector and returns the position of the added element or -1 if the element was not added
element | the element to add |
Definition at line 464 of file NodeVector.h.
Referenced by IterativePathLookup::add(), BaseKeySortedVector< LookupEntry >::add(), IterativeLookup::addSibling(), IterativeLookup::checkStop(), BrooseBucket::fillVector(), PastryNeighborhoodSet::findCloserNodes(), PastryRoutingTable::findCloserNodes(), PastryLeafSet::findCloserNodes(), MyOverlay::findNode(), BasePastry::findNode(), Kademlia::findNode(), Broose::findNode(), IterativePathLookup::handleFailedNodeResponse(), DHT::handlePutRequest(), IterativePathLookup::handleTimeout(), Kademlia::refillSiblingTable(), Kademlia::routingAdd(), and NeighborCache::updateNode().
|
inline |
Searches for an OverlayKey in NodeVector and returns true, if it is found.
key | the OverlayKey to find |
Definition at line 589 of file NodeVector.h.
Referenced by BasePastry::isSiblingFor().
|
inline |
Downsize the vector to a maximum of maxElements.
maxElements | The maximum number of elements after downsizing |
Definition at line 634 of file NodeVector.h.
Referenced by oversim::Chord::findNode().
|
inline |
searches for an OverlayKey in NodeVector
key | the OverlayKey to find |
Definition at line 605 of file NodeVector.h.
Referenced by DHT::handleGetResponse().
|
inline |
Searches for an OberlayKey in a NodeVector and returns an appropriate iterator.
key | The key to search |
Definition at line 621 of file NodeVector.h.
Referenced by IterativePathLookup::handleTimeout(), Kademlia::routingAdd(), and Kademlia::routingTimeout().
|
inline |
indicates if an object of type T can be added to the NodeVector
element | the element to add |
Definition at line 417 of file NodeVector.h.
Referenced by BaseKeySortedVector< LookupEntry >::add(), IterativeLookup::addSibling(), and Kademlia::routingAdd().
|
inline |
indicates if NodeVector holds at least one node
Definition at line 452 of file NodeVector.h.
Referenced by Kademlia::findNode().
|
inline |
indicates if NodeVector holds maxSize nodes
Definition at line 442 of file NodeVector.h.
Referenced by IterativeLookup::addSibling(), Kademlia::findNode(), Kademlia::isSiblingFor(), Kademlia::refillSiblingTable(), and Kademlia::routingAdd().
|
inline |
Definition at line 641 of file NodeVector.h.
Referenced by Broose::findNode(), and Kademlia::routingInit().
|
private |
the OverlayKey Comparator for this vector
Definition at line 366 of file NodeVector.h.
Referenced by BaseKeySortedVector< LookupEntry >::add(), BaseKeySortedVector< LookupEntry >::isAddable(), and BaseKeySortedVector< LookupEntry >::setComparator().
|
private |
maximum nodes this vector holds
Definition at line 369 of file NodeVector.h.
Referenced by BaseKeySortedVector< LookupEntry >::add(), BaseKeySortedVector< LookupEntry >::isAddable(), and BaseKeySortedVector< LookupEntry >::isFull().
|
private |
Definition at line 367 of file NodeVector.h.
Referenced by BaseKeySortedVector< LookupEntry >::add(), and BaseKeySortedVector< LookupEntry >::isAddable().
|
private |
Definition at line 368 of file NodeVector.h.
Referenced by BaseKeySortedVector< LookupEntry >::add(), and BaseKeySortedVector< LookupEntry >::isAddable().
|
private |
Definition at line 371 of file NodeVector.h.
Referenced by BaseKeySortedVector< LookupEntry >::add().
|
private |
Definition at line 370 of file NodeVector.h.
Referenced by BaseKeySortedVector< LookupEntry >::add().
|
static |
unspecified element of type T
an unspecified element of the NodeVector
Definition at line 406 of file NodeVector.h.
Referenced by BaseKeySortedVector< LookupEntry >::find().