A Discrete-Event Network Simulator
API
nlohmann::detail::binary_writer< BasicJsonType, CharType > Class Template Reference

serialization to CBOR and MessagePack values More...

#include "json.h"

+ Collaboration diagram for nlohmann::detail::binary_writer< BasicJsonType, CharType >:

Public Member Functions

 binary_writer (output_adapter_t< CharType > adapter)
 create a binary writer More...
 
 binary_writer (output_adapter_t< CharType > adapter)
 create a binary writer More...
 
void write_bson (const BasicJsonType &j)
 
void write_bson (const BasicJsonType &j)
 
void write_cbor (const BasicJsonType &j)
 
void write_cbor (const BasicJsonType &j)
 
void write_msgpack (const BasicJsonType &j)
 
void write_msgpack (const BasicJsonType &j)
 
void write_ubjson (const BasicJsonType &j, const bool use_count, const bool use_type, const bool add_prefix=true)
 
void write_ubjson (const BasicJsonType &j, const bool use_count, const bool use_type, const bool add_prefix=true)
 

Static Public Member Functions

template<typename InputCharType , typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_signed< char >::value &&std::is_same< char, typename std::remove_cv< InputCharType >::type >::value > * = nullptr>
static constexpr CharType to_char_type (InputCharType x) noexcept
 
template<typename InputCharType , typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_signed< char >::value &&std::is_same< char, typename std::remove_cv< InputCharType >::type >::value > * = nullptr>
static constexpr CharType to_char_type (InputCharType x) noexcept
 
template<typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_signed< char >::value > * = nullptr>
static constexpr CharType to_char_type (std::uint8_t x) noexcept
 
template<typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_unsigned< char >::value > * = nullptr>
static CharType to_char_type (std::uint8_t x) noexcept
 
template<typename C = CharType, enable_if_t< std::is_unsigned< C >::value > * = nullptr>
static constexpr CharType to_char_type (std::uint8_t x) noexcept
 
template<typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_signed< char >::value > * = nullptr>
static constexpr CharType to_char_type (std::uint8_t x) noexcept
 
template<typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_unsigned< char >::value > * = nullptr>
static CharType to_char_type (std::uint8_t x) noexcept
 
template<typename C = CharType, enable_if_t< std::is_unsigned< C >::value > * = nullptr>
static constexpr CharType to_char_type (std::uint8_t x) noexcept
 

Private Types

using binary_t = typename BasicJsonType::binary_t
 
using binary_t = typename BasicJsonType::binary_t
 
using number_float_t = typename BasicJsonType::number_float_t
 
using number_float_t = typename BasicJsonType::number_float_t
 
using string_t = typename BasicJsonType::string_t
 
using string_t = typename BasicJsonType::string_t
 

Private Member Functions

CharType ubjson_prefix (const BasicJsonType &j) const noexcept
 determine the type prefix of container values More...
 
CharType ubjson_prefix (const BasicJsonType &j) const noexcept
 determine the type prefix of container values More...
 
void write_bson_array (const string_t &name, const typename BasicJsonType::array_t &value)
 Writes a BSON element with key name and array value. More...
 
void write_bson_array (const string_t &name, const typename BasicJsonType::array_t &value)
 Writes a BSON element with key name and array value. More...
 
void write_bson_binary (const string_t &name, const binary_t &value)
 Writes a BSON element with key name and binary value value. More...
 
void write_bson_binary (const string_t &name, const binary_t &value)
 Writes a BSON element with key name and binary value value. More...
 
void write_bson_boolean (const string_t &name, const bool value)
 Writes a BSON element with key name and boolean value value. More...
 
void write_bson_boolean (const string_t &name, const bool value)
 Writes a BSON element with key name and boolean value value. More...
 
void write_bson_double (const string_t &name, const double value)
 Writes a BSON element with key name and double value value. More...
 
void write_bson_double (const string_t &name, const double value)
 Writes a BSON element with key name and double value value. More...
 
void write_bson_element (const string_t &name, const BasicJsonType &j)
 Serializes the JSON value j to BSON and associates it with the key name. More...
 
void write_bson_element (const string_t &name, const BasicJsonType &j)
 Serializes the JSON value j to BSON and associates it with the key name. More...
 
