#include <dht/search_handler.h>
Inheritance diagram for dht::search_handler:
Public Member Functions | |
virtual int | found (const dht::key &k, const dht::value &v)=0 |
Called when a new search result has been obtained. | |
virtual void | success (const dht::key &k) |
Called if search finished successfully. | |
virtual void | failure (const dht::key &k, int error, const char *errstr) |
Called if search terminated because of an error. | |
virtual void | success () |
Called in case of success. | |
virtual void | failure (int error, const char *errstr) |
Called in case of a failure. |
Classes that implement this interface can receive and react to search result notifications from DHT implementations.
virtual int dht::search_handler::found | ( | const dht::key & | k, | |
const dht::value & | v | |||
) | [pure virtual] |
Called when a new search result has been obtained.
k | The key that was searched | |
v | The value that was obtained |
The return value from this overrides any return value that might have been returned by an observer.
virtual void dht::search_handler::success | ( | const dht::key & | k | ) | [virtual] |
Called if search finished successfully.
k | the key that was searched |
virtual void dht::search_handler::failure | ( | const dht::key & | k, | |
int | error, | |||
const char * | errstr | |||
) | [virtual] |
Called if search terminated because of an error.
k | the key that was searched | |
error | an error code | |
errstr | a NULL terminated string giving exact reason for the error |
virtual void dht::search_handler::success | ( | ) | [virtual] |
virtual void dht::search_handler::failure | ( | int | error, | |
const char * | errstr | |||
) | [virtual] |
Called in case of a failure.
error | an error code | |
errstr | a NULL terminated string giving exact reason for the error |
Implements dht::notify_handler.