Couchbase C++ SDK
1.4.0 (rev. 59aa900)
Toggle main menu visibility
Loading...
Searching...
No Matches
transactions.hxx
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2
/*
3
* Copyright 2020-Present Couchbase, Inc.
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* 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 <
couchbase/transactions/async_attempt_context.hxx
>
21
#include <
couchbase/transactions/attempt_context.hxx
>
22
#include <
couchbase/transactions/transaction_options.hxx
>
23
#include <
couchbase/transactions/transaction_result.hxx
>
24
25
#include <functional>
26
27
#ifndef COUCHBASE_CXX_CLIENT_DOXYGEN
28
namespace
couchbase
29
{
30
namespace
transactions
31
{
32
class
transactions_impl;
33
}
// namespace transactions
34
35
namespace
core::transactions
36
{
37
class
transactions;
38
}
// namespace core::transactions
39
}
// namespace couchbase
40
#endif
41
42
namespace
couchbase::transactions
43
{
44
using
txn_logic
= std::function<
error
(std::shared_ptr<attempt_context>)>;
45
using
async_txn_logic
= std::function<
error
(std::shared_ptr<async_attempt_context>)>;
46
using
async_txn_complete_logic
= std::function<void(
error
,
transaction_result
)>;
47
51
class
transactions
52
{
53
public
:
70
auto
run
(
txn_logic
&& logic,
const
transaction_options
& cfg = {})
71
-> std::pair<error, transaction_result>;
72
92
void
run
(
async_txn_logic
&& logic,
93
async_txn_complete_logic
&& complete_callback,
94
const
transaction_options
& cfg = {});
95
99
explicit
transactions
(std::shared_ptr<core::transactions::transactions> core_txns);
100
101
private
:
102
std::shared_ptr<transactions_impl> impl_;
103
};
104
}
// namespace couchbase::transactions
async_attempt_context.hxx
attempt_context.hxx
couchbase::error
Definition
error.hxx:31
couchbase::transactions::transaction_options
The transaction_options can be passed in to override some elements of the global transactions_config.
Definition
transaction_options.hxx:37
couchbase::transactions::transactions::run
auto run(txn_logic &&logic, const transaction_options &cfg={}) -> std::pair< error, transaction_result >
Run a blocking transaction.
couchbase::transactions::transactions::run
void run(async_txn_logic &&logic, async_txn_complete_logic &&complete_callback, const transaction_options &cfg={})
Run an asynchronous transaction.
couchbase::transactions::transactions::transactions
transactions(std::shared_ptr< core::transactions::transactions > core_txns)
couchbase::core::transactions
Definition
transaction_get_multi_options.hxx:23
couchbase::transactions
Definition
transactions.hxx:43
couchbase::transactions::async_txn_logic
std::function< error(std::shared_ptr< async_attempt_context >)> async_txn_logic
Definition
transactions.hxx:45
couchbase::transactions::txn_logic
std::function< error(std::shared_ptr< attempt_context >)> txn_logic
Definition
transactions.hxx:44
couchbase::transactions::async_txn_complete_logic
std::function< void(error, transaction_result)> async_txn_complete_logic
Definition
transactions.hxx:46
couchbase
Represents a single item from the result of scan().
Definition
allow_querying_search_index_options.hxx:28
couchbase::ping_state::error
@ error
Indicates that the ping operation failed.
Definition
endpoint_ping_report.hxx:52
couchbase::transactions::transaction_result
Results of a transaction.
Definition
transaction_result.hxx:29
transaction_options.hxx
transaction_result.hxx
couchbase
transactions.hxx
Generated by
1.17.0