void write_bson_entry_header (const string_t &name, const std::uint8_t element_type)
 Writes the given element_type and name to the output adapter. More...
 
void write_bson_entry_header (const string_t &name, const std::uint8_t element_type)
 Writes the given element_type and name to the output adapter. More...
 
void write_bson_integer (const string_t &name, const std::int64_t value)
 Writes a BSON element with key name and integer value. More...
 
void write_bson_integer (const string_t &name, const std::int64_t value)
 Writes a BSON element with key name and integer value. More...
 
void write_bson_null (const string_t &name)
 Writes a BSON element with key name and null value. More...
 
void write_bson_null (const string_t &name)
 Writes a BSON element with key name and null value. More...
 
void write_bson_object (const typename BasicJsonType::object_t &value)
 
void write_bson_object (const typename BasicJsonType::object_t &value)
 
void write_bson_object_entry (const string_t &name, const typename BasicJsonType::object_t &value)
 Writes a BSON element with key name and object value. More...
 
void write_bson_object_entry (const string_t &name, const typename BasicJsonType::object_t &value)
 Writes a BSON element with key name and object value. More...
 
void write_bson_string (const string_t &name, const string_t &value)
 Writes a BSON element with key name and string value value. More...
 
void write_bson_string (const string_t &name, const string_t &value)
 Writes a BSON element with key name and string value value. More...
 
void write_bson_unsigned (const string_t &name, const std::uint64_t value)
 Writes a BSON element with key name and unsigned value. More...
 
void write_bson_unsigned (const string_t &name, const std::uint64_t value)
 Writes a BSON element with key name and unsigned value. More...
 
void write_compact_float (const number_float_t n, detail::input_format_t format)
 
void write_compact_float (const number_float_t n, detail::input_format_t format)
 
template<typename NumberType , bool OutputIsLittleEndian = false>
void write_number (const NumberType n)
 
template<typename NumberType , bool OutputIsLittleEndian = false>
void write_number (const NumberType n)
 
template<typename NumberType , typename std::enable_if< std::is_floating_point< NumberType >::value, int >::type = 0>
void write_number_with_ubjson_prefix (const NumberType n, const bool add_prefix)
 
template<typename NumberType , typename std::enable_if< std::is_unsigned< NumberType >::value, int >::type = 0>
void write_number_with_ubjson_prefix (const NumberType n, const bool add_prefix)
 
template<typename NumberType , typename std::enable_if< std::is_signed< NumberType >::value &&!std::is_floating_point< NumberType >::value, int >::type = 0>
void write_number_with_ubjson_prefix (const NumberType n, const bool add_prefix)
 
template<typename NumberType , typename std::enable_if< std::is_floating_point< NumberType >::value, int >::type = 0>
void write_number_with_ubjson_prefix (const NumberType n, const bool add_prefix)
 
template<typename NumberType , typename std::enable_if< std::is_unsigned< NumberType >::value, int >::type = 0>
void write_number_with_ubjson_prefix (const NumberType n, const bool add_prefix)
 
template<typename NumberType , typename std::enable_if< std::is_signed< NumberType >::value &&!std::is_floating_point< NumberType >::value, int >::type = 0>
void write_number_with_ubjson_prefix (const NumberType n, const bool add_prefix)
 

Static Private Member Functions

static std::size_t calc_bson_array_size (const typename BasicJsonType::array_t &value)
 
static std::size_t calc_bson_array_size (const typename BasicJsonType::array_t &value)
 
static std::size_t calc_bson_binary_size (const typename BasicJsonType::binary_t &value)
 
static std::size_t calc_bson_binary_size (const typename BasicJsonType::binary_t &value)
 
static std::size_t calc_bson_element_size (const string_t &name, const BasicJsonType &j)
 Calculates the size necessary to serialize the JSON value j with its name. More...
 
static std::size_t calc_bson_element_size (const string_t &name, const BasicJsonType &j)
 Calculates the size necessary to serialize the JSON value j with its name. More...
 
static std::size_t calc_bson_entry_header_size (const string_t &name)
 
static std::size_t calc_bson_entry_header_size (const string_t &name)
 
