Couchbase C++ SDK
1.4.0 (rev. 59aa900)
Toggle main menu visibility
Loading...
Searching...
No Matches
wait_until_ready_options.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 2026-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/cluster_state.hxx
>
21
#include <
couchbase/error.hxx
>
22
#include <
couchbase/service_type.hxx
>
23
24
#include <functional>
25
#include <set>
26
#include <utility>
27
28
namespace
couchbase
29
{
36
struct
wait_until_ready_options
{
49
auto
desired_state
(
cluster_state
desired_state
) ->
wait_until_ready_options
&
50
{
51
desired_state_ =
desired_state
;
52
return
*
this
;
53
}
54
65
auto
service_types
(std::set<service_type>
service_types
) ->
wait_until_ready_options
&
66
{
67
service_types_ = std::move(
service_types
);
68
return
*
this
;
69
}
70
77
struct
built
{
78
cluster_state
desired_state
;
79
std::set<service_type>
service_types
;
80
};
81
93
[[nodiscard]]
auto
build
() const ->
built
94
{
95
return
{ desired_state_, service_types_ };
96
}
97
98
private
:
99
cluster_state
desired_state_{
cluster_state::online
};
100
std::set<service_type> service_types_{};
101
};
102
110
using
wait_until_ready_handler
= std::function<void(
error
)>;
111
}
// namespace couchbase
couchbase::error
Definition
error.hxx:31
cluster_state.hxx
error.hxx
couchbase
Represents a single item from the result of scan().
Definition
allow_querying_search_index_options.hxx:28
couchbase::cluster_state
cluster_state
Describes the readiness of the cluster (or a bucket) from the SDK's point of view.
Definition
cluster_state.hxx:29
couchbase::cluster_state::online
@ online
Every reachable endpoint of every requested service is responsive.
Definition
cluster_state.hxx:31
couchbase::wait_until_ready_handler
std::function< void(error)> wait_until_ready_handler
The signature for the handler of the cluster::wait_until_ready() and bucket::wait_until_ready() opera...
Definition
wait_until_ready_options.hxx:110
service_type.hxx
couchbase::wait_until_ready_options::built
Immutable value object representing consistent options.
Definition
wait_until_ready_options.hxx:77
couchbase::wait_until_ready_options::built::desired_state
cluster_state desired_state
Definition
wait_until_ready_options.hxx:78
couchbase::wait_until_ready_options::built::service_types
std::set< service_type > service_types
Definition
wait_until_ready_options.hxx:79
couchbase::wait_until_ready_options
Options for wait_until_ready() and wait_until_ready().
Definition
wait_until_ready_options.hxx:36
couchbase::wait_until_ready_options::build
auto build() const -> built
Validates the options and returns them as an immutable value.
Definition
wait_until_ready_options.hxx:93
couchbase::wait_until_ready_options::desired_state
auto desired_state(cluster_state desired_state) -> wait_until_ready_options &
Sets the state the cluster (or bucket) has to reach before the wait completes.
Definition
wait_until_ready_options.hxx:49
couchbase::wait_until_ready_options::service_types
auto service_types(std::set< service_type > service_types) -> wait_until_ready_options &
Customizes the set of services to consider.
Definition
wait_until_ready_options.hxx:65
couchbase
wait_until_ready_options.hxx
Generated by
1.17.0