10#ifndef MSGPACK_V1_TYPE_FLOAT_HPP
11#define MSGPACK_V1_TYPE_FLOAT_HPP
30 if(o.
type == msgpack::type::FLOAT32 || o.
type == msgpack::type::FLOAT64) {
31 v =
static_cast<float>(o.
via.
f64);
33 else if (o.
type == msgpack::type::POSITIVE_INTEGER) {
34 v =
static_cast<float>(o.
via.
u64);
36 else if (o.
type == msgpack::type::NEGATIVE_INTEGER) {
37 v =
static_cast<float>(o.
via.
i64);
48 template <
typename Stream>
59 if(o.
type == msgpack::type::FLOAT32 || o.
type == msgpack::type::FLOAT64) {
62 else if (o.
type == msgpack::type::POSITIVE_INTEGER) {
63 v =
static_cast<double>(o.
via.
u64);
65 else if (o.
type == msgpack::type::NEGATIVE_INTEGER) {
66 v =
static_cast<double>(o.
via.
i64);
77 template <
typename Stream>
88 o.
type = msgpack::type::FLOAT32;
89 o.
via.
f64 =
static_cast<double>(v);
96 o.
type = msgpack::type::FLOAT64;
The class template that supports continuous packing.
Definition pack.hpp:33
packer< Stream > & pack_double(double d)
Packing double.
Definition pack.hpp:1150
packer< Stream > & pack_float(float d)
Packing float.
Definition pack.hpp:1139
Definition object_fwd.hpp:231
Definition adaptor_base.hpp:15
msgpack::object const & operator()(msgpack::object const &o, double &v) const
Definition float.hpp:58
msgpack::object const & operator()(msgpack::object const &o, float &v) const
Definition float.hpp:29
Definition adaptor_base.hpp:27
void operator()(msgpack::object &o, double v) const
Definition float.hpp:95
void operator()(msgpack::object &o, float v) const
Definition float.hpp:87
void operator()(msgpack::object::with_zone &o, double v) const
Definition float.hpp:110
void operator()(msgpack::object::with_zone &o, float v) const
Definition float.hpp:103
Definition adaptor_base.hpp:43
Definition adaptor_base.hpp:38
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const double &v) const
Definition float.hpp:78
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const float &v) const
Definition float.hpp:49
Definition adaptor_base.hpp:32
Object class that corresponding to MessagePack format object.
Definition object_fwd.hpp:75
union_type via
Definition object_fwd.hpp:93
msgpack::type::object_type type
Definition object_fwd.hpp:92
uint64_t u64
Definition object_fwd.hpp:78
int64_t i64
Definition object_fwd.hpp:79
double f64
Definition object_fwd.hpp:84
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition versioning.hpp:66