Hazelcast C++ Client
Hazelcast C++ Client Library
transactional_multi_map.h
1 /*
2  * Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include "hazelcast/client/proxy/TransactionalMultiMapImpl.h"
19 
20 namespace hazelcast {
21  namespace client {
28  class HAZELCAST_API transactional_multi_map : public proxy::TransactionalMultiMapImpl {
29  friend class transaction_context;
30 
31  public:
37  template<typename K, typename V>
38  boost::future<bool> put(const K &key, const V &value) {
39  return proxy::TransactionalMultiMapImpl::put_data(to_data(key), to_data(value));
40  }
41 
47  template<typename K, typename V>
48  boost::future<std::vector<V>> get(const K &key) {
49  return to_object_vector<V>(proxy::TransactionalMultiMapImpl::get_data(to_data(key)));
50  }
51 
57  template<typename K, typename V>
58  boost::future<bool> remove(const K &key, const V &value) {
59  return proxy::TransactionalMultiMapImpl::remove(to_data(key), to_data(value));
60  }
61 
67  template<typename K, typename V>
68  boost::future<std::vector<V>> remove(const K &key) {
69  return to_object_vector<V>(proxy::TransactionalMultiMapImpl::remove_data(to_data(key)));
70  }
71 
77  template<typename K>
78  boost::future<int> value_count(const K &key) {
79  return proxy::TransactionalMultiMapImpl::value_count(to_data(key));
80  }
81 
82  private :
83  transactional_multi_map(const std::string &name, txn::TransactionProxy &transaction_proxy)
84  : proxy::TransactionalMultiMapImpl(name, transaction_proxy) {}
85  };
86  }
87 }
88 
Provides a context to do transactional operations; so beginning/committing transactions,...
Transactional implementation of MultiMap.
boost::future< std::vector< V > > get(const K &key)
Transactional implementation of multi_map::get(key).
boost::future< bool > put(const K &key, const V &value)
Transactional implementation of multi_map::put(key , value).
boost::future< bool > remove(const K &key, const V &value)
Transactional implementation of multi_map::remove(key , value).
boost::future< int > value_count(const K &key)
Transactional implementation of multi_map::value_count(key).
boost::future< std::vector< V > > remove(const K &key)
Transactional implementation of multi_map::remove(key).