-
Notifications
You must be signed in to change notification settings - Fork 0
/
keyvalue.cc
32 lines (23 loc) · 861 Bytes
/
keyvalue.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "keyvalue.h"
namespace slope {
namespace keyvalue {
KeyValuePrefixMiddleware::KeyValuePrefixMiddleware(
std::unique_ptr<KeyValueService> impl, const std::string prefix):
impl_(std::move(impl)),
prefix_(prefix) {
}
bool KeyValuePrefixMiddleware::compare_and_swap(const std::string& key,
const std::string& oldv, const std::string& newv) {
return impl_->compare_and_swap(prefix_ + key, oldv, newv);
}
bool KeyValuePrefixMiddleware::set(const std::string& key, const std::string& val) {
return impl_->set(prefix_ + key, val);
}
bool KeyValuePrefixMiddleware::get(const std::string& key, std::string& ret) {
return impl_->get(prefix_ + key, ret);
}
bool KeyValuePrefixMiddleware::wait_for(const std::string& key, std::string& ret) {
return impl_->wait_for(prefix_ + key, ret);
}
} // namespace slope
} // namespace keyvalue