Couchbase C++ SDK
1.4.0 (rev. 59aa900)
Toggle main menu visibility
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
22
namespace
couchbase
23
{
24
class
behavior_options
25
{
26
public
:
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
39
auto
enable_clustermap_notification
(
bool
enable) ->
behavior_options
&
40
{
41
enable_clustermap_notification_ = enable;
42
return
*
this
;
43
}
44
45
auto
enable_mutation_tokens
(
bool
enable) ->
behavior_options
&
46
{
47
enable_mutation_tokens_ = enable;
48
return
*
this
;
49
}
50
51
auto
enable_unordered_execution
(
bool
enable) ->
behavior_options
&
52
{
53
enable_unordered_execution_ = enable;
54
return
*
this
;
55
}
56
57
auto
dump_configuration
(
bool
enable) ->
behavior_options
&
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
70
auto
preserve_bootstrap_nodes_order
(
bool
enable) ->
behavior_options
&
71
{
72
preserve_bootstrap_nodes_order_ = enable;
73
return
*
this
;
74
}
75
76
struct
built
{
77
std::string
user_agent_extra
;
78
bool
show_queries
;
79
bool
enable_clustermap_notification
;
80
bool
enable_mutation_tokens
;
81
bool
enable_unordered_execution
;
82
bool
dump_configuration
;
83
std::string
network
;
84
bool
preserve_bootstrap_nodes_order
;
85
};
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
101
private
:
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
couchbase::behavior_options
Definition
behavior_options.hxx:25
couchbase::behavior_options::dump_configuration
auto dump_configuration(bool enable) -> behavior_options &
Definition
behavior_options.hxx:57
couchbase::behavior_options::show_queries
auto show_queries(bool enable) -> behavior_options &
Definition
behavior_options.hxx:33
couchbase::behavior_options::enable_clustermap_notification
auto enable_clustermap_notification(bool enable) -> behavior_options &
Definition
behavior_options.hxx:39
couchbase::behavior_options::enable_mutation_tokens
auto enable_mutation_tokens(bool enable) -> behavior_options &
Definition
behavior_options.hxx:45
couchbase::behavior_options::preserve_bootstrap_nodes_order
auto preserve_bootstrap_nodes_order(bool enable) -> behavior_options &
Definition
behavior_options.hxx:70
couchbase::behavior_options::append_to_user_agent
auto append_to_user_agent(std::string extra) -> behavior_options &
Definition
behavior_options.hxx:27
couchbase::behavior_options::build
auto build() const -> built
Definition
behavior_options.hxx:87
couchbase::behavior_options::network
auto network(std::string name) -> behavior_options &
Definition
behavior_options.hxx:64
couchbase::behavior_options::enable_unordered_execution
auto enable_unordered_execution(bool enable) -> behavior_options &
Definition
behavior_options.hxx:51
couchbase
Represents a single item from the result of scan().
Definition
allow_querying_search_index_options.hxx:28
couchbase::behavior_options::built
Definition
behavior_options.hxx:76
couchbase::behavior_options::built::user_agent_extra
std::string user_agent_extra
Definition
behavior_options.hxx:77
couchbase::behavior_options::built::network
std::string network
Definition
behavior_options.hxx:83
couchbase::behavior_options::built::enable_clustermap_notification
bool enable_clustermap_notification
Definition
behavior_options.hxx:79
couchbase::behavior_options::built::enable_mutation_tokens
bool enable_mutation_tokens
Definition
behavior_options.hxx:80
couchbase::behavior_options::built::preserve_bootstrap_nodes_order
bool preserve_bootstrap_nodes_order
Definition
behavior_options.hxx:84
couchbase::behavior_options::built::dump_configuration
bool dump_configuration
Definition
behavior_options.hxx:82
couchbase::behavior_options::built::enable_unordered_execution
bool enable_unordered_execution
Definition
behavior_options.hxx:81
couchbase::behavior_options::built::show_queries
bool show_queries
Definition
behavior_options.hxx:78
couchbase
behavior_options.hxx
Generated by
1.17.0