Couchbase C++ SDK 1.0.4 (rev. 5355b0f)
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
79
80 [[nodiscard]] auto build() const -> built
81 {
82 return {
83 user_agent_extra_,
84 show_queries_,
85 enable_clustermap_notification_,
86 enable_mutation_tokens_,
87 enable_unordered_execution_,
88 dump_configuration_,
89 network_,
90 };
91 }
92
93private:
94 std::string user_agent_extra_{};
95 bool show_queries_{ false };
96 bool enable_clustermap_notification_{ true };
97 bool enable_mutation_tokens_{ true };
98 bool enable_unordered_execution_{ true };
99 bool dump_configuration_{ false };
100 std::string network_{ "auto" };
101};
102} // 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 append_to_user_agent(std::string extra) -> behavior_options &
Definition behavior_options.hxx:27
auto build() const -> built
Definition behavior_options.hxx:80
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 collection::scan()
Definition allow_querying_search_index_options.hxx:28
Definition behavior_options.hxx:70
std::string user_agent_extra
Definition behavior_options.hxx:71
std::string network
Definition behavior_options.hxx:77
bool enable_clustermap_notification
Definition behavior_options.hxx:73
bool enable_mutation_tokens
Definition behavior_options.hxx:74
bool dump_configuration
Definition behavior_options.hxx:76
bool enable_unordered_execution
Definition behavior_options.hxx:75
bool show_queries
Definition behavior_options.hxx:72