cpp-msgpack-light
0.3.0
A light library to serialize MessagePack.
Toggle main menu visibility
Loading...
Searching...
No Matches
array_ref_impl.h
Go to the documentation of this file.
1
/*
2
* Copyright 2024 MusicScience37 (Kenta Kabashima)
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
20
#pragma once
21
22
#include <cstring>
23
24
#include "
msgpack_light/details/array_ref.h
"
25
#include "
msgpack_light/details/object_data.h
"
26
#include "
msgpack_light/details/object_ref.h
"
// IWYU pragma: keep
27
28
namespace
msgpack_light
{
29
30
/*
31
* Definition of some members of mutable_array_ref.
32
*/
33
34
template
<
typename
Allocator>
35
inline
typename
mutable_array_ref<Allocator>::mutable_object_ref_type
36
mutable_array_ref<Allocator>::operator[]
(std::size_t index)
noexcept
{
37
return
mutable_object_ref_type
(
data_
->data[index], *
allocator_
);
38
}
39
40
template
<
typename
Allocator>
41
inline
typename
mutable_array_ref<Allocator>::const_object_ref_type
42
mutable_array_ref<Allocator>::operator[]
(std::size_t index)
const
noexcept
{
43
return
const_object_ref_type
{
data_
->data[index]};
44
}
45
46
/*
47
* Definition of some members of const_array_ref.
48
*/
49
50
inline
typename
const_array_ref::const_object_ref_type
51
const_array_ref::operator[]
(std::size_t index)
const
noexcept
{
52
return
const_object_ref_type
{
data_
->data[index]};
53
}
54
55
}
// namespace msgpack_light
array_ref.h
Definition of classes of references to arrays.
msgpack_light::const_array_ref::const_object_ref_type
const_object_ref const_object_ref_type
Type to access constant objects.
Definition
array_ref.h:48
msgpack_light::const_array_ref::data_
const details::array_data * data_
Data.
Definition
array_ref.h:117
msgpack_light::const_array_ref::operator[]
const_object_ref_type operator[](std::size_t index) const noexcept
Get an object.
Definition
array_ref_impl.h:51
msgpack_light::mutable_array_ref::data_
details::array_data * data_
Data.
Definition
array_ref.h:247
msgpack_light::mutable_array_ref::operator[]
mutable_object_ref_type operator[](std::size_t index) noexcept
Get an object.
Definition
array_ref_impl.h:36
msgpack_light::mutable_array_ref::allocator_
details::allocator_wrapper< Allocator > * allocator_
Allocator.
Definition
array_ref.h:250
msgpack_light::mutable_array_ref::const_object_ref_type
const_object_ref const_object_ref_type
Type to access constant objects.
Definition
array_ref.h:142
msgpack_light::mutable_array_ref::mutable_object_ref_type
mutable_object_ref< Allocator > mutable_object_ref_type
Type to access non-constant objects.
Definition
array_ref.h:139
msgpack_light
Namespace of this project.
Definition
binary.h:33
object_data.h
Definition of object_data struct.
object_ref.h
Definition of classes of references to objects.
include
msgpack_light
details
array_ref_impl.h
Generated on
for cpp-msgpack-light by
1.18.0