Couchbase C++ SDK 1.2.0 (rev. c2439a4)
Loading...
Searching...
No Matches
behavior_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 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 <string>
21
22namespace couchbase
23{
25{
26public:
27 auto append_to_user_agent(std::string extra) -> behavior_options&
28 {
29 user_agent_extra_ = std::move(extra);
30 return *this;
31 }
32
33 auto show_queries(bool enable) -> behavior_options&
34 {
35 show_queries_ = enable;
36 return *this;
37 }
38
40 {
41 enable_clustermap_notification_ = enable;
42 return *this;
43 }
44
46 {
47 enable_mutation_tokens_ = enable;
48 return *this;
49 }
50
52 {
53 enable_unordered_execution_ = enable;
54 return *this;
55 }
56
58 {
59 dump_configuration_ = enable;
60 return *this;
61 }
62
63 [[deprecated("Use couchbase::network_options#preferred_network() instead.")]]
64 auto network(std::string name) -> behavior_options&
65 {
66 network_ = std::move(name);
67 return *this;
68 }
69
71 {
72 preserve_bootstrap_nodes_order_ = enable;
73 return *this;
74 }
75
86
87 [[nodiscard]] auto build() const -> built
88 {
89 return {
90 user_agent_extra_,
91 show_queries_,
92 enable_clustermap_notification_,
93 enable_mutation_tokens_,
94 enable_unordered_execution_,
95 dump_configuration_,
96 network_,
97 preserve_bootstrap_nodes_order_,
98 };
99 }
100
101private:
102 std::string user_agent_extra_{};
103 bool show_queries_{ false };
104 bool enable_clustermap_notification_{ true };
105 bool enable_mutation_tokens_{ true };
106 bool enable_unordered_execution_{ true };
107 bool dump_configuration_{ false };
108 std::string network_{ "auto" };
109 bool preserve_bootstrap_nodes_order_{ false };
110};
111} // namespace couchbase
Definition behavior_options.hxx:25
auto dump_configuration(bool enable) -> behavior_options &
Definition behavior_options.hxx:57
auto show_queries(bool enable) -> behavior_options &
Definition behavior_options.hxx:33
auto enable_clustermap_notification(bool enable) -> behavior_options &
Definition behavior_options.hxx:39
auto enable_mutation_tokens(bool enable) -> behavior_options &
Definition behavior_options.hxx:45
auto preserve_bootstrap_nodes_order(bool enable) -> behavior_options &
Definition behavior_options.hxx:70
auto append_to_user_agent(std::string extra) -> behavior_options &
Definition behavior_options.hxx:27
auto build() const -> built
Definition behavior_options.hxx:87
auto network(std::string name) -> behavior_options &
Definition behavior_options.hxx:64
auto enable_unordered_execution(bool enable) -> behavior_options &
Definition behavior_options.hxx:51
Represents a single item from the result of scan()
Definition allow_querying_search_index_options.hxx:28
Definition behavior_options.hxx:76
std::string user_agent_extra
Definition behavior_options.hxx:77
std::string network
Definition behavior_options.hxx:83
bool enable_clustermap_notification
Definition behavior_options.hxx:79
bool enable_mutation_tokens
Definition behavior_options.hxx:80
bool preserve_bootstrap_nodes_order
Definition behavior_options.hxx:84
bool dump_configuration
Definition behavior_options.hxx:82
bool enable_unordered_execution
Definition behavior_options.hxx:81
bool show_queries
Definition behavior_options.hxx:78