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

Base class of constant objects in MessagePack. More...

#include <msgpack_light/details/object_base.h>

Inheritance diagram for msgpack_light::details::const_object_base< Derived >:
Collaboration diagram for msgpack_light::details::const_object_base< Derived >:

Public Member Functions

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

Protected Member Functions

 const_object_base ()=default
 Constructor.
const Derived & derived () const noexcept
 Access the derived class.

Detailed Description

template<typename Derived>
class msgpack_light::details::const_object_base< Derived >

Base class of constant objects in MessagePack.

Template Parameters
DerivedType of the derived class.
Warning
This class cannot be instantiated directly. Instantiate msgpack_light::object classes.

Definition at line 48 of file object_base.h.

Member Function Documentation

◆ as_array()

template<typename Derived>
const_array_ref msgpack_light::details::const_object_base< Derived >::as_array ( ) const
inlinenodiscard

Get data as an array.

Returns
Value.

Definition at line 155 of file object_base.h.

◆ as_binary()

template<typename Derived>
binary_view msgpack_light::details::const_object_base< Derived >::as_binary ( ) const
inlinenodiscard

Get data as a binary.

Returns
Value.

Definition at line 142 of file object_base.h.

◆ as_boolean()

template<typename Derived>
bool msgpack_light::details::const_object_base< Derived >::as_boolean ( ) const
inlinenodiscard

Get data as a boolean.

Returns
Value.

Definition at line 91 of file object_base.h.

◆ as_extension()

template<typename Derived>
const_extension_ref msgpack_light::details::const_object_base< Derived >::as_extension ( ) const
inlinenodiscard

Get data as an extension.

Returns
Value.

Definition at line 179 of file object_base.h.

◆ as_float32()

template<typename Derived>
float msgpack_light::details::const_object_base< Derived >::as_float32 ( ) const
inlinenodiscard

Get data as a 32-bit floating-pointe number.

Returns
Value.

Definition at line 103 of file object_base.h.

◆ as_float64()

template<typename Derived>
double msgpack_light::details::const_object_base< Derived >::as_float64 ( ) const
inlinenodiscard

Get data as a 64-bit floating-pointe number.

Returns
Value.

Definition at line 116 of file object_base.h.

◆ as_map()

template<typename Derived>
const_map_ref msgpack_light::details::const_object_base< Derived >::as_map ( ) const
inlinenodiscard

Get data as a map.

Returns
Value.

Definition at line 167 of file object_base.h.

◆ as_signed_integer()

template<typename Derived>
std::int64_t msgpack_light::details::const_object_base< Derived >::as_signed_integer ( ) const
inlinenodiscard

Get data as a signed integer.

Returns
Value.

Definition at line 79 of file object_base.h.

◆ as_string()

template<typename Derived>
std::string_view msgpack_light::details::const_object_base< Derived >::as_string ( ) const
inlinenodiscard

Get data as a string.

Returns
Value.

Definition at line 129 of file object_base.h.

◆ as_unsigned_integer()

template<typename Derived>
std::uint64_t msgpack_light::details::const_object_base< Derived >::as_unsigned_integer ( ) const
inlinenodiscard

Get data as an unsigned integer.

Returns
Value.

Definition at line 67 of file object_base.h.

◆ data()

template<typename Derived>
const details::object_data & msgpack_light::details::const_object_base< Derived >::data ( ) const
inlinenodiscardnoexcept

Get the internal data.

Returns
Internal data.

Definition at line 200 of file object_base.h.

◆ derived()

template<typename Derived>
const Derived & msgpack_light::details::const_object_base< Derived >::derived ( ) const
inlinenodiscardprotectednoexcept

Access the derived class.

Returns
Reference to the derived class.

Definition at line 212 of file object_base.h.

◆ type()

template<typename Derived>
object_data_type msgpack_light::details::const_object_base< Derived >::type ( ) const
inlinenodiscardnoexcept

Get the type of this object.

Returns
Type of this object.

Definition at line 60 of file object_base.h.


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