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

Class to access constant maps. More...

#include <msgpack_light/details/map_ref.h>

Collaboration diagram for msgpack_light::const_map_ref:

Public Types

using const_iterator = const_map_iterator
 Type of iterators.
using const_object_ref_type = const_object_ref
 Type to access constant objects.
using iterator = const_map_iterator
 Type of iterators.

Public Member Functions

 const_map_ref (const details::map_data &data)
 Constructor.
const_map_iterator begin () const noexcept
 Get an iterator to the first key-value pair.
const_map_iterator end () const noexcept
 Get an iterator to the past-the-end key-value pair.
const_object_ref_type key (std::size_t index) const noexcept
 Get a key.
std::size_t size () const noexcept
 Get the size.
const_object_ref_type value (std::size_t index) const noexcept
 Get a value.

Private Attributes

const details::map_datadata_
 Data.

Detailed Description

Class to access constant maps.

Note
Instances of this class can be created from msgpack_light::object, msgpack_light::const_object_ref, msgpack_light::mutable_object_ref 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 43 of file map_ref.h.

Member Typedef Documentation

◆ const_iterator

Type of iterators.

Definition at line 52 of file map_ref.h.

◆ const_object_ref_type

Type to access constant objects.

Definition at line 46 of file map_ref.h.

◆ iterator

Type of iterators.

Definition at line 49 of file map_ref.h.

Constructor & Destructor Documentation

◆ const_map_ref()

msgpack_light::const_map_ref::const_map_ref ( const details::map_data & data)
inlineexplicit

Constructor.

Parameters
[in]dataData.

Definition at line 59 of file map_ref.h.

Member Function Documentation

◆ begin()

const_map_iterator msgpack_light::const_map_ref::begin ( ) const
inlinenodiscardnoexcept

Get an iterator to the first key-value pair.

Returns
Iterator.

Definition at line 89 of file map_ref.h.

◆ end()

const_map_iterator msgpack_light::const_map_ref::end ( ) const
inlinenodiscardnoexcept

Get an iterator to the past-the-end key-value pair.

Returns
Iterator.

Definition at line 98 of file map_ref.h.

◆ key()

const_map_ref::const_object_ref_type msgpack_light::const_map_ref::key ( std::size_t index) const
inlinenodiscardnoexcept

Get a key.

Parameters
[in]indexIndex of the key-value pair.
Returns
Object of the key.

Definition at line 62 of file map_ref_impl.h.

◆ size()

std::size_t msgpack_light::const_map_ref::size ( ) const
inlinenodiscardnoexcept

Get the size.

Returns
Size.

Definition at line 66 of file map_ref.h.

◆ value()

const_map_ref::const_object_ref_type msgpack_light::const_map_ref::value ( std::size_t index) const
inlinenodiscardnoexcept

Get a value.

Parameters
[in]indexIndex of the key-value pair.
Returns
Object of the value.

Definition at line 67 of file map_ref_impl.h.

Member Data Documentation

◆ data_

const details::map_data* msgpack_light::const_map_ref::data_
private

Data.

Definition at line 104 of file map_ref.h.


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