![]() |
Eclipse SUMO - Simulation of Urban MObility
|
serialization to CBOR and MessagePack values More...
Public Member Functions | |
| binary_writer (output_adapter_t< CharType > adapter) | |
| create a binary writer | |
| void | write_bson (const BasicJsonType &j) |
| void | write_cbor (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) |
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 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 | number_float_t = typename BasicJsonType::number_float_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 | |
| void | write_bson_array (const string_t &name, const typename BasicJsonType::array_t &value) |
| Writes a BSON element with key name and array value. | |
| void | write_bson_binary (const string_t &name, const binary_t &value) |
| Writes a BSON element with key name and binary value value. | |
| void | write_bson_boolean (const string_t &name, const bool value) |
| Writes a BSON element with key name and boolean value value. | |
| void | write_bson_double (const string_t &name, const double value) |
| Writes a BSON element with key name and double value value. | |
| 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. | |
| 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. | |
| void | write_bson_integer (const string_t &name, const std::int64_t value) |
| Writes a BSON element with key name and integer value. | |
| void | write_bson_null (const string_t &name) |
| Writes a BSON element with key name and null 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. | |
| void | write_bson_string (const string_t &name, const string_t &value) |
| Writes a BSON element with key name and string value value. | |
| void | write_bson_unsigned (const string_t &name, const BasicJsonType &j) |
| Writes a BSON element with key name and unsigned value. | |
| 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 , 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_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. | |
| static std::size_t | calc_bson_entry_header_size (const string_t &name, const BasicJsonType &j) |
| 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. | |
| 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 CharType | get_cbor_float_prefix (double) |
| static constexpr CharType | get_cbor_float_prefix (float) |
| static constexpr CharType | get_msgpack_float_prefix (double) |
| static constexpr CharType | get_msgpack_float_prefix (float) |
| static constexpr CharType | get_ubjson_float_prefix (double) |
| static constexpr CharType | get_ubjson_float_prefix (float) |
Private Attributes | |
| const bool | is_little_endian = little_endianness() |
| whether we can assume little endianness | |
| output_adapter_t< CharType > | oa = nullptr |
| the output | |
serialization to CBOR and MessagePack values
|
private |
|
private |
|
private |
|
inlineexplicit |
create a binary writer
| [in] | adapter | output adapter to write to |
Definition at line 13326 of file json.hpp.
References JSON_ASSERT.
|
inlinestaticprivate |
Definition at line 14368 of file json.hpp.
References nlohmann::detail::value.
|
inlinestaticprivate |
Definition at line 14383 of file json.hpp.
References nlohmann::detail::value.
|
inlinestaticprivate |
Calculates the size necessary to serialize the JSON value j with its name.
Definition at line 14425 of file json.hpp.
References JSON_ASSERT.
|
inlinestaticprivate |
Definition at line 14221 of file json.hpp.
References JSON_HEDLEY_UNLIKELY, and JSON_THROW.
|
inlinestaticprivate |
Definition at line 14298 of file json.hpp.
References nlohmann::detail::value.
|
inlinestaticprivate |
Calculates the size of the BSON serialization of the given JSON-object j.
| [in] | value | JSON value to serialize |
Definition at line 14520 of file json.hpp.
References nlohmann::detail::value.
|
inlinestaticprivate |
Definition at line 14268 of file json.hpp.
References nlohmann::detail::value.
|
inlinestaticconstexprprivatenoexcept |
Definition at line 14326 of file json.hpp.
References nlohmann::detail::value.
|
inlinestaticconstexprprivate |
|
inlinestaticconstexprprivate |
|
inlinestaticconstexprprivate |
|
inlinestaticconstexprprivate |
|
inlinestaticconstexprprivate |
|
inlinestaticconstexprprivate |
|
inlinestaticconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
Definition at line 14879 of file json.hpp.
Referenced by nlohmann::detail::serializer< BasicJsonType >::for().
|
inlinestaticnoexcept |
|
inlinestaticconstexprnoexcept |
|
inlineprivatenoexcept |
|
inline |
| [in] | j | JSON value to serialize |
Definition at line 13335 of file json.hpp.
References JSON_THROW.
Referenced by nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::to_bson(), and nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::to_bson().
|
inlineprivate |
Writes a BSON element with key name and array value.
Definition at line 14391 of file json.hpp.
References nlohmann::detail::value.
|
inlineprivate |
Writes a BSON element with key name and binary value value.
Definition at line 14410 of file json.hpp.
References nlohmann::detail::value.
|
inlineprivate |
Writes a BSON element with key name and boolean value value.
Definition at line 14248 of file json.hpp.
References nlohmann::detail::value.
|
inlineprivate |
Writes a BSON element with key name and double value value.
Definition at line 14258 of file json.hpp.
References nlohmann::detail::value.
|
inlineprivate |
Serializes the JSON value j to BSON and associates it with the key name.
| name | The name to associate with the JSON entity j within the current BSON document |
Definition at line 14473 of file json.hpp.
References JSON_ASSERT.
|
inlineprivate |
|
inlineprivate |
Writes a BSON element with key name and integer value.
Definition at line 14308 of file json.hpp.
References nlohmann::detail::value.
|
inlineprivate |
|
inlineprivate |
| [in] | value | JSON value to serialize |
Definition at line 14535 of file json.hpp.
References nlohmann::detail::value.
|
inlineprivate |
Writes a BSON element with key name and object value.
Definition at line 14358 of file json.hpp.
References nlohmann::detail::value.
|
inlineprivate |
Writes a BSON element with key name and string value value.
Definition at line 14276 of file json.hpp.
References nlohmann::detail::value.
|
inlineprivate |
Writes a BSON element with key name and unsigned value.
Definition at line 14336 of file json.hpp.
References JSON_THROW.
|
inline |
| [in] | j | JSON value to serialize |
Definition at line 13364 of file json.hpp.
References nlohmann::detail::cbor.
Referenced by nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::to_cbor(), and nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::to_cbor().
|
inlineprivate |
Definition at line 14845 of file json.hpp.
References nlohmann::detail::cbor.
|
inline |
| [in] | j | JSON value to serialize |
Definition at line 13688 of file json.hpp.
References nlohmann::detail::msgpack.
Referenced by nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::to_msgpack(), and nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::to_msgpack().
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inline |
| [in] | j | JSON value to serialize |
| [in] | use_count | whether to use '#' prefixes (optimized format) |
| [in] | use_type | whether to use '$' prefixes (optimized format) |
| [in] | add_prefix | whether prefixes need to be used for this value |
Definition at line 14013 of file json.hpp.
References JSON_ASSERT.
Referenced by nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::to_ubjson(), and nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::to_ubjson().
|
private |
|
private |