Apache Ignite C++ Client
Loading...
Searching...
No Matches
transactions.h
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#pragma once
19
20#include "ignite/client/transaction/transaction.h"
21#include "ignite/client/transaction/transaction_options.h"
22
23#include "ignite/common/detail/config.h"
24#include "ignite/common/ignite_result.h"
25
26#include <memory>
27
28namespace ignite {
29
30namespace detail {
31class transactions_impl;
32}
33
37class transactions {
38 friend class ignite_client;
39
40public:
41 // Delete
42 transactions() = delete;
43
51 return sync<transaction>([this, &tx_opts](auto callback) { begin_async(tx_opts, std::move(callback)); });
52 }
53
59 IGNITE_API transaction begin() {
60 return begin({});
61 }
62
69 IGNITE_API void begin_async(transaction_options tx_opts, ignite_callback<transaction> callback);
70
76 IGNITE_API void begin_async(ignite_callback<transaction> callback);
77
78private:
84 explicit transactions(std::shared_ptr<detail::transactions_impl> impl)
85 : m_impl(std::move(impl)) {}
86
88 std::shared_ptr<detail::transactions_impl> m_impl;
89};
90
91} // namespace ignite
Definition transaction_options.h:24
Definition transaction.h:35
Definition transactions.h:37
IGNITE_API transaction begin()
Definition transactions.h:59
IGNITE_API void begin_async(transaction_options tx_opts, ignite_callback< transaction > callback)
Definition transactions.cpp:23
IGNITE_API transaction begin(transaction_options tx_opts)
Definition transactions.h:50