static std::size_t calc_bson_integer_size (const std::int64_t value)
 
static std::size_t calc_bson_integer_size (const std::int64_t value)
 
static std::size_t calc_bson_object_size (const typename BasicJsonType::object_t &value)
 Calculates the size of the BSON serialization of the given JSON-object j. More...
 
static std::size_t calc_bson_object_size (const typename BasicJsonType::object_t &value)
 Calculates the size of the BSON serialization of the given JSON-object j. More...
 
static std::size_t calc_bson_string_size (const string_t &value)
 
static std::size_t calc_bson_string_size (const string_t &value)
 
static constexpr std::size_t calc_bson_unsigned_size (const std::uint64_t value) noexcept
 
static constexpr std::size_t calc_bson_unsigned_size (const std::uint64_t value) noexcept
 
static constexpr CharType get_cbor_float_prefix (double)
 
static constexpr CharType get_cbor_float_prefix (double)
 
static constexpr CharType get_cbor_float_prefix (float)
 
static constexpr CharType get_cbor_float_prefix (float)
 
static constexpr CharType get_msgpack_float_prefix (double)
 
static constexpr CharType get_msgpack_float_prefix (double)
 
static constexpr CharType get_msgpack_float_prefix (float)
 
static constexpr CharType get_msgpack_float_prefix (float)
 
static constexpr CharType get_ubjson_float_prefix (double)
 
static constexpr CharType get_ubjson_float_prefix (double)
 
static constexpr CharType get_ubjson_float_prefix (float)
 
static constexpr CharType get_ubjson_float_prefix (float)
 

Private Attributes

const bool is_little_endian = little_endianess()
 whether we can assume little endianess More...
 
output_adapter_t< CharType > oa = nullptr
 the output More...
 

Detailed Description

template<typename BasicJsonType, typename CharType>
class nlohmann::detail::binary_writer< BasicJsonType, CharType >

serialization to CBOR and MessagePack values

Definition at line 12826 of file json.h.

Member Typedef Documentation

◆ binary_t [1/2]

template<typename BasicJsonType , typename CharType >
using nlohmann::detail::binary_writer< BasicJsonType, CharType >::binary_t = typename BasicJsonType::binary_t
private

Definition at line 12829 of file json.h.

◆ binary_t [2/2]

template<typename BasicJsonType , typename CharType >
using nlohmann::detail::binary_writer< BasicJsonType, CharType >::binary_t = typename BasicJsonType::binary_t
private

Definition at line 12829 of file json.h.

◆ number_float_t [1/2]

template<typename BasicJsonType , typename CharType >
using nlohmann::detail::binary_writer< BasicJsonType, CharType >::number_float_t = typename BasicJsonType::number_float_t
private

Definition at line 12830 of file json.h.

◆ number_float_t [2/2]

template<typename BasicJsonType , typename CharType >
using nlohmann::detail::binary_writer< BasicJsonType, CharType >::number_float_t = typename BasicJsonType::number_float_t
private

Definition at line 12830 of file json.h.

◆ string_t [1/2]

template<typename BasicJsonType , typename CharType >
using nlohmann::detail::binary_writer< BasicJsonType, CharType >::string_t = typename BasicJsonType::string_t
private

Definition at line 12828 of file json.h.

◆ string_t [2/2]

template<typename BasicJsonType , typename CharType >
using nlohmann::detail::binary_writer< BasicJsonType, CharType >::string_t = typename BasicJsonType::string_t
private

Definition at line 12828 of file json.h.

Constructor & Destructor Documentation

◆ binary_writer() [1/2]

template<typename BasicJsonType , typename CharType >
nlohmann::detail::binary_writer< BasicJsonType, CharType >::binary_writer ( output_adapter_t< CharType >  adapter)
inlineexplicit

create a binary writer

Parameters
[in]adapteroutput adapter to write to

Definition at line 12838 of file json.h.

References JSON_ASSERT, and nlohmann::detail::binary_writer< BasicJsonType, CharType >::oa.

◆ binary_writer() [2/2]

template<typename BasicJsonType , typename CharType >
nlohmann::detail::binary_writer< BasicJsonType, CharType >::binary_writer ( output_adapter_t< CharType >  adapter)
inlineexplicit

