MongoDB C++ Driver mongocxx-3.11.0
Loading...
Searching...
No Matches
range.hpp
Go to the documentation of this file.
1// Copyright 2009-present MongoDB, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
17#include <cstdint>
18
20
21#include <bsoncxx/types.hpp>
23
24#include <mongocxx/stdx.hpp>
25
27
28namespace mongocxx {
29namespace v_noabi {
30namespace options {
31
42class range {
43 public:
47
52 min() const;
53
56 MONGOCXX_ABI_EXPORT_CDECL(range&) max(bsoncxx::v_noabi::types::bson_value::view_or_value value);
57
61 const stdx::optional<bsoncxx::v_noabi::types::bson_value::view_or_value>&)
62 max() const;
63
66
68 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<std::int64_t>&) sparsity() const;
69
72
74 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<std::int32_t>&) trim_factor() const;
75
79
82 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<std::int32_t>&) precision() const;
83
84 private:
85 stdx::optional<bsoncxx::v_noabi::types::bson_value::view_or_value> _min;
86 stdx::optional<bsoncxx::v_noabi::types::bson_value::view_or_value> _max;
87 stdx::optional<std::int64_t> _sparsity;
88 stdx::optional<std::int32_t> _trim_factor;
89 stdx::optional<std::int32_t> _precision;
90};
91
92} // namespace options
93} // namespace v_noabi
94} // namespace mongocxx
95
96// CXX-2770: missing include of postlude header.
97#if defined(MONGOCXX_TEST_MACRO_GUARDS_FIX_MISSING_POSTLUDE)
99#endif
100
A polyfill for std::optional<T>.
Definition optional.hpp:874
RangeOpts specifies index options for a Queryable Encryption field supporting "range" queries.
Definition range.hpp:42
const stdx::optional< bsoncxx::v_noabi::types::bson_value::view_or_value > & min() const
Gets RangeOpts.min.
const stdx::optional< std::int32_t > & precision() const
Gets RangeOpts.precision.
range & min(bsoncxx::v_noabi::types::bson_value::view_or_value value)
Sets RangeOpts.min.
const stdx::optional< bsoncxx::v_noabi::types::bson_value::view_or_value > & max() const
Gets RangeOpts.max.
const stdx::optional< std::int64_t > & sparsity() const
Gets RangeOpts.sparsity.
const stdx::optional< std::int32_t > & trim_factor() const
Gets RangeOpts.trimFactor.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition fwd.hpp:222
The mongocxx macro guard postlude header.
The mongocxx macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
The top-level namespace within which all mongocxx library entities are declared.
The top-level namespace reserved for the C++ standard library.
Declares mongocxx::v_noabi::options::range.
Redeclares bsoncxx::v_noabi::stdx in mongocxx::v_noabi::stdx for internal use.
Provides bsoncxx::v_noabi::types::bson_value::view_or_value.
Provides entities used to represent BSON types.