Hazelcast C++ Client
Hazelcast C++ Client Library
transactional_list.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/TransactionalListImpl.h"
19 
20 namespace hazelcast {
21  namespace client {
25  class transactional_list : public proxy::TransactionalListImpl {
26  friend class transaction_context;
27  public:
33  template<typename E>
34  boost::future<bool> add(const E &e) {
35  return proxy::TransactionalListImpl::add(to_data(e));
36  }
37 
43  template<typename E>
44  boost::future<bool> remove(const E &e) {
45  return proxy::TransactionalListImpl::remove(to_data(e));
46  }
47 
48  private:
49  transactional_list(const std::string &instance_name, txn::TransactionProxy &context)
50  : proxy::TransactionalListImpl(instance_name, context) {}
51  };
52  }
53 }
54 
Provides a context to do transactional operations; so beginning/committing transactions,...
Transactional implementation of ilist.
boost::future< bool > remove(const E &e)
Add item from transactional list.
boost::future< bool > add(const E &e)
Add new item to transactional list.