18 #include "hazelcast/client/proxy/TransactionalMapImpl.h" 37 return contains_key_data(to_data(key));
45 template<
typename K,
typename V>
46 boost::future<boost::optional<V>>
get(
const K &key) {
47 return to_object<V>(get_data(to_data(key)));
57 template<
typename K,
typename V,
typename R=V>
58 boost::future<boost::optional<R>>
put(
const K &key,
const V &value) {
59 return to_object<R>(put_data(to_data(key), to_data(value)));
69 template<
typename K,
typename V>
70 boost::future<void>
set(
const K &key,
const V &value) {
71 return set_data(to_data(key), to_data(value));
81 template<
typename K,
typename V,
typename R=V>
82 boost::future<boost::optional<R>>
put_if_absent(
const K &key,
const V &value) {
83 return to_object<R>(put_if_absent_data(to_data(key), to_data(value)));
93 template<
typename K,
typename V,
typename R=V>
94 boost::future<boost::optional<R>>
replace(
const K &key,
const V &value) {
95 return to_object<R>(replace_data(to_data(key), to_data(value)));
105 template<
typename K,
typename V,
typename N>
106 boost::future<bool>
replace(
const K &key,
const V &old_value,
const N &new_value) {
107 return replace_data(to_data(key), to_data(old_value), to_data(new_value));
117 template<
typename K,
typename V>
118 boost::future<boost::optional<V>>
remove(
const K &key) {
119 return to_object<V>(remove_data(to_data(key)));
131 return delete_entry_data(to_data(key));
141 template<
typename K,
typename V>
142 boost::future<bool>
remove(
const K &key,
const V &value) {
143 return remove_data(to_data(key), to_data(value));
154 return to_object_vector<K>(key_set_data());
163 template<
typename K,
typename P>
164 boost::future<std::vector<K>>
key_set(
const P &predicate) {
165 return to_object_vector<K>(key_set_data(to_data(predicate)));
176 return to_object_vector<V>(values_data());
184 template<
typename V,
typename P>
185 boost::future<std::vector<V>>
values(
const P &predicate) {
186 return to_object_vector<V>(values_data(to_data(predicate)));
190 transactional_map(
const std::string &name, txn::TransactionProxy &transaction_proxy)
191 : proxy::TransactionalMapImpl(name, transaction_proxy) {}
boost::future< std::vector< K > > key_set()
Transactional implementation of imap::keySet().
Definition: transactional_map.h:153
boost::future< void > delete_entry(const K &key)
Transactional implementation of imap::delete(key).
Definition: transactional_map.h:130
Provides a context to do transactional operations; so beginning/committing transactions, but also retrieving transactional data-structures like the TransactionalMap.
Definition: transaction_context.h:60
boost::future< bool > replace(const K &key, const V &old_value, const N &new_value)
Transactional implementation of imap::replace(key, value, oldValue).
Definition: transactional_map.h:106
Transactional implementation of imap.
Definition: transactional_map.h:27
boost::future< boost::optional< R > > replace(const K &key, const V &value)
Transactional implementation of imap::replace(key, value).
Definition: transactional_map.h:94
boost::future< boost::optional< R > > put_if_absent(const K &key, const V &value)
Transactional implementation of imap::putIfAbsent(key, value)
Definition: transactional_map.h:82
boost::future< bool > contains_key(const K &key)
Transactional implementation of imap::contains_key(Object).
Definition: transactional_map.h:36
boost::future< boost::optional< R > > put(const K &key, const V &value)
Transactional implementation of imap::put(Object, Object).
Definition: transactional_map.h:58
boost::future< std::vector< V > > values()
Transactional implementation of imap::values().
Definition: transactional_map.h:175
boost::future< std::vector< K > > key_set(const P &predicate)
Transactional implementation of imap::keySet(Predicate) .
Definition: transactional_map.h:164
boost::future< std::vector< V > > values(const P &predicate)
Transactional implementation of imap::values(Predicate) .
Definition: transactional_map.h:185