cpp-msgpack-light
0.3.0
A light library to serialize MessagePack.
Toggle main menu visibility
Loading...
Searching...
No Matches
array_iterator_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 "
msgpack_light/details/array_iterator.h
"
23
#include "
msgpack_light/details/object_ref.h
"
// IWYU pragma: keep
24
25
namespace
msgpack_light
{
26
27
/*
28
* Definition of some members of mutable_array_iterator.
29
*/
30
31
template
<
typename
Allocator>
32
inline
mutable_object_ref<Allocator>
33
mutable_array_iterator<Allocator>::operator*
() const noexcept {
34
return
mutable_object_ref<Allocator>
(*
pointer_
, *
allocator_
);
35
}
36
46
template
<
typename
Allocator>
47
[[nodiscard]]
inline
bool
operator==
(
mutable_array_iterator<Allocator>
lhs,
48
mutable_array_iterator<Allocator>
rhs)
noexcept
{
49
return
&(*lhs).data() == &(*rhs).data();
50
}
51
61
template
<
typename
Allocator>
62
[[nodiscard]]
inline
bool
operator!=
(
mutable_array_iterator<Allocator>
lhs,
63
mutable_array_iterator<Allocator>
rhs)
noexcept
{
64
return
!(lhs == rhs);
65
}
66
67
/*
68
* Definition of some members of const_array_iterator.
69
*/
70
71
inline
const_object_ref
const_array_iterator::operator*
() const noexcept {
72
return
const_object_ref
(*
pointer_
);
73
}
74
83
[[nodiscard]]
inline
bool
operator==
(
84
const_array_iterator
lhs,
const_array_iterator
rhs)
noexcept
{
85
return
&(*lhs).data() == &(*rhs).data();
86
}
87
96
[[nodiscard]]
inline
bool
operator!=
(
97
const_array_iterator
lhs,
const_array_iterator
rhs)
noexcept
{
98
return
!(lhs == rhs);
99
}
100
101
}
// namespace msgpack_light
array_iterator.h
Definition of classes of iterators of arrays.
msgpack_light::const_array_iterator
Class of iterators of arrays to access constant objects.
Definition
array_iterator.h:118
msgpack_light::const_array_iterator::pointer_
const details::object_data * pointer_
Pointer to the current data.
Definition
array_iterator.h:173
msgpack_light::const_array_iterator::operator*
const_object_ref operator*() const noexcept
Dereference this iterator.
Definition
array_iterator_impl.h:71
msgpack_light::const_object_ref
Class to access constant objects.
Definition
object_ref.h:129
msgpack_light::const_object_ref::const_object_ref
const_object_ref(const details::object_data &data)
Constructor.
Definition
object_ref.h:144
msgpack_light::mutable_array_iterator
Class of iterators of arrays to access non-constant objects.
Definition
array_iterator.h:44
msgpack_light::mutable_array_iterator::operator*
mutable_object_ref< Allocator > operator*() const noexcept
Dereference this iterator.
Definition
array_iterator_impl.h:33
msgpack_light::mutable_array_iterator::allocator_
details::allocator_wrapper< Allocator > * allocator_
Allocator.
Definition
array_iterator.h:105
msgpack_light::mutable_array_iterator::pointer_
details::object_data * pointer_
Pointer to the current data.
Definition
array_iterator.h:102
msgpack_light::mutable_object_ref
Class to access non-constant objects.
Definition
object_ref.h:48
msgpack_light::mutable_object_ref::mutable_object_ref
mutable_object_ref(details::object_data &data, details::allocator_wrapper< Allocator > &allocator)
Constructor.
Definition
object_ref.h:67
msgpack_light
Namespace of this project.
Definition
binary.h:33
msgpack_light::operator==
bool operator==(binary_view lhs, binary_view rhs)
Compare two binary data.
Definition
binary.h:384
msgpack_light::operator!=
bool operator!=(binary_view lhs, binary_view rhs)
Compare two binary data.
Definition
binary.h:397
object_ref.h
Definition of classes of references to objects.
include
msgpack_light
details
array_iterator_impl.h
Generated on
for cpp-msgpack-light by
1.18.0