MongoDB C++ Driver 4.1.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
25
26namespace mongocxx {
27namespace v_noabi {
28namespace options {
29
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 bsoncxx::v_noabi::types::bson_value::view_or_value> const&)
62 max() const;
63
66
68 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<std::int64_t> const&)
69 sparsity() const;
70
73
75 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<std::int32_t> const&)
76 trim_factor() const;
77
81
84 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<std::int32_t> const&)
85 precision() const;
86
87 private:
88 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::types::bson_value::view_or_value> _min;
89 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::types::bson_value::view_or_value> _max;
90 bsoncxx::v_noabi::stdx::optional<std::int64_t> _sparsity;
91 bsoncxx::v_noabi::stdx::optional<std::int32_t> _trim_factor;
92 bsoncxx::v_noabi::stdx::optional<std::int32_t> _precision;
93};
94
95} // namespace options
96} // namespace v_noabi
97} // namespace mongocxx
98
99#include <mongocxx/config/postlude.hpp>
100
A polyfill for std::optional<T>.
Definition optional.hpp:800
Used by mongocxx::v_noabi::options::encrypt::range_opts.
Definition range.hpp:42
range & sparsity(std::int64_t value)
Sets RangeOpts.sparsity.
range & min(bsoncxx::v_noabi::types::bson_value::view_or_value value)
Sets RangeOpts.min.
range & trim_factor(std::int32_t value)
Sets RangeOpts.trimFactor.
range & max(bsoncxx::v_noabi::types::bson_value::view_or_value value)
Sets RangeOpts.max.
range & precision(std::int32_t value)
Sets RangeOpts.precision.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
The mongocxx v_noabi macro guard prelude header.
bsoncxx::v_noabi::view_or_value< view, value > view_or_value
Equivalent to v_noabi::view_or_value<view, value>.
Definition view_or_value.hpp:31
The top-level namespace within which all bsoncxx library entities are declared.
Declares entities representing options to use with various commands.
Declares entities whose ABI stability is NOT guaranteed.
The top-level namespace within which all mongocxx library entities are declared.
Declares mongocxx::v_noabi::options::range.
Provides bsoncxx::v_noabi::types::bson_value::view_or_value.
Provides entities used to represent BSON types.