00001 #ifndef _DHT_EVENT_OBSERVER_H_
00002 #define _DHT_EVENT_OBSERVER_H_
00003
00004 #include "common.h"
00005 #include "key.h"
00006 #include "value.h"
00007
00008 namespace dht {
00009
00010 class client;
00011
00019 class event_observer {
00020
00021 public:
00022 event_observer();
00023 virtual ~event_observer();
00024
00025 enum {
00026 mask_state_changed = 1 << 0,
00027 mask_search_result = 1 << 1,
00028 mask_last = 1 << 2,
00029 mask_all = 1 << 2 - 1,
00030 };
00031
00039 virtual int state_changed(int s);
00040
00051 virtual int search_result(const dht::key &k, const dht::value &v);
00052 };
00053 }
00054
00055 #endif // _DHT_EVENT_OBSERVER_H_