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

Class to access constant arrays. More...

#include <msgpack_light/details/array_ref.h>

Collaboration diagram for msgpack_light::const_array_ref:

Public Types

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

Public Member Functions

 const_array_ref (const details::array_data &data)
 Constructor.
const_array_iterator begin () const noexcept
 Get an iterator to the first element.
const_array_iterator cbegin () const noexcept
 Get an iterator to the first element.
const_array_iterator cend () const noexcept
 Get an iterator to the past-the-end element.
const_array_iterator end () const noexcept
 Get an iterator to the past-the-end element.
const_object_ref_type operator[] (std::size_t index) const noexcept
 Get an object.
std::size_t size () const noexcept
 Get the size.

Private Attributes

const details::array_datadata_
 Data.

Detailed Description

Class to access constant arrays.

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

Member Typedef Documentation

◆ const_iterator

Type of iterators.

Definition at line 54 of file array_ref.h.

◆ const_object_ref_type

Type to access constant objects.

Definition at line 48 of file array_ref.h.

◆ iterator

Type of iterators.

Definition at line 51 of file array_ref.h.

Constructor & Destructor Documentation

◆ const_array_ref()

msgpack_light::const_array_ref::const_array_ref ( const details::array_data & data)
inlineexplicit

Constructor.

Parameters
[in]dataData.

Definition at line 61 of file array_ref.h.

Member Function Documentation

◆ begin()

const_array_iterator msgpack_light::const_array_ref::begin ( ) const
inlinenodiscardnoexcept

Get an iterator to the first element.

Returns
Iterator.

Definition at line 84 of file array_ref.h.

◆ cbegin()

const_array_iterator msgpack_light::const_array_ref::cbegin ( ) const
inlinenodiscardnoexcept

Get an iterator to the first element.

Returns
Iterator.

Definition at line 102 of file array_ref.h.

◆ cend()

const_array_iterator msgpack_light::const_array_ref::cend ( ) const
inlinenodiscardnoexcept

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

Returns
Iterator.

Definition at line 111 of file array_ref.h.

◆ end()

const_array_iterator msgpack_light::const_array_ref::end ( ) const
inlinenodiscardnoexcept

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

Returns
Iterator.

Definition at line 93 of file array_ref.h.

◆ operator[]()

const_array_ref::const_object_ref_type msgpack_light::const_array_ref::operator[] ( std::size_t index) const
inlinenodiscardnoexcept

Get an object.

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

Definition at line 51 of file array_ref_impl.h.

◆ size()

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

Get the size.

Returns
Size.

Definition at line 68 of file array_ref.h.

Member Data Documentation

◆ data_

const details::array_data* msgpack_light::const_array_ref::data_
private

Data.

Definition at line 117 of file array_ref.h.


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