Add proper per-file copyright notices/licenses and top-level license.
[bluesky.git] / kvstore / kvclient.h
1 #ifndef _KVCLIENT_H_
2 #define _KVCLIENT_H_ 1
3
4 #include "kvstore.pb.h"
5 #include "workqueue.h"
6 #include "protobufrpc.h"
7
8 using namespace bicker;
9
10 namespace kvstore
11 {
12     class KeyValueClientRouter;
13
14     class KeyValueClient
15     {
16     public:
17         KeyValueClient(const string& host,
18                        const string& port);
19
20         KeyValueClient(const list<string> &hosts);
21
22         bool Put(const string& key,
23                  const string& value);
24
25         bool Put(const string& key,
26                  const string& value,
27                  TaskNotification &tn);
28
29         bool Get(const string& key, string* value);
30
31         bool Get(const string& key,
32                  string* value,
33                  TaskNotification &tn);
34
35     private:
36         shared_ptr<KeyValueClientRouter> _router;
37     };
38 } // namespace kvstore
39
40 #endif