cpp-msgpack-light 0.3.0
A light library to serialize MessagePack.
Loading...
Searching...
No Matches
msgpack_light::mutable_object_ref< Allocator > Class Template Reference

Class to access non-constant objects. More...

#include <msgpack_light/details/object_ref.h>

Inheritance diagram for msgpack_light::mutable_object_ref< Allocator >:
Collaboration diagram for msgpack_light::mutable_object_ref< Allocator >:

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
Warning
These functions are for internal implementation of this library.
details::object_datadata () noexcept
 Get the internal data.
const details::object_datadata () 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_datadata () noexcept
 Get the internal data.
const details::object_datadata () 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_datadata () const noexcept
 Get the internal data.

Private Attributes

details::allocator_wrapper< Allocator > * allocator_
 Allocator.
details::object_datadata_
 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.

Detailed Description

template<typename Allocator>
class msgpack_light::mutable_object_ref< Allocator >

Class to access non-constant objects.

Template Parameters
AllocatorType of the allocator.
Note
Instances of this class can be created from msgpack_light::mutable_array_ref, msgpack_light::mutable_array_iterator, msgpack_light::mutable_map_ref, msgpack_light::mutable_map_iterator, classes.
Warning
This class only holds pointers to data in msgpack_light::object class, do not call functions in this class without msgpack_light::object instances holding the data.

Definition at line 46 of file object_ref.h.

Member Typedef Documentation

◆ base_type

template<typename Allocator>
using msgpack_light::mutable_object_ref< Allocator >::base_type
Initial value:

Type of the base class.

Definition at line 51 of file object_ref.h.

Constructor & Destructor Documentation

◆ mutable_object_ref()

template<typename Allocator>
msgpack_light::mutable_object_ref< Allocator >::mutable_object_ref ( details::object_data & data,
details::allocator_wrapper< Allocator > & allocator )
inline

Constructor.

Parameters
[in]dataData.
[in]allocatorAllocator.

Definition at line 67 of file object_ref.h.

Member Function Documentation

◆ allocator()

template<typename Allocator>
details::allocator_wrapper< Allocator > & msgpack_light::mutable_object_ref< Allocator >::allocator ( )
inlinenodiscardnoexcept

Get the allocator.

Returns
Allocator.

Definition at line 101 of file object_ref.h.

◆ data() [1/2]

template<typename Allocator>
const details::object_data & msgpack_light::mutable_object_ref< Allocator >::data ( ) const
inlinenodiscardnoexcept

Get the internal data.

Returns
Internal data.

Definition at line 92 of file object_ref.h.

◆ data() [2/2]

template<typename Allocator>
details::object_data & msgpack_light::mutable_object_ref< Allocator >::data ( )
inlinenodiscardnoexcept

Get the internal data.

Returns
Internal data.

Definition at line 85 of file object_ref.h.

Member Data Documentation

◆ allocator_

template<typename Allocator>
details::allocator_wrapper<Allocator>* msgpack_light::mutable_object_ref< Allocator >::allocator_
private

Allocator.

Definition at line 112 of file object_ref.h.

◆ data_

template<typename Allocator>
details::object_data* msgpack_light::mutable_object_ref< Allocator >::data_
private

Data.

Definition at line 109 of file object_ref.h.


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