OverSim
AbstractLookup Class Reference

This class declares an abstract iterative lookup. More...

#include <AbstractLookup.h>

Inheritance diagram for AbstractLookup:
IterativeLookup RecursiveLookup

Public Member Functions

virtual ~AbstractLookup ()
 Virtual destructor.
virtual void lookup (const OverlayKey &key, int numSiblings=1, int hopCountMax=0, int retries=0, LookupListener *listener=NULL)=0
 Lookup siblings for a key.
virtual const NodeVectorgetResult () const =0
 Returns the result of the lookup.
virtual bool isValid () const =0
 Returns true, if the lookup was successful.
virtual void abortLookup ()=0
 Aborts a running lookup.
virtual uint32_t getAccumulatedHops () const =0
 Returns the total number of hops for all lookup paths.

Detailed Description

This class declares an abstract iterative lookup.

Author
Sebastian Mies

Definition at line 37 of file AbstractLookup.h.

Constructor & Destructor Documentation

AbstractLookup::~AbstractLookup ( )
virtual

Virtual destructor.

Definition at line 43 of file IterativeLookup.cc.

{}

Member Function Documentation

virtual void AbstractLookup::abortLookup ( )
pure virtual

Aborts a running lookup.

This method aborts a running lookup without calling the listener and delete the lookup object.

Implemented in IterativeLookup, and RecursiveLookup.

virtual uint32_t AbstractLookup::getAccumulatedHops ( ) const
pure virtual

Returns the total number of hops for all lookup paths.

Returns
The accumulated number of hops.

Implemented in IterativeLookup, and RecursiveLookup.

Referenced by SendToKeyListener::lookupFinished().

virtual const NodeVector& AbstractLookup::getResult ( ) const
pure virtual

Returns the result of the lookup.

Returns
The result node vector.

Implemented in IterativeLookup, and RecursiveLookup.

Referenced by Bamboo::lookupFinished(), and SendToKeyListener::lookupFinished().

virtual bool AbstractLookup::isValid ( ) const
pure virtual

Returns true, if the lookup was successful.

Returns
true, if the lookup was successful.

Implemented in IterativeLookup, and RecursiveLookup.

Referenced by Bamboo::lookupFinished(), KademliaLookupListener::lookupFinished(), and SendToKeyListener::lookupFinished().

virtual void AbstractLookup::lookup ( const OverlayKey key,
int  numSiblings = 1,
int  hopCountMax = 0,
int  retries = 0,
LookupListener listener = NULL 
)
pure virtual

Lookup siblings for a key.

Parameters
keyThe key to lookup
numSiblingsNumber of siblings to lookup
hopCountMaxMaximum hop count
retriesNumber of retries if lookup fails
listenerListener to inform, when the lookup is done

Implemented in IterativeLookup, and RecursiveLookup.

Referenced by Bamboo::doGlobalTuning(), Kademlia::handleBucketRefreshTimerExpired(), Kademlia::handleRpcResponse(), BaseOverlay::lookupRpc(), and BaseOverlay::sendToKey().


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