create a binary writer

Parameters
[in]adapteroutput adapter to write to

Definition at line 12838 of file json.h.

References JSON_ASSERT, and nlohmann::detail::binary_writer< BasicJsonType, CharType >::oa.

Member Function Documentation

◆ calc_bson_array_size() [1/2]

template<typename BasicJsonType , typename CharType >
static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_array_size ( const typename BasicJsonType::array_t &  value)
inlinestaticprivate
Returns
The size of the BSON-encoded array value

Definition at line 13850 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_element_size(), and nlohmann::to_string().

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_element_size(), and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_array().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calc_bson_array_size() [2/2]

template<typename BasicJsonType , typename CharType >
static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_array_size ( const typename BasicJsonType::array_t &  value)
inlinestaticprivate
Returns
The size of the BSON-encoded array value

Definition at line 13850 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_element_size(), and nlohmann::to_string().

+ Here is the call graph for this function:

◆ calc_bson_binary_size() [1/2]

template<typename BasicJsonType , typename CharType >
static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_binary_size ( const typename BasicJsonType::binary_t &  value)
inlinestaticprivate
Returns
The size of the BSON-encoded binary array value

Definition at line 13865 of file json.h.

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_element_size().

+ Here is the caller graph for this function:

◆ calc_bson_binary_size() [2/2]

template<typename BasicJsonType , typename CharType >
static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_binary_size ( const typename BasicJsonType::binary_t &  value)
inlinestaticprivate
Returns
The size of the BSON-encoded binary array value

Definition at line 13865 of file json.h.

◆ calc_bson_element_size() [1/2]

template<typename BasicJsonType , typename CharType >
static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_element_size ( const string_t name,
const BasicJsonType &  j 
)
inlinestaticprivate

◆ calc_bson_element_size() [2/2]

◆ calc_bson_entry_header_size() [1/2]

template<typename BasicJsonType , typename CharType >
static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_entry_header_size ( const string_t name)
inlinestaticprivate
Returns
The size of a BSON document entry header, including the id marker and the entry name size (and its null-terminator).

Definition at line 13703 of file json.h.

References nlohmann::detail::out_of_range::create(), JSON_HEDLEY_UNLIKELY, JSON_THROW, and nlohmann::to_string().

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_element_size().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calc_bson_entry_header_size() [2/2]

template<typename BasicJsonType , typename CharType >
static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_entry_header_size ( const string_t name)
inlinestaticprivate
Returns
The size of a BSON document entry header, including the id marker and the entry name size (and its null-terminator).

Definition at line 13703 of file json.h.

References nlohmann::detail::out_of_range::create(), JSON_HEDLEY_UNLIKELY, JSON_THROW, and nlohmann::to_string().

+ Here is the call graph for this function:

◆ calc_bson_integer_size() [1/2]

template<typename BasicJsonType , typename CharType >
static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_integer_size ( const std::int64_t  value)
inlinestaticprivate
Returns
The size of the BSON-encoded integer value

Definition at line 13780 of file json.h.

References max, and min.

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_element_size().

+ Here is the caller graph for this function:

◆ calc_bson_integer_size() [2/2]

template<typename BasicJsonType , typename CharType >
static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_integer_size ( const std::int64_t  value)
inlinestaticprivate
Returns
The size of the BSON-encoded integer value

Definition at line 13780 of file json.h.

References max, and min.

◆ calc_bson_object_size() [1/2]

template<typename BasicJsonType , typename CharType >
static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_object_size ( const typename BasicJsonType::object_t &  value)
inlinestaticprivate

Calculates the size of the BSON serialization of the given JSON-object j.

Parameters
[in]jJSON value to serialize
Precondition
j.type() == value_t::object

Definition at line 14001 of file json.h.

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_element_size(), and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_object().

+ Here is the caller graph for this function:

◆ calc_bson_object_size() [2/2]

template<typename BasicJsonType , typename CharType >
static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_object_size ( const typename BasicJsonType::object_t &  value)
inlinestaticprivate

Calculates the size of the BSON serialization of the given JSON-object j.

Parameters
[in]jJSON value to serialize
Precondition
j.type() == value_t::object

