Object class that corresponding to MessagePack format object.
More...
#include <object_fwd.hpp>
Object class that corresponding to MessagePack format object.
See https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_object
◆ object() [1/8]
| msgpack::object::object |
( |
| ) |
|
|
inline |
Default constructor. The object is set to nil.
◆ object() [2/8]
| msgpack::object::object |
( |
const T & |
v | ) |
|
|
inlineexplicit |
Construct object from T.
If v is the type that is corresponding to MessegePack format str, bin, ext, array, or map, you need to call object(const T& v, msgpack::zone& z) instead of this constructor.
- Template Parameters
-
- Parameters
-
| v | The value you want to convert. |
◆ object() [3/8]
◆ object() [4/8]
◆ object() [5/8]
| msgpack::object::object |
( |
| ) |
|
|
inline |
◆ object() [6/8]
| msgpack::object::object |
( |
v1::object const & |
o | ) |
|
|
inline |
◆ object() [7/8]
| msgpack::object::object |
( |
const T & |
v | ) |
|
|
inlineexplicit |
Construct object from T.
If v is the type that is corresponding to MessegePack format str, bin, ext, array, or map, you need to call object(const T& v, msgpack::zone& z) instead of this constructor.
- Template Parameters
-
- Parameters
-
| v | The value you want to convert. |
References convert().
◆ object() [8/8]
◆ as() [1/2]
Get value as T.
If the object can't be converted to T, msgpack::type_error would be thrown.
- Template Parameters
-
| T | The type you want to get. |
- Returns
- The converted object.
◆ as() [2/2]
Get value as T.
If the object can't be converted to T, msgpack::type_error would be thrown.
- Template Parameters
-
| T | The type you want to get. |
- Returns
- The converted object.
◆ convert() [1/6]
◆ convert() [2/6]
◆ convert() [3/6]
template<typename T >
| msgpack::enable_if<!msgpack::is_array< T >::value &&!msgpack::is_pointer< T >::value, T & >::type msgpack::object::convert |
( |
T & |
v | ) |
const |
|
inline |
Convert the object.
If the object can't be converted to T, msgpack::type_error would be thrown.
- Template Parameters
-
- Parameters
-
| v | The value you want to get. v is output parameter. v is overwritten by converted value from the object. |
- Returns
- The reference of
v.
References msgpack::operator>>().
Referenced by msgpack::convert().
◆ convert() [4/6]
template<typename T >
| T & msgpack::object::convert |
( |
T & |
v | ) |
const |
|
inline |
Convert the object.
If the object can't be converted to T, msgpack::type_error would be thrown.
- Template Parameters
-
- Parameters
-
| v | The value you want to get. v is output parameter. v is overwritten by converted value from the object. |
- Returns
- The reference of
v.
References convert().
◆ convert() [5/6]
template<typename T >
| msgpack::enable_if< msgpack::is_pointer< T >::value, T >::type msgpack::object::convert |
( |
T |
v | ) |
const |
|
inline |
Convert the object (obsolete)
If the object can't be converted to T, msgpack::type_error would be thrown.
- Template Parameters
-
- Parameters
-
| v | The pointer of the value you want to get. v is output parameter. *v is overwritten by converted value from the object. |
- Returns
- The pointer of
v.
References msgpack::convert().
◆ convert() [6/6]
template<typename T , std::size_t N>
| T(& msgpack::object::convert |
( |
T(&) |
v[N] | ) |
)[N] |
|
inline |
◆ convert_if_not_nil()
| bool msgpack::object::convert_if_not_nil |
( |
T & |
v | ) |
const |
|
inline |
Convert the object if not nil.
If the object is not nil and can't be converted to T, msgpack::type_error would be thrown.
- Template Parameters
-
- Parameters
-
| v | The value you want to get. v is output parameter. v is overwritten by converted value from the object if the object is not nil. |
- Returns
- If the object is nil, then return false, else return true.
References msgpack::convert().
◆ is_nil()
| bool msgpack::object::is_nil |
( |
| ) |
const |
|
inline |
Cheking nil.
- Returns
- If the object is nil, then return true, else return false.
◆ operator=()
◆ type
Referenced by msgpack::operator==(), msgpack::object_parser::parse(), msgpack::detail::create_object_visitor::start_array(), msgpack::detail::create_object_visitor::start_map(), msgpack::detail::create_object_visitor::visit_bin(), msgpack::detail::create_object_visitor::visit_boolean(), msgpack::detail::create_object_visitor::visit_ext(), msgpack::detail::create_object_visitor::visit_float32(), msgpack::detail::create_object_visitor::visit_float64(), msgpack::detail::create_object_visitor::visit_negative_integer(), msgpack::detail::create_object_visitor::visit_nil(), msgpack::detail::create_object_visitor::visit_positive_integer(), and msgpack::detail::create_object_visitor::visit_str().
◆ via
Referenced by msgpack::type::define_array< Args >::msgpack_object(), msgpack::type::define_map_imp< Tuple, N >::object(), msgpack::object_parser::parse(), msgpack::detail::create_object_visitor::start_array(), msgpack::detail::create_object_visitor::start_map(), msgpack::detail::create_object_visitor::visit_bin(), msgpack::detail::create_object_visitor::visit_boolean(), msgpack::detail::create_object_visitor::visit_ext(), msgpack::detail::create_object_visitor::visit_float32(), msgpack::detail::create_object_visitor::visit_float64(), msgpack::detail::create_object_visitor::visit_negative_integer(), msgpack::detail::create_object_visitor::visit_positive_integer(), and msgpack::detail::create_object_visitor::visit_str().
The documentation for this struct was generated from the following files: