Hazelcast C++ Client
 All Classes Functions Variables Enumerations Pages
TransactionalMultiMap.h
1 /*
2  * Copyright (c) 2008-2015, 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 //
17 // Created by sancar koyunlu on 8/6/13.
18 
19 
20 #ifndef HAZELCAST_TransactionalMultiMap
21 #define HAZELCAST_TransactionalMultiMap
22 
23 #include "hazelcast/client/proxy/TransactionalMultiMapImpl.h"
24 
25 namespace hazelcast {
26  namespace client {
27 
36  template<typename K, typename V>
37  class TransactionalMultiMap : public proxy::TransactionalMultiMapImpl {
38  friend class TransactionContext;
39 
40  public:
46  bool put(const K& key, const V& value) {
47  return proxy::TransactionalMultiMapImpl::put(toData(&key), toData(&value));
48  };
49 
55  std::vector<V> get(const K& key) {
56  return toObjectCollection<V>(proxy::TransactionalMultiMapImpl::get(toData(&key)));
57  };
58 
64  bool remove(const K& key, const V& value) {
65  return proxy::TransactionalMultiMapImpl::remove(toData(&key), toData(&value));
66  };
67 
73  std::vector<V> remove(const K& key) {
74  return toObjectCollection<V>(proxy::TransactionalMultiMapImpl::remove(toData(&key)));
75  };
76 
77 
83  int valueCount(const K& key) {
84  return proxy::TransactionalMultiMapImpl::valueCount(toData(&key));
85  }
86 
92  int size() {
93  return proxy::TransactionalMultiMapImpl::size();
94  }
95 
96  private :
97  TransactionalMultiMap(const std::string& name, txn::TransactionProxy *transactionProxy)
98  : proxy::TransactionalMultiMapImpl(name, transactionProxy) {
99 
100  }
101  };
102  }
103 }
104 
105 
106 #endif //HAZELCAST_TransactionalMultiMap
107 
Transactional implementation of MultiMap.
Definition: TransactionalMultiMap.h:37
int size()
Transactional implementation of Multimap::size().
Definition: TransactionalMultiMap.h:92
bool put(const K &key, const V &value)
Transactional implementation of Multimap::put(key , value).
Definition: TransactionalMultiMap.h:46
int valueCount(const K &key)
Transactional implementation of Multimap::valueCount(key).
Definition: TransactionalMultiMap.h:83
Provides a context to do transactional operations; so beginning/committing transactions, but also retrieving transactional data-structures like the TransactionalMap.
Definition: TransactionContext.h:57