cpp-msgpack-light 0.3.0
A light library to serialize MessagePack.
|
Class to access non-constant objects. More...
#include <msgpack_light/details/object_ref.h>
Public Types | |
using | base_type |
Type of the base class. | |
Public Types inherited from msgpack_light::details::mutable_object_base< mutable_object_ref< Allocator >, Allocator > | |
using | allocator_type |
Type of the allocator. |
Public Member Functions | |
Initialization and finalization | |
mutable_object_ref (details::object_data &data, details::allocator_wrapper< Allocator > &allocator) | |
Constructor. | |
Internal data | |
| |
details::object_data & | data () noexcept |
Get the internal data. | |
const details::object_data & | data () const noexcept |
Get the internal data. | |
details::allocator_wrapper< Allocator > & | allocator () noexcept |
Get the allocator. | |
Public Member Functions inherited from msgpack_light::details::mutable_object_base< mutable_object_ref< Allocator >, Allocator > | |
void | set_unsigned_integer (std::uint64_t value) noexcept |
Set this object to an unsigned integer. | |
void | set_signed_integer (std::int64_t value) noexcept |
Set this object to a signed integer. | |
void | set_boolean (bool value) noexcept |
Set this object to a boolean value. | |
void | set_float32 (float value) noexcept |
Set this object to a 32-bit floating-point number. | |
void | set_float64 (double value) noexcept |
Set this object to a 64-bit floating-point number. | |
void | set_string (std::string_view value) |
Set this object to a string. | |
void | set_binary (binary_view value) |
Set this object to a binary. | |
mutable_array_ref< Allocator > | set_array (std::size_t size=0U) |
Set this object to an array. | |
mutable_map_ref< Allocator > | set_map (std::size_t size=0U) |
Set this object to a map. | |
void | set_extension (std::int8_t type, binary_view value_data) |
Set this object to a extension value. | |
void | clear () noexcept |
Clear the data. | |
mutable_array_ref< Allocator > | as_array () |
Get data as an array. | |
mutable_map_ref< Allocator > | as_map () |
Get data as a map. | |
details::object_data & | data () noexcept |
Get the internal data. | |
const details::object_data & | data () const noexcept |
Get the internal data. | |
allocator_wrapper< Allocator > & | allocator () noexcept |
Get the allocator. | |
Public Member Functions inherited from msgpack_light::details::const_object_base< Derived > | |
object_data_type | type () const noexcept |
Get the type of this object. | |
std::uint64_t | as_unsigned_integer () const |
Get data as an unsigned integer. | |
std::int64_t | as_signed_integer () const |
Get data as a signed integer. | |
bool | as_boolean () const |
Get data as a boolean. | |
float | as_float32 () const |
Get data as a 32-bit floating-pointe number. | |
double | as_float64 () const |
Get data as a 64-bit floating-pointe number. | |
std::string_view | as_string () const |
Get data as a string. | |
binary_view | as_binary () const |
Get data as a binary. | |
const_array_ref | as_array () const |
Get data as an array. | |
const_map_ref | as_map () const |
Get data as a map. | |
const_extension_ref | as_extension () const |
Get data as an extension. | |
const details::object_data & | data () const noexcept |
Get the internal data. |
Private Attributes | |
details::allocator_wrapper< Allocator > * | allocator_ |
Allocator. | |
details::object_data * | data_ |
Data. |
Additional Inherited Members | |
Protected Member Functions inherited from msgpack_light::details::mutable_object_base< mutable_object_ref< Allocator >, Allocator > | |
mutable_object_base ()=default | |
Constructor. | |
const mutable_object_ref< Allocator > & | derived () const noexcept |
Access the derived class. | |
mutable_object_ref< Allocator > & | derived () noexcept |
Access the derived class. | |
Protected Member Functions inherited from msgpack_light::details::const_object_base< Derived > | |
const_object_base ()=default | |
Constructor. | |
const Derived & | derived () const noexcept |
Access the derived class. |
Class to access non-constant objects.
Allocator | Type of the allocator. |
Definition at line 46 of file object_ref.h.
using msgpack_light::mutable_object_ref< Allocator >::base_type |
Type of the base class.
Definition at line 51 of file object_ref.h.
|
inline |
Constructor.
[in] | data | Data. |
[in] | allocator | Allocator. |
Definition at line 67 of file object_ref.h.
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
private |
Allocator.
Definition at line 112 of file object_ref.h.
|
private |
Data.
Definition at line 109 of file object_ref.h.