cpp-msgpack-light 0.3.0
A light library to serialize MessagePack.
Loading...
Searching...
No Matches
msgpack_light::const_object_ref Class Reference

Class to access constant objects. More...

#include <msgpack_light/details/object_ref.h>

Inheritance diagram for msgpack_light::const_object_ref:
Collaboration diagram for msgpack_light::const_object_ref:

Public Types

using base_type = details::const_object_base<const_object_ref>
 Type of the base class.

Public Member Functions

Initialization and finalization
 const_object_ref (const details::object_data &data)
 Constructor.
Internal data
Warning
These functions are for internal implementation of this library.
const details::object_datadata () const noexcept
 Get the internal data.
Public Member Functions inherited from msgpack_light::details::const_object_base< const_object_ref >
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

const details::object_datadata_
 Data.

Additional Inherited Members

Protected Member Functions inherited from msgpack_light::details::const_object_base< const_object_ref >
 const_object_base ()=default
 Constructor.
const const_object_refderived () const noexcept
 Access the derived class.

Detailed Description

Class to access constant objects.

Note
Instances of this class can be created from msgpack_light::mutable_array_ref, msgpack_light::const_array_ref, msgpack_light::mutable_array_iterator, msgpack_light::const_array_iterator, msgpack_light::mutable_map_ref, msgpack_light::const_map_ref, msgpack_light::mutable_map_iterator, msgpack_light::const_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 129 of file object_ref.h.

Member Typedef Documentation

◆ base_type

Type of the base class.

Definition at line 132 of file object_ref.h.

Constructor & Destructor Documentation

◆ const_object_ref()

msgpack_light::const_object_ref::const_object_ref ( const details::object_data & data)
inlineexplicit

Constructor.

Parameters
[in]dataData.

Definition at line 144 of file object_ref.h.

Member Function Documentation

◆ data()

const details::object_data & msgpack_light::const_object_ref::data ( ) const
inlinenodiscardnoexcept

Get the internal data.

Returns
Internal data.

Definition at line 161 of file object_ref.h.

Member Data Documentation

◆ data_

const details::object_data* msgpack_light::const_object_ref::data_
private

Data.

Definition at line 169 of file object_ref.h.


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