18 #ifndef HAZELCAST_TransactionalMap 19 #define HAZELCAST_TransactionalMap 21 #include "hazelcast/client/proxy/TransactionalMapImpl.h" 25 namespace serialization {
32 template <
typename K,
typename V>
33 class RawPointerTransactionalMap;
43 template<
typename K,
typename V>
55 return proxy::TransactionalMapImpl::containsKey(toData(&key));
63 boost::shared_ptr<V>
get(
const K& key) {
64 return boost::shared_ptr<V>(toObject<V>(proxy::TransactionalMapImpl::getData(toData(&key))));
73 return proxy::TransactionalMapImpl::size();
82 return proxy::TransactionalMapImpl::isEmpty();
92 boost::shared_ptr<V>
put(
const K& key,
const V& value) {
93 return boost::shared_ptr<V>(toObject<V>(proxy::TransactionalMapImpl::putData(toData(&key), toData(&value))));
103 void set(
const K& key,
const V& value) {
104 proxy::TransactionalMapImpl::set(toData(&key), toData(&value));
115 return boost::shared_ptr<V>(toObject<V>(proxy::TransactionalMapImpl::putIfAbsentData(toData(&key), toData(&value))));
125 boost::shared_ptr<V>
replace(
const K& key,
const V& value) {
126 return boost::shared_ptr<V>(toObject<V>(proxy::TransactionalMapImpl::replaceData(toData(&key), toData(&value))));
136 bool replace(
const K& key,
const V& oldValue,
const V& newValue) {
137 return proxy::TransactionalMapImpl::replace(toData(&key), toData(&oldValue), toData(&newValue));
147 boost::shared_ptr<V>
remove(
const K& key) {
148 return boost::shared_ptr<V>(toObject<V>(proxy::TransactionalMapImpl::removeData(toData(&key))));
160 proxy::TransactionalMapImpl::deleteEntry(toData(&key));
170 bool remove(
const K& key,
const V& value) {
171 return proxy::TransactionalMapImpl::remove(toData(&key), toData(&value));
181 return toObjectCollection<K>(proxy::TransactionalMapImpl::keySetData());
191 return toObjectCollection<K>(proxy::TransactionalMapImpl::keySetData(predicate));
201 return toObjectCollection<K>(proxy::TransactionalMapImpl::valuesData());
210 return toObjectCollection<K>(proxy::TransactionalMapImpl::valuesData(predicate));
214 TransactionalMap(
const std::string& name, txn::TransactionProxy *transactionProxy)
215 : proxy::TransactionalMapImpl(name, transactionProxy) {
223 #endif //HAZELCAST_TransactionalMap bool isEmpty()
Transactional implementation of IMap::isEmpty().
Definition: TransactionalMap.h:81
bool replace(const K &key, const V &oldValue, const V &newValue)
Transactional implementation of IMap::replace(key, value, oldValue).
Definition: TransactionalMap.h:136
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:92
std::vector< V > values(const serialization::IdentifiedDataSerializable *predicate)
Transactional implementation of IMap::values(Predicate) .
Definition: TransactionalMap.h:209
bool containsKey(const K &key)
Transactional implementation of IMap::containsKey(Object).
Definition: TransactionalMap.h:54
Classes that will be used with hazelcast data structures like IMap, IQueue etc should either inherit ...
Definition: IdentifiedDataSerializable.h:47
std::vector< K > keySet(const serialization::IdentifiedDataSerializable *predicate)
Transactional implementation of IMap::keySet(Predicate) .
Definition: TransactionalMap.h:190
void deleteEntry(const K &key)
Transactional implementation of IMap::delete(key).
Definition: TransactionalMap.h:159
int size()
Transactional implementation of IMap::size().
Definition: TransactionalMap.h:72
boost::shared_ptr< V > replace(const K &key, const V &value)
Transactional implementation of IMap::replace(key, value).
Definition: TransactionalMap.h:125
boost::shared_ptr< V > putIfAbsent(const K &key, const V &value)
Transactional implementation of IMap::putIfAbsent(key, value)
Definition: TransactionalMap.h:114
std::vector< K > keySet()
Transactional implementation of IMap::keySet().
Definition: TransactionalMap.h:180
std::vector< V > values()
Transactional implementation of IMap::values().
Definition: TransactionalMap.h:200
Transactional implementation of IMap.
Definition: RawPointerTransactionalMap.h:35
PN (Positive-Negative) CRDT counter.
Definition: MapEntryView.h:32
Provides a context to do transactional operations; so beginning/committing transactions, but also retrieving transactional data-structures like the TransactionalMap.
Definition: TransactionContext.h:54