Definition at line 14001 of file json.h.

◆ calc_bson_string_size() [1/2]

template<typename BasicJsonType , typename CharType >
static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_string_size ( const string_t value)
inlinestaticprivate
Returns
The size of the BSON-encoded string in value

Definition at line 13750 of file json.h.

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_element_size().

+ Here is the caller graph for this function:

◆ calc_bson_string_size() [2/2]

template<typename BasicJsonType , typename CharType >
static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_string_size ( const string_t value)
inlinestaticprivate
Returns
The size of the BSON-encoded string in value

Definition at line 13750 of file json.h.

◆ calc_bson_unsigned_size() [1/2]

template<typename BasicJsonType , typename CharType >
static constexpr std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_unsigned_size ( const std::uint64_t  value)
inlinestaticconstexprprivatenoexcept
Returns
The size of the BSON-encoded unsigned integer in j

Definition at line 13808 of file json.h.

References max.

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_element_size().

+ Here is the caller graph for this function:

◆ calc_bson_unsigned_size() [2/2]

template<typename BasicJsonType , typename CharType >
static constexpr std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_unsigned_size ( const std::uint64_t  value)
inlinestaticconstexprprivatenoexcept
Returns
The size of the BSON-encoded unsigned integer in j

Definition at line 13808 of file json.h.

References max.

◆ get_cbor_float_prefix() [1/4]

template<typename BasicJsonType , typename CharType >
static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::get_cbor_float_prefix ( double  )
inlinestaticconstexprprivate

Definition at line 14037 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type().

+ Here is the call graph for this function:

◆ get_cbor_float_prefix() [2/4]

template<typename BasicJsonType , typename CharType >
static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::get_cbor_float_prefix ( double  )
inlinestaticconstexprprivate

Definition at line 14037 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type().

+ Here is the call graph for this function:

◆ get_cbor_float_prefix() [3/4]

template<typename BasicJsonType , typename CharType >
static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::get_cbor_float_prefix ( float  )
inlinestaticconstexprprivate

Definition at line 14032 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type().

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_compact_float().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_cbor_float_prefix() [4/4]

template<typename BasicJsonType , typename CharType >
static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::get_cbor_float_prefix ( float  )
inlinestaticconstexprprivate

Definition at line 14032 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type().

+ Here is the call graph for this function:

◆ get_msgpack_float_prefix() [1/4]

template<typename BasicJsonType , typename CharType >
static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::get_msgpack_float_prefix ( double  )
inlinestaticconstexprprivate

Definition at line 14051 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type().

+ Here is the call graph for this function:

◆ get_msgpack_float_prefix() [2/4]

template<typename BasicJsonType , typename CharType >
static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::get_msgpack_float_prefix ( double  )
inlinestaticconstexprprivate

Definition at line 14051 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type().

+ Here is the call graph for this function:

◆ get_msgpack_float_prefix() [3/4]

template<typename BasicJsonType , typename CharType >
static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::get_msgpack_float_prefix ( float  )
inlinestaticconstexprprivate

Definition at line 14046 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type().

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_compact_float().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_msgpack_float_prefix() [4/4]

template<typename BasicJsonType , typename CharType >
static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::get_msgpack_float_prefix ( float  )
inlinestaticconstexprprivate

Definition at line 14046 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type().

+ Here is the call graph for this function:

◆ get_ubjson_float_prefix() [1/4]

template<typename BasicJsonType , typename CharType >
static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::get_ubjson_float_prefix ( double  )
inlinestaticconstexprprivate

Definition at line 14288 of file json.h.

◆ get_ubjson_float_prefix() [2/4]

template<typename BasicJsonType , typename CharType >
static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::get_ubjson_float_prefix ( double  )
inlinestaticconstexprprivate

Definition at line 14288 of file json.h.

◆ get_ubjson_float_prefix() [3/4]

template<typename BasicJsonType , typename CharType >
static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::get_ubjson_float_prefix ( float  )
inlinestaticconstexprprivate

◆ get_ubjson_float_prefix() [4/4]

template<typename BasicJsonType , typename CharType >
static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::get_ubjson_float_prefix ( float  )
inlinestaticconstexprprivate

