Couchbase C++ SDK 1.0.1 (rev. 58d46d7)
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
73 auto network(std::string name) -> behavior_options&
74 {
75 network_ = std::move(name);
76 return *this;
77 }
78
88
89 [[nodiscard]] auto build() const -> built
90 {
91 return {
92 user_agent_extra_,
93 show_queries_,
94 enable_clustermap_notification_,
95 enable_mutation_tokens_,
96 enable_unordered_execution_,
97 dump_configuration_,
98 network_,
99 };
100 }
101
102private:
103 std::string user_agent_extra_{};
104 bool show_queries_{ false };
105 bool enable_clustermap_notification_{ true };
106 bool enable_mutation_tokens_{ true };
107 bool enable_unordered_execution_{ true };
108 bool dump_configuration_{ false };
109 std::string network_{ "auto" };
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 append_to_user_agent(std::string extra) -> behavior_options &
Definition behavior_options.hxx:27
auto build() const -> built
Definition behavior_options.hxx:89
auto network(std::string name) -> behavior_options &
Selects network to use.
Definition behavior_options.hxx:73
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:79
std::string user_agent_extra
Definition behavior_options.hxx:80
std::string network
Definition behavior_options.hxx:86
bool enable_clustermap_notification
Definition behavior_options.hxx:82
bool enable_mutation_tokens
Definition behavior_options.hxx:83
bool dump_configuration
Definition behavior_options.hxx:85
bool enable_unordered_execution
Definition behavior_options.hxx:84
bool show_queries
Definition behavior_options.hxx:81