18 #ifndef HAZELCAST_CLIENT_ADAPTOR_RAWPOINTERRawPointerTransactionalMap_H_
19 #define HAZELCAST_CLIENT_ADAPTOR_RAWPOINTERRawPointerTransactionalMap_H_
21 #include "hazelcast/client/TransactionalMap.h"
22 #include "hazelcast/client/impl/DataArrayImpl.h"
34 template<
typename K,
typename V>
38 m.context->getSerializationService()) {
47 return map.containsKey(key);
55 std::auto_ptr<V>
get(
const K &key) {
56 return serializationService.toObject<V>(map.getData(serializationService.toData<K>(&key)).get());
84 std::auto_ptr<V>
put(
const K &key,
const V &value) {
85 return serializationService.toObject<V>(map.putData(serializationService.toData<K>(&key),
86 serializationService.toData<V>(&value)).get());
96 void set(
const K &key,
const V &value) {
108 return serializationService.toObject<V>(map.putIfAbsentData(serializationService.toData<K>(&key),
109 serializationService.toData<V>(
120 std::auto_ptr<V>
replace(
const K &key,
const V &value) {
121 return serializationService.toObject<V>(map.replaceData(serializationService.toData<K>(&key),
122 serializationService.toData<V>(
133 bool replace(
const K &key,
const V &oldValue,
const V &newValue) {
134 return map.replace(key, oldValue, newValue);
144 std::auto_ptr<V>
remove(
const K &key) {
145 return serializationService.toObject<V>(map.removeData(serializationService.toData<K>(&key)).get());
157 map.deleteEntry(key);
167 bool remove(
const K &key,
const V &value) {
168 return map.remove(key, value);
178 return std::auto_ptr<DataArray<K> >(
new hazelcast::client::impl::DataArrayImpl<K>(map.keySetData(), serializationService));
188 return std::auto_ptr<DataArray<K> >(
new hazelcast::client::impl::DataArrayImpl<K>(map.keySetData(predicate), serializationService));
198 return std::auto_ptr<DataArray<V> >(
new hazelcast::client::impl::DataArrayImpl<V>(map.valuesData(), serializationService));
207 return std::auto_ptr<DataArray<V> >(
new hazelcast::client::impl::DataArrayImpl<V>(map.valuesData(predicate), serializationService));
212 serialization::pimpl::SerializationService &serializationService;
219 #endif //HAZELCAST_CLIENT_ADAPTOR_RAWPOINTERRawPointerTransactionalMap_H_
void set(const K &key, const V &value)
Transactional implementation of IMap::set(key, value).
Definition: RawPointerTransactionalMap.h:96
std::auto_ptr< DataArray< V > > values(const serialization::IdentifiedDataSerializable *predicate)
Transactional implementation of IMap::values(Predicate) .
Definition: RawPointerTransactionalMap.h:206
bool containsKey(const K &key)
Transactional implementation of IMap::containsKey(Object).
Definition: RawPointerTransactionalMap.h:46
std::auto_ptr< DataArray< K > > keySet(const serialization::IdentifiedDataSerializable *predicate)
Transactional implementation of IMap::keySet(Predicate) .
Definition: RawPointerTransactionalMap.h:187
Transactional implementation of IMap.
Definition: TransactionalMap.h:43
bool replace(const K &key, const V &oldValue, const V &newValue)
Transactional implementation of IMap::replace(key, value, oldValue).
Definition: RawPointerTransactionalMap.h:133
std::auto_ptr< V > put(const K &key, const V &value)
Transactional implementation of IMap::put(Object, Object).
Definition: RawPointerTransactionalMap.h:84
Classes that will be used with hazelcast data structures like IMap, IQueue etc should either inherit ...
Definition: IdentifiedDataSerializable.h:42
bool isEmpty()
Transactional implementation of IMap::isEmpty().
Definition: RawPointerTransactionalMap.h:73
std::auto_ptr< V > putIfAbsent(const K &key, const V &value)
Transactional implementation of IMap::putIfAbsent(key, value)
Definition: RawPointerTransactionalMap.h:107
Transactional implementation of IMap.
Definition: RawPointerTransactionalMap.h:35
void deleteEntry(const K &key)
Transactional implementation of IMap::delete(key).
Definition: RawPointerTransactionalMap.h:156
int size()
Transactional implementation of IMap::size().
Definition: RawPointerTransactionalMap.h:64
std::auto_ptr< DataArray< K > > keySet()
Transactional implementation of IMap::keySet().
Definition: RawPointerTransactionalMap.h:177
std::auto_ptr< DataArray< V > > values()
Transactional implementation of IMap::values().
Definition: RawPointerTransactionalMap.h:197
std::auto_ptr< V > replace(const K &key, const V &value)
Transactional implementation of IMap::replace(key, value).
Definition: RawPointerTransactionalMap.h:120