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

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

#include <msgpack_light/details/array_ref.h>

Collaboration diagram for msgpack_light::mutable_array_ref< Allocator >:

Public Types

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

Public Member Functions

 mutable_array_ref (details::array_data &data, details::allocator_wrapper< Allocator > &allocator)
 Constructor.
const_array_iterator begin () const noexcept
 Get an iterator to the first element.
mutable_array_iterator< Allocator > begin () noexcept
 Get an iterator to the first element.
const_array_iterator end () const noexcept
 Get an iterator to the past-the-end element.
mutable_array_iterator< Allocator > end () noexcept
 Get an iterator to the past-the-end element.
const_object_ref_type operator[] (std::size_t index) const noexcept
 Get an object.
mutable_object_ref_type operator[] (std::size_t index) noexcept
 Get an object.
void resize (std::size_t size)
 Change the size.
std::size_t size () const noexcept
 Get the size.

Private Attributes

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

Detailed Description

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

Class to access non-constant arrays.

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 133 of file array_ref.h.

Member Typedef Documentation

◆ allocator_type

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

Type of the allocator.

Definition at line 136 of file array_ref.h.

◆ const_iterator

template<typename Allocator = standard_allocator>
using msgpack_light::mutable_array_ref< Allocator >::const_iterator = const_array_iterator

Type of iterators.

Definition at line 148 of file array_ref.h.

◆ const_object_ref_type

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

Type to access constant objects.

Definition at line 142 of file array_ref.h.

◆ iterator

template<typename Allocator = standard_allocator>
using msgpack_light::mutable_array_ref< Allocator >::iterator = mutable_array_iterator<Allocator>

Type of iterators.

Definition at line 145 of file array_ref.h.

◆ mutable_object_ref_type

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

Type to access non-constant objects.

Definition at line 139 of file array_ref.h.

Constructor & Destructor Documentation

◆ mutable_array_ref()

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

Constructor.

Parameters
[in]dataData.
[in]allocatorAllocator.

Definition at line 156 of file array_ref.h.

Member Function Documentation

◆ begin() [1/2]

template<typename Allocator = standard_allocator>
const_array_iterator msgpack_light::mutable_array_ref< Allocator >::begin ( ) const
inlinenodiscardnoexcept

Get an iterator to the first element.

Returns
Iterator.

Definition at line 232 of file array_ref.h.

◆ begin() [2/2]

template<typename Allocator = standard_allocator>
mutable_array_iterator< Allocator > msgpack_light::mutable_array_ref< Allocator >::begin ( )
inlinenodiscardnoexcept

Get an iterator to the first element.

Returns
Iterator.

Definition at line 213 of file array_ref.h.

◆ end() [1/2]

template<typename Allocator = standard_allocator>
const_array_iterator msgpack_light::mutable_array_ref< Allocator >::end ( ) const
inlinenodiscardnoexcept

Get an iterator to the past-the-end element.

Returns
Iterator.

Definition at line 241 of file array_ref.h.

◆ end() [2/2]

template<typename Allocator = standard_allocator>
mutable_array_iterator< Allocator > msgpack_light::mutable_array_ref< Allocator >::end ( )
inlinenodiscardnoexcept

Get an iterator to the past-the-end element.

Returns
Iterator.

Definition at line 222 of file array_ref.h.

◆ operator[]() [1/2]

template<typename Allocator>
mutable_array_ref< Allocator >::const_object_ref_type msgpack_light::mutable_array_ref< Allocator >::operator[] ( std::size_t index) const
inlinenodiscardnoexcept

Get an object.

Parameters
[in]indexIndex of the object.
Returns
Object.

Definition at line 42 of file array_ref_impl.h.

◆ operator[]() [2/2]

template<typename Allocator>
mutable_array_ref< Allocator >::mutable_object_ref_type msgpack_light::mutable_array_ref< Allocator >::operator[] ( std::size_t index)
inlinenodiscardnoexcept

Get an object.

Parameters
[in]indexIndex of the object.
Returns
Object.

Definition at line 36 of file array_ref_impl.h.

◆ resize()

template<typename Allocator = standard_allocator>
void msgpack_light::mutable_array_ref< Allocator >::resize ( std::size_t size)
inline

Change the size.

Parameters
[in]sizeSize.

Definition at line 165 of file array_ref.h.

◆ size()

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

Get the size.

Returns
Size.

Definition at line 188 of file array_ref.h.

Member Data Documentation

◆ allocator_

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

Allocator.

Definition at line 250 of file array_ref.h.

◆ data_

template<typename Allocator = standard_allocator>
details::array_data* msgpack_light::mutable_array_ref< Allocator >::data_
private

Data.

Definition at line 247 of file array_ref.h.


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