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

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

#include <msgpack_light/details/map_ref.h>

Collaboration diagram for msgpack_light::mutable_map_ref< Allocator >:

Public Types

using allocator_type = Allocator
 Type of the allocator.
using const_iterator = const_map_iterator
 Type of iterators.
using const_object_ref_type = const_object_ref
 Type to access constant objects.
using iterator = mutable_map_iterator<Allocator>
 Type of iterators.
using mutable_object_ref_type = mutable_object_ref<Allocator>
 Type to access non-constant objects.

Public Member Functions

 mutable_map_ref (details::map_data &data, details::allocator_wrapper< Allocator > &allocator)
 Constructor.
const_map_iterator begin () const noexcept
 Get an iterator to the first key-value pair.
mutable_map_iterator< Allocator > begin () 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.
mutable_map_iterator< Allocator > end () 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.
mutable_object_ref_type key (std::size_t index) 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.
mutable_object_ref_type value (std::size_t index) noexcept
 Get a value.

Private Attributes

details::allocator_wrapper< Allocator > * allocator_
 Allocator.
details::map_datadata_
 Data.

Detailed Description

template<typename Allocator = standard_allocator>
class msgpack_light::mutable_map_ref< Allocator >

Class to access non-constant maps.

Template Parameters
AllocatorType of the allocator.
Note
Instances of this class can be created from msgpack_light::object, 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 120 of file map_ref.h.

Member Typedef Documentation

◆ allocator_type

template<typename Allocator = standard_allocator>
using msgpack_light::mutable_map_ref< Allocator >::allocator_type = Allocator

Type of the allocator.

Definition at line 123 of file map_ref.h.

◆ const_iterator

template<typename Allocator = standard_allocator>
using msgpack_light::mutable_map_ref< Allocator >::const_iterator = const_map_iterator

Type of iterators.

Definition at line 135 of file map_ref.h.

◆ const_object_ref_type

template<typename Allocator = standard_allocator>
using msgpack_light::mutable_map_ref< Allocator >::const_object_ref_type = const_object_ref

Type to access constant objects.

Definition at line 129 of file map_ref.h.

◆ iterator

template<typename Allocator = standard_allocator>
using msgpack_light::mutable_map_ref< Allocator >::iterator = mutable_map_iterator<Allocator>

Type of iterators.

Definition at line 132 of file map_ref.h.

◆ mutable_object_ref_type

template<typename Allocator = standard_allocator>
using msgpack_light::mutable_map_ref< Allocator >::mutable_object_ref_type = mutable_object_ref<Allocator>

Type to access non-constant objects.

Definition at line 126 of file map_ref.h.

Constructor & Destructor Documentation

◆ mutable_map_ref()

template<typename Allocator = standard_allocator>
msgpack_light::mutable_map_ref< Allocator >::mutable_map_ref ( details::map_data & data,
details::allocator_wrapper< Allocator > & allocator )
inline

Constructor.

Parameters
[in]dataData.
[in]allocatorAllocator.

Definition at line 143 of file map_ref.h.

Member Function Documentation

◆ begin() [1/2]

template<typename Allocator = standard_allocator>
const_map_iterator msgpack_light::mutable_map_ref< Allocator >::begin ( ) const
inlinenodiscardnoexcept

Get an iterator to the first key-value pair.

Returns
Iterator.

Definition at line 210 of file map_ref.h.

◆ begin() [2/2]

template<typename Allocator = standard_allocator>
mutable_map_iterator< Allocator > msgpack_light::mutable_map_ref< Allocator >::begin ( )
inlinenodiscardnoexcept

Get an iterator to the first key-value pair.

Returns
Iterator.

Definition at line 191 of file map_ref.h.

◆ end() [1/2]

template<typename Allocator = standard_allocator>
const_map_iterator msgpack_light::mutable_map_ref< Allocator >::end ( ) const
inlinenodiscardnoexcept

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

Returns
Iterator.

Definition at line 219 of file map_ref.h.

◆ end() [2/2]

template<typename Allocator = standard_allocator>
mutable_map_iterator< Allocator > msgpack_light::mutable_map_ref< Allocator >::end ( )
inlinenodiscardnoexcept

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

Returns
Iterator.

Definition at line 200 of file map_ref.h.

◆ key() [1/2]

template<typename Allocator>
mutable_map_ref< Allocator >::const_object_ref_type msgpack_light::mutable_map_ref< Allocator >::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 42 of file map_ref_impl.h.

◆ key() [2/2]

template<typename Allocator>
mutable_map_ref< Allocator >::mutable_object_ref_type msgpack_light::mutable_map_ref< Allocator >::key ( std::size_t index)
inlinenodiscardnoexcept

Get a key.

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

Definition at line 36 of file map_ref_impl.h.

◆ size()

template<typename Allocator = standard_allocator>
std::size_t msgpack_light::mutable_map_ref< Allocator >::size ( ) const
inlinenodiscardnoexcept

Get the size.

Returns
Size.

Definition at line 152 of file map_ref.h.

◆ value() [1/2]

template<typename Allocator>
mutable_map_ref< Allocator >::const_object_ref_type msgpack_light::mutable_map_ref< Allocator >::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 54 of file map_ref_impl.h.

◆ value() [2/2]

template<typename Allocator>
mutable_map_ref< Allocator >::mutable_object_ref_type msgpack_light::mutable_map_ref< Allocator >::value ( std::size_t index)
inlinenodiscardnoexcept

Get a value.

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

Definition at line 48 of file map_ref_impl.h.

Member Data Documentation

◆ allocator_

template<typename Allocator = standard_allocator>
details::allocator_wrapper<Allocator>* msgpack_light::mutable_map_ref< Allocator >::allocator_
private

Allocator.

Definition at line 228 of file map_ref.h.

◆ data_

template<typename Allocator = standard_allocator>
details::map_data* msgpack_light::mutable_map_ref< Allocator >::data_
private

Data.

Definition at line 225 of file map_ref.h.


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