Definition at line 14283 of file json.h.

◆ to_char_type() [1/8]

template<typename BasicJsonType , typename CharType >
template<typename InputCharType , typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_signed< char >::value &&std::is_same< char, typename std::remove_cv< InputCharType >::type >::value > * = nullptr>
static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type ( InputCharType  x)
inlinestaticconstexprnoexcept

Definition at line 14381 of file json.h.

References two-ray-to-three-gpp-ch-calibration::x.

◆ to_char_type() [2/8]

template<typename BasicJsonType , typename CharType >
template<typename InputCharType , typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_signed< char >::value &&std::is_same< char, typename std::remove_cv< InputCharType >::type >::value > * = nullptr>
static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type ( InputCharType  x)
inlinestaticconstexprnoexcept

Definition at line 14381 of file json.h.

References two-ray-to-three-gpp-ch-calibration::x.

◆ to_char_type() [3/8]

◆ to_char_type() [4/8]

template<typename BasicJsonType , typename CharType >
template<typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_unsigned< char >::value > * = nullptr>
static CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type ( std::uint8_t  x)
inlinestaticnoexcept

Definition at line 14359 of file json.h.

References second::value, and two-ray-to-three-gpp-ch-calibration::x.

◆ to_char_type() [5/8]

template<typename BasicJsonType , typename CharType >
template<typename C = CharType, enable_if_t< std::is_unsigned< C >::value > * = nullptr>
static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type ( std::uint8_t  x)
inlinestaticconstexprnoexcept

Definition at line 14370 of file json.h.

References two-ray-to-three-gpp-ch-calibration::x.

◆ to_char_type() [6/8]

template<typename BasicJsonType , typename CharType >
template<typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_signed< char >::value > * = nullptr>
static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type ( std::uint8_t  x)
inlinestaticconstexprnoexcept

Definition at line 14352 of file json.h.

References two-ray-to-three-gpp-ch-calibration::x.

◆ to_char_type() [7/8]

template<typename BasicJsonType , typename CharType >
template<typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_unsigned< char >::value > * = nullptr>
static CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type ( std::uint8_t  x)
inlinestaticnoexcept

Definition at line 14359 of file json.h.

References second::value, and two-ray-to-three-gpp-ch-calibration::x.

◆ to_char_type() [8/8]

template<typename BasicJsonType , typename CharType >
template<typename C = CharType, enable_if_t< std::is_unsigned< C >::value > * = nullptr>
static constexpr CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type ( std::uint8_t  x)
inlinestaticconstexprnoexcept

Definition at line 14370 of file json.h.

References two-ray-to-three-gpp-ch-calibration::x.

◆ ubjson_prefix() [1/2]

template<typename BasicJsonType , typename CharType >
CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::ubjson_prefix ( const BasicJsonType &  j) const
inlineprivatenoexcept

◆ ubjson_prefix() [2/2]

template<typename BasicJsonType , typename CharType >
CharType nlohmann::detail::binary_writer< BasicJsonType, CharType >::ubjson_prefix ( const BasicJsonType &  j) const
inlineprivatenoexcept

◆ write_bson() [1/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson ( const BasicJsonType &  j)
inline

◆ write_bson() [2/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson ( const BasicJsonType &  j)
inline
Parameters
[in]jJSON value to serialize
Precondition
j.type() == value_t::object

Definition at line 12847 of file json.h.

References nlohmann::detail::type_error::create(), JSON_THROW, nlohmann::detail::object, and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_object().

+ Here is the call graph for this function:

◆ write_bson_array() [1/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_array ( const string_t name,
const typename BasicJsonType::array_t &  value 
)
inlineprivate

◆ write_bson_array() [2/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_array ( const string_t name,
const typename BasicJsonType::array_t &  value 
)
inlineprivate

◆ write_bson_binary() [1/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_binary ( const string_t name,
const binary_t value 
)
inlineprivate

Writes a BSON element with key name and binary value value.

Definition at line 13892 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::oa, nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_entry_header(), and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_number().

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_element().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_bson_binary() [2/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_binary ( const string_t name,
const binary_t value 
)
inlineprivate

◆ write_bson_boolean() [1/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_boolean ( const string_t name,
const bool  value 
)
inlineprivate

Writes a BSON element with key name and boolean value value.

Definition at line 13730 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::oa, nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type(), and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_entry_header().

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_element().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_bson_boolean() [2/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_boolean ( const string_t name,
const bool  value 
)
inlineprivate

Writes a BSON element with key name and boolean value value.

Definition at line 13730 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::oa, nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type(), and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_entry_header().

+ Here is the call graph for this function:

◆ write_bson_double() [1/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_double ( const string_t name,
const double  value 
)
inlineprivate

Writes a BSON element with key name and double value value.

Definition at line 13740 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_entry_header().

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_element().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_bson_double() [2/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_double ( const string_t name,
const double  value 
)
inlineprivate

Writes a BSON element with key name and double value value.

Definition at line 13740 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_entry_header().

+ Here is the call graph for this function:

◆ write_bson_element() [1/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_element ( const string_t name,
const BasicJsonType &  j 
)
inlineprivate

Serializes the JSON value j to BSON and associates it with the key name.

Parameters
nameThe name to associate with the JSON entity j within the current BSON document
Returns
The size of the BSON entry

Definition at line 13955 of file json.h.

References nlohmann::detail::array, nlohmann::detail::binary, nlohmann::detail::boolean, JSON_ASSERT, nlohmann::detail::null, nlohmann::detail::number_float, nlohmann::detail::number_integer, nlohmann::detail::number_unsigned, nlohmann::detail::object, nlohmann::detail::string, nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_array(), nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_binary(), nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_boolean(), nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_double(), nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_integer(), nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_null(), nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_object_entry(), nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_string(), and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_unsigned().

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_array(), and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_object().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_bson_element() [2/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_element ( const string_t name,
const BasicJsonType &  j 
)
inlineprivate

◆ write_bson_entry_header() [1/2]

◆ write_bson_entry_header() [2/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_entry_header ( const string_t name,
const std::uint8_t  element_type 
)
inlineprivate

Writes the given element_type and name to the output adapter.

Definition at line 13718 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::oa, and nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type().

+ Here is the call graph for this function:

◆ write_bson_integer() [1/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_integer ( const string_t name,
const std::int64_t  value 
)
inlineprivate

Writes a BSON element with key name and integer value.

Definition at line 13790 of file json.h.

References max, min, and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_entry_header().

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_element().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_bson_integer() [2/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_integer ( const string_t name,
const std::int64_t  value 
)
inlineprivate

Writes a BSON element with key name and integer value.

Definition at line 13790 of file json.h.

References max, min, and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_entry_header().

+ Here is the call graph for this function:

◆ write_bson_null() [1/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_null ( const string_t name)
inlineprivate

Writes a BSON element with key name and null value.

Definition at line 13772 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_entry_header().

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_element().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_bson_null() [2/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_null ( const string_t name)
inlineprivate

Writes a BSON element with key name and null value.

Definition at line 13772 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_entry_header().

+ Here is the call graph for this function:

◆ write_bson_object() [1/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_object ( const typename BasicJsonType::object_t &  value)
inlineprivate

◆ write_bson_object() [2/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_object ( const typename BasicJsonType::object_t &  value)
inlineprivate

◆ write_bson_object_entry() [1/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_object_entry ( const string_t name,
const typename BasicJsonType::object_t &  value 
)
inlineprivate

Writes a BSON element with key name and object value.

Definition at line 13840 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_entry_header(), and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_object().

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_element().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_bson_object_entry() [2/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_object_entry ( const string_t name,
const typename BasicJsonType::object_t &  value 
)
inlineprivate

Writes a BSON element with key name and object value.

Definition at line 13840 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_entry_header(), and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_object().

+ Here is the call graph for this function:

◆ write_bson_string() [1/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_string ( const string_t name,
const string_t value 
)
inlineprivate

Writes a BSON element with key name and string value value.

Definition at line 13758 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::oa, and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_entry_header().

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_element().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_bson_string() [2/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_string ( const string_t name,
const string_t value 
)
inlineprivate

Writes a BSON element with key name and string value value.

Definition at line 13758 of file json.h.

References nlohmann::detail::binary_writer< BasicJsonType, CharType >::oa, and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_entry_header().

+ Here is the call graph for this function:

◆ write_bson_unsigned() [1/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_unsigned ( const string_t name,
const std::uint64_t  value 
)
inlineprivate

Writes a BSON element with key name and unsigned value.

Definition at line 13818 of file json.h.

References nlohmann::detail::out_of_range::create(), JSON_THROW, max, nlohmann::to_string(), and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_entry_header().

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_element().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_bson_unsigned() [2/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_unsigned ( const string_t name,
const std::uint64_t  value 
)
inlineprivate

Writes a BSON element with key name and unsigned value.

Definition at line 13818 of file json.h.

References nlohmann::detail::out_of_range::create(), JSON_THROW, max, nlohmann::to_string(), and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_entry_header().

+ Here is the call graph for this function:

◆ write_cbor() [1/2]

◆ write_cbor() [2/2]

◆ write_compact_float() [1/2]

◆ write_compact_float() [2/2]

◆ write_msgpack() [1/2]

◆ write_msgpack() [2/2]

◆ write_number() [1/2]

◆ write_number() [2/2]

template<typename BasicJsonType , typename CharType >
template<typename NumberType , bool OutputIsLittleEndian = false>
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_number ( const NumberType  n)
inlineprivate

◆ write_number_with_ubjson_prefix() [1/6]

template<typename BasicJsonType , typename CharType >
template<typename NumberType , typename std::enable_if< std::is_floating_point< NumberType >::value, int >::type = 0>
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_number_with_ubjson_prefix ( const NumberType  n,
const bool  add_prefix 
)
inlineprivate

◆ write_number_with_ubjson_prefix() [2/6]

template<typename BasicJsonType , typename CharType >
template<typename NumberType , typename std::enable_if< std::is_unsigned< NumberType >::value, int >::type = 0>
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_number_with_ubjson_prefix ( const NumberType  n,
const bool  add_prefix 
)
inlineprivate

◆ write_number_with_ubjson_prefix() [3/6]

template<typename BasicJsonType , typename CharType >
template<typename NumberType , typename std::enable_if< std::is_signed< NumberType >::value &&!std::is_floating_point< NumberType >::value, int >::type = 0>
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_number_with_ubjson_prefix ( const NumberType  n,
const bool  add_prefix 
)
inlineprivate

◆ write_number_with_ubjson_prefix() [4/6]

template<typename BasicJsonType , typename CharType >
template<typename NumberType , typename std::enable_if< std::is_floating_point< NumberType >::value, int >::type = 0>
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_number_with_ubjson_prefix ( const NumberType  n,
const bool  add_prefix 
)
inlineprivate

◆ write_number_with_ubjson_prefix() [5/6]

template<typename BasicJsonType , typename CharType >
template<typename NumberType , typename std::enable_if< std::is_unsigned< NumberType >::value, int >::type = 0>
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_number_with_ubjson_prefix ( const NumberType  n,
const bool  add_prefix 
)
inlineprivate

◆ write_number_with_ubjson_prefix() [6/6]

template<typename BasicJsonType , typename CharType >
template<typename NumberType , typename std::enable_if< std::is_signed< NumberType >::value &&!std::is_floating_point< NumberType >::value, int >::type = 0>
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_number_with_ubjson_prefix ( const NumberType  n,
const bool  add_prefix 
)
inlineprivate

◆ write_ubjson() [1/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_ubjson ( const BasicJsonType &  j,
const bool  use_count,
const bool  use_type,
const bool  add_prefix = true 
)
inline

◆ write_ubjson() [2/2]

template<typename BasicJsonType , typename CharType >
void nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_ubjson ( const BasicJsonType &  j,
const bool  use_count,
const bool  use_type,
const bool  add_prefix = true 
)
inline

Member Data Documentation

◆ is_little_endian

template<typename BasicJsonType , typename CharType >
const bool nlohmann::detail::binary_writer< BasicJsonType, CharType >::is_little_endian = little_endianess()
private

whether we can assume little endianess

Definition at line 14388 of file json.h.

Referenced by nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_number().

◆ oa


The documentation for this class was generated from the following file: