MongoDB C++ Driver
4.1.0
Toggle main menu visibility
Main Page
Files
File List
File Members
All
Macros
Namespaces
Namespace List
Namespace Members
All
b
c
e
f
k
l
m
o
r
s
t
v
w
Functions
c
e
f
k
m
o
s
t
v
Variables
Typedefs
Enumerations
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
~
Variables
Typedefs
b
c
d
e
f
i
k
n
p
r
v
w
Enumerations
Related Symbols
o
Topics
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
bsoncxx
v_noabi
bsoncxx
decimal128.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
#include <string>
19
20
#include <
bsoncxx/decimal128-fwd.hpp
>
21
22
#include <
bsoncxx/stdx/string_view.hpp
>
23
24
#include <
bsoncxx/config/prelude.hpp
>
25
26
namespace
bsoncxx
{
27
namespace
v_noabi
{
28
40
class
decimal128
{
41
public
:
45
decimal128
() =
default
;
46
55
decimal128
(uint64_t
high
, uint64_t
low
) noexcept : _high(
high
), _low(
low
) {}
56
66
explicit
BSONCXX_ABI_EXPORT_CDECL
()
decimal128
(
stdx
::string_view str);
67
73
BSONCXX_ABI_EXPORT_CDECL
(std::
string
)
to_string
() const;
74
81
friend
BSONCXX_ABI_EXPORT_CDECL
(
bool
) operator==(
decimal128
const& lhs,
decimal128
const& rhs);
82
friend
BSONCXX_ABI_EXPORT_CDECL
(
bool
) operator!=(
decimal128
const& lhs,
decimal128
const& rhs);
85
89
uint64_t
high
()
const
{
90
return
_high;
91
}
89
uint64_t
high
()
const
{
…
}
92
96
uint64_t
low
()
const
{
97
return
_low;
98
}
96
uint64_t
low
()
const
{
…
}
99
100
private
:
101
uint64_t _high = 0;
102
uint64_t _low = 0;
103
};
40
class
decimal128
{
…
};
104
105
}
// namespace v_noabi
106
}
// namespace bsoncxx
107
108
#include <
bsoncxx/config/postlude.hpp
>
109
BSONCXX_ABI_EXPORT_CDECL
#define BSONCXX_ABI_EXPORT_CDECL(...)
Equivalent to BSONCXX_ABI_EXPORT with BSONCXX_ABI_CDECL.
Definition
export.hpp:52
postlude.hpp
The bsoncxx v_noabi macro guard postlude header.
prelude.hpp
The bsoncxx v_noabi macro guard prelude header.
bsoncxx::decimal128::decimal128
decimal128()=default
Constructs a BSON Decimal128 value representing zero.
bsoncxx::v_noabi::decimal128::decimal128
decimal128(uint64_t high, uint64_t low) noexcept
Constructs a BSON Decimal128 from high and low 64-bit big-endian parts.
Definition
decimal128.hpp:55
bsoncxx::v_noabi::decimal128::high
uint64_t high() const
Accessor for high 64 bits.
Definition
decimal128.hpp:89
bsoncxx::v_noabi::decimal128::decimal128
decimal128()=default
Constructs a BSON Decimal128 value representing zero.
bsoncxx::v_noabi::decimal128::to_string
std::string to_string() const
Converts this decimal128 value to a string representation.
bsoncxx::v_noabi::decimal128::low
uint64_t low() const
Accessor for low 64 bits.
Definition
decimal128.hpp:96
decimal128-fwd.hpp
Declares bsoncxx::v_noabi::decimal128.
bsoncxx::v_noabi::stdx
Declares C++17 standard library polyfills.
bsoncxx::v_noabi
Declares entities whose ABI stability is NOT guaranteed.
bsoncxx
The top-level namespace within which all bsoncxx library entities are declared.
string_view.hpp
Provides std::string_view-related polyfills for library API usage.
Generated by
1.13.2