23 #ifndef HAZELCAST_TransactionalMap
24 #define HAZELCAST_TransactionalMap
26 #include "hazelcast/client/proxy/TransactionalMapImpl.h"
29 namespace serialization {
43 template<
typename K,
typename V>
54 return proxy::TransactionalMapImpl::containsKey(toData(&key));
62 boost::shared_ptr<V>
get(
const K& key) {
63 return toObject<V>(proxy::TransactionalMapImpl::get(toData(&key)));
72 return proxy::TransactionalMapImpl::size();
91 boost::shared_ptr<V>
put(
const K& key,
const V& value) {
92 return toObject<V>(proxy::TransactionalMapImpl::put(toData(&key), toData(&value)));
102 void set(
const K& key,
const V& value) {
103 proxy::TransactionalMapImpl::set(toData(&key), toData(&value));
114 return toObject<V>(proxy::TransactionalMapImpl::putIfAbsent(toData(&key), toData(&value)));
124 boost::shared_ptr<V>
replace(
const K& key,
const V& value) {
125 return toObject<V>(proxy::TransactionalMapImpl::replace(toData(&key), toData(&value)));
135 bool replace(
const K& key,
const V& oldValue,
const V& newValue) {
136 return proxy::TransactionalMapImpl::replace(toData(&key), toData(&oldValue), toData(&newValue));
146 boost::shared_ptr<V>
remove(
const K& key) {
147 return toObject<V>(proxy::TransactionalMapImpl::remove(toData(&key)));
159 proxy::TransactionalMapImpl::deleteEntry(toData(&key));
169 bool remove(
const K& key,
const V& value) {
170 return proxy::TransactionalMapImpl::remove(toData(&key), toData(&value));
180 return toObjectCollection<K>(proxy::TransactionalMapImpl::keySet());
190 return toObjectCollection<K>(proxy::TransactionalMapImpl::keySet(predicate));
200 return toObjectCollection<K>(proxy::TransactionalMapImpl::values());
209 return toObjectCollection<K>(proxy::TransactionalMapImpl::values(predicate));
213 TransactionalMap(
const std::string& name, txn::TransactionProxy *transactionProxy)
214 : proxy::TransactionalMapImpl(name, transactionProxy) {
223 #endif //HAZELCAST_TransactionalMap
bool isEmpty()
Transactional implementation of IMap::isEmpty().
Definition: TransactionalMap.h:80
void set(const K &key, const V &value)
Transactional implementation of IMap::set(key, value).
Definition: TransactionalMap.h:102
bool replace(const K &key, const V &oldValue, const V &newValue)
Transactional implementation of IMap::replace(key, value, oldValue).
Definition: TransactionalMap.h:135
Transactional implementation of IMap.
Definition: TransactionalMap.h:44
boost::shared_ptr< V > put(const K &key, const V &value)
Transactional implementation of IMap::put(Object, Object).
Definition: TransactionalMap.h:91
std::vector< V > values(const serialization::IdentifiedDataSerializable *predicate)
Transactional implementation of IMap::values(Predicate) .
Definition: TransactionalMap.h:208
bool containsKey(const K &key)
Transactional implementation of IMap::containsKey(Object).
Definition: TransactionalMap.h:53
Classes that will be used with hazelcast data structures like IMap, IQueue etc should either inherit ...
Definition: IdentifiedDataSerializable.h:42
std::vector< K > keySet(const serialization::IdentifiedDataSerializable *predicate)
Transactional implementation of IMap::keySet(Predicate) .
Definition: TransactionalMap.h:189
void deleteEntry(const K &key)
Transactional implementation of IMap::delete(key).
Definition: TransactionalMap.h:158
int size()
Transactional implementation of IMap::size().
Definition: TransactionalMap.h:71
boost::shared_ptr< V > replace(const K &key, const V &value)
Transactional implementation of IMap::replace(key, value).
Definition: TransactionalMap.h:124
boost::shared_ptr< V > putIfAbsent(const K &key, const V &value)
Transactional implementation of IMap::putIfAbsent(key, value)
Definition: TransactionalMap.h:113
std::vector< K > keySet()
Transactional implementation of IMap::keySet().
Definition: TransactionalMap.h:179
std::vector< V > values()
Transactional implementation of IMap::values().
Definition: TransactionalMap.h:199
Provides a context to do transactional operations; so beginning/committing transactions, but also retrieving transactional data-structures like the TransactionalMap.
Definition: TransactionContext.h:57