/Users/deen/code/yugabyte-db/src/yb/util/memory/arena_list.h
Line | Count | Source (jump to first uncovered line) |
1 | | // Copyright (c) YugaByte, Inc. |
2 | | // |
3 | | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
4 | | // in compliance with the License. You may obtain a copy of the License at |
5 | | // |
6 | | // http://www.apache.org/licenses/LICENSE-2.0 |
7 | | // |
8 | | // Unless required by applicable law or agreed to in writing, software distributed under the License |
9 | | // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
10 | | // or implied. See the License for the specific language governing permissions and limitations |
11 | | // under the License. |
12 | | // |
13 | | |
14 | | #ifndef YB_UTIL_MEMORY_ARENA_LIST_H |
15 | | #define YB_UTIL_MEMORY_ARENA_LIST_H |
16 | | |
17 | | #include <boost/intrusive/list.hpp> |
18 | | #include <boost/iterator/transform_iterator.hpp> |
19 | | |
20 | | #include "yb/util/memory/arena.h" |
21 | | |
22 | | namespace yb { |
23 | | |
24 | | template <class Entry> |
25 | | struct ArenaListNode : public boost::intrusive::list_base_hook<> { |
26 | | Entry* value_ptr = nullptr; |
27 | | }; |
28 | | |
29 | | template <class Entry> |
30 | | struct ArenaListNodeWithValue : ArenaListNode<Entry> { |
31 | | template<class... Args> |
32 | 76 | explicit ArenaListNodeWithValue(Args&&... args) : value(std::forward<Args>(args)...) { |
33 | 76 | this->value_ptr = &value; |
34 | 76 | } yb::ArenaListNodeWithValue<yb::rpc_test::LWLightweightSubMessagePB>::ArenaListNodeWithValue<yb::internal::ArenaBase<yb::internal::ArenaTraits>*, yb::rpc_test::LWLightweightSubMessagePB&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*&&, yb::rpc_test::LWLightweightSubMessagePB&) Line | Count | Source | 32 | 5 | explicit ArenaListNodeWithValue(Args&&... args) : value(std::forward<Args>(args)...) { | 33 | 5 | this->value_ptr = &value; | 34 | 5 | } |
yb::ArenaListNodeWithValue<yb::rpc_test::LWLightweightPairPB>::ArenaListNodeWithValue<yb::internal::ArenaBase<yb::internal::ArenaTraits>*>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*&&) Line | Count | Source | 32 | 26 | explicit ArenaListNodeWithValue(Args&&... args) : value(std::forward<Args>(args)...) { | 33 | 26 | this->value_ptr = &value; | 34 | 26 | } |
yb::ArenaListNodeWithValue<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>::ArenaListNodeWithValue<yb::internal::ArenaBase<yb::internal::ArenaTraits>*>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*&&) Line | Count | Source | 32 | 11 | explicit ArenaListNodeWithValue(Args&&... args) : value(std::forward<Args>(args)...) { | 33 | 11 | this->value_ptr = &value; | 34 | 11 | } |
yb::ArenaListNodeWithValue<yb::rpc_test::LWLightweightSubMessagePB>::ArenaListNodeWithValue<yb::internal::ArenaBase<yb::internal::ArenaTraits>*>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*&&) Line | Count | Source | 32 | 5 | explicit ArenaListNodeWithValue(Args&&... args) : value(std::forward<Args>(args)...) { | 33 | 5 | this->value_ptr = &value; | 34 | 5 | } |
yb::ArenaListNodeWithValue<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>::ArenaListNodeWithValue<yb::internal::ArenaBase<yb::internal::ArenaTraits>*>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*&&) Line | Count | Source | 32 | 11 | explicit ArenaListNodeWithValue(Args&&... args) : value(std::forward<Args>(args)...) { | 33 | 11 | this->value_ptr = &value; | 34 | 11 | } |
Unexecuted instantiation: yb::ArenaListNodeWithValue<yb::rpc_test::LWLightweightSubMessagePB>::ArenaListNodeWithValue<yb::internal::ArenaBase<yb::internal::ArenaTraits>*, yb::rpc_test::LWLightweightSubMessagePB const&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*&&, yb::rpc_test::LWLightweightSubMessagePB const&) Unexecuted instantiation: yb::ArenaListNodeWithValue<yb::rpc_test::LWLightweightPairPB>::ArenaListNodeWithValue<yb::internal::ArenaBase<yb::internal::ArenaTraits>*, yb::rpc_test::LWLightweightPairPB const&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*&&, yb::rpc_test::LWLightweightPairPB const&) Unexecuted instantiation: yb::ArenaListNodeWithValue<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>::ArenaListNodeWithValue<yb::internal::ArenaBase<yb::internal::ArenaTraits>*, yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse const&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*&&, yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse const&) yb::ArenaListNodeWithValue<yb::rpc_test::LWLightweightSubMessagePB>::ArenaListNodeWithValue<yb::internal::ArenaBase<yb::internal::ArenaTraits>*, yb::rpc_test::LightweightSubMessagePB const&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*&&, yb::rpc_test::LightweightSubMessagePB const&) Line | Count | Source | 32 | 5 | explicit ArenaListNodeWithValue(Args&&... args) : value(std::forward<Args>(args)...) { | 33 | 5 | this->value_ptr = &value; | 34 | 5 | } |
yb::ArenaListNodeWithValue<yb::rpc_test::LWLightweightPairPB>::ArenaListNodeWithValue<yb::internal::ArenaBase<yb::internal::ArenaTraits>*, yb::rpc_test::LightweightPairPB const&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*&&, yb::rpc_test::LightweightPairPB const&) Line | Count | Source | 32 | 13 | explicit ArenaListNodeWithValue(Args&&... args) : value(std::forward<Args>(args)...) { | 33 | 13 | this->value_ptr = &value; | 34 | 13 | } |
Unexecuted instantiation: yb::ArenaListNodeWithValue<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>::ArenaListNodeWithValue<yb::internal::ArenaBase<yb::internal::ArenaTraits>*, google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long long> const&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*&&, google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long long> const&) Unexecuted instantiation: yb::ArenaListNodeWithValue<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>::ArenaListNodeWithValue<yb::internal::ArenaBase<yb::internal::ArenaTraits>*, yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse const&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*&&, yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse const&) Unexecuted instantiation: yb::ArenaListNodeWithValue<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>::ArenaListNodeWithValue<yb::internal::ArenaBase<yb::internal::ArenaTraits>*, google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long long> const&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*&&, google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long long> const&) |
35 | | |
36 | | Entry value; |
37 | | }; |
38 | | |
39 | | template <class Entry> |
40 | | struct ExtractArenaListValue { |
41 | | using type = Entry&; |
42 | | |
43 | | template<class E> |
44 | 282 | type operator()(const ArenaListNode<E>& node) const { |
45 | 282 | return *node.value_ptr; |
46 | 282 | } yb::rpc_test::LWLightweightSubMessagePB& yb::ExtractArenaListValue<yb::rpc_test::LWLightweightSubMessagePB>::operator()<yb::rpc_test::LWLightweightSubMessagePB>(yb::ArenaListNode<yb::rpc_test::LWLightweightSubMessagePB> const&) const Line | Count | Source | 44 | 5 | type operator()(const ArenaListNode<E>& node) const { | 45 | 5 | return *node.value_ptr; | 46 | 5 | } |
yb::rpc_test::LWLightweightSubMessagePB const& yb::ExtractArenaListValue<yb::rpc_test::LWLightweightSubMessagePB const>::operator()<yb::rpc_test::LWLightweightSubMessagePB>(yb::ArenaListNode<yb::rpc_test::LWLightweightSubMessagePB> const&) const Line | Count | Source | 44 | 90 | type operator()(const ArenaListNode<E>& node) const { | 45 | 90 | return *node.value_ptr; | 46 | 90 | } |
yb::rpc_test::LWLightweightPairPB const& yb::ExtractArenaListValue<yb::rpc_test::LWLightweightPairPB const>::operator()<yb::rpc_test::LWLightweightPairPB>(yb::ArenaListNode<yb::rpc_test::LWLightweightPairPB> const&) const Line | Count | Source | 44 | 143 | type operator()(const ArenaListNode<E>& node) const { | 45 | 143 | return *node.value_ptr; | 46 | 143 | } |
yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse const& yb::ExtractArenaListValue<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse const>::operator()<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>(yb::ArenaListNode<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse> const&) const Line | Count | Source | 44 | 11 | type operator()(const ArenaListNode<E>& node) const { | 45 | 11 | return *node.value_ptr; | 46 | 11 | } |
yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse const& yb::ExtractArenaListValue<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse const>::operator()<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>(yb::ArenaListNode<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse> const&) const Line | Count | Source | 44 | 33 | type operator()(const ArenaListNode<E>& node) const { | 45 | 33 | return *node.value_ptr; | 46 | 33 | } |
|
47 | | }; |
48 | | |
49 | | template <class Entry> |
50 | | class ArenaList { |
51 | | public: |
52 | | using List = boost::intrusive::list<ArenaListNode<Entry>>; |
53 | | using Extractor = ExtractArenaListValue<Entry>; |
54 | | using ConstExtractor = ExtractArenaListValue<const Entry>; |
55 | | using iterator = boost::transform_iterator<Extractor, typename List::iterator>; |
56 | | using const_iterator = boost::transform_iterator<ConstExtractor, typename List::const_iterator>; |
57 | | using reverse_iterator = boost::transform_iterator<Extractor, typename List::reverse_iterator>; |
58 | | using const_reverse_iterator = boost::transform_iterator< |
59 | | ConstExtractor, typename List::const_reverse_iterator>; |
60 | | using value_type = Entry; |
61 | | |
62 | 10 | explicit ArenaList(Arena* arena) : arena_(*arena) {} yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB>::ArenaList(yb::internal::ArenaBase<yb::internal::ArenaTraits>*) Line | Count | Source | 62 | 4 | explicit ArenaList(Arena* arena) : arena_(*arena) {} |
yb::ArenaList<yb::rpc_test::LWLightweightPairPB>::ArenaList(yb::internal::ArenaBase<yb::internal::ArenaTraits>*) Line | Count | Source | 62 | 3 | explicit ArenaList(Arena* arena) : arena_(*arena) {} |
yb::ArenaList<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>::ArenaList(yb::internal::ArenaBase<yb::internal::ArenaTraits>*) Line | Count | Source | 62 | 2 | explicit ArenaList(Arena* arena) : arena_(*arena) {} |
yb::ArenaList<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>::ArenaList(yb::internal::ArenaBase<yb::internal::ArenaTraits>*) Line | Count | Source | 62 | 1 | explicit ArenaList(Arena* arena) : arena_(*arena) {} |
|
63 | | |
64 | 0 | ArenaList(Arena* arena, const ArenaList<Entry>& rhs) : arena_(*arena) { |
65 | 0 | for (const auto& entry : rhs) { |
66 | 0 | emplace_back(entry); |
67 | 0 | } |
68 | 0 | } Unexecuted instantiation: yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB>::ArenaList(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB> const&) Unexecuted instantiation: yb::ArenaList<yb::rpc_test::LWLightweightPairPB>::ArenaList(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, yb::ArenaList<yb::rpc_test::LWLightweightPairPB> const&) Unexecuted instantiation: yb::ArenaList<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>::ArenaList(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, yb::ArenaList<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse> const&) Unexecuted instantiation: yb::ArenaList<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>::ArenaList(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, yb::ArenaList<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse> const&) |
69 | | |
70 | 0 | void operator=(const ArenaList<Entry>& rhs) { |
71 | 0 | clear(); |
72 | 0 | for (const auto& entry : rhs) { |
73 | 0 | emplace_back(entry); |
74 | 0 | } |
75 | 0 | } Unexecuted instantiation: yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB>::operator=(yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB> const&) Unexecuted instantiation: yb::ArenaList<yb::rpc_test::LWLightweightPairPB>::operator=(yb::ArenaList<yb::rpc_test::LWLightweightPairPB> const&) Unexecuted instantiation: yb::ArenaList<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>::operator=(yb::ArenaList<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse> const&) Unexecuted instantiation: yb::ArenaList<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>::operator=(yb::ArenaList<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse> const&) |
76 | | |
77 | | template <class... Args> |
78 | 76 | Entry& emplace_back(Args&&... args) { |
79 | 76 | auto node = arena_.NewObject<ArenaListNodeWithValue<Entry>>( |
80 | 76 | &arena_, std::forward<Args>(args)...); |
81 | 76 | list_.push_back(*node); |
82 | 76 | return *node->value_ptr; |
83 | 76 | } yb::rpc_test::LWLightweightSubMessagePB& yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB>::emplace_back<yb::rpc_test::LWLightweightSubMessagePB&>(yb::rpc_test::LWLightweightSubMessagePB&) Line | Count | Source | 78 | 5 | Entry& emplace_back(Args&&... args) { | 79 | 5 | auto node = arena_.NewObject<ArenaListNodeWithValue<Entry>>( | 80 | 5 | &arena_, std::forward<Args>(args)...); | 81 | 5 | list_.push_back(*node); | 82 | 5 | return *node->value_ptr; | 83 | 5 | } |
yb::rpc_test::LWLightweightPairPB& yb::ArenaList<yb::rpc_test::LWLightweightPairPB>::emplace_back<>() Line | Count | Source | 78 | 26 | Entry& emplace_back(Args&&... args) { | 79 | 26 | auto node = arena_.NewObject<ArenaListNodeWithValue<Entry>>( | 80 | 26 | &arena_, std::forward<Args>(args)...); | 81 | 26 | list_.push_back(*node); | 82 | 26 | return *node->value_ptr; | 83 | 26 | } |
yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse& yb::ArenaList<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>::emplace_back<>() Line | Count | Source | 78 | 11 | Entry& emplace_back(Args&&... args) { | 79 | 11 | auto node = arena_.NewObject<ArenaListNodeWithValue<Entry>>( | 80 | 11 | &arena_, std::forward<Args>(args)...); | 81 | 11 | list_.push_back(*node); | 82 | 11 | return *node->value_ptr; | 83 | 11 | } |
yb::rpc_test::LWLightweightSubMessagePB& yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB>::emplace_back<>() Line | Count | Source | 78 | 5 | Entry& emplace_back(Args&&... args) { | 79 | 5 | auto node = arena_.NewObject<ArenaListNodeWithValue<Entry>>( | 80 | 5 | &arena_, std::forward<Args>(args)...); | 81 | 5 | list_.push_back(*node); | 82 | 5 | return *node->value_ptr; | 83 | 5 | } |
yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse& yb::ArenaList<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>::emplace_back<>() Line | Count | Source | 78 | 11 | Entry& emplace_back(Args&&... args) { | 79 | 11 | auto node = arena_.NewObject<ArenaListNodeWithValue<Entry>>( | 80 | 11 | &arena_, std::forward<Args>(args)...); | 81 | 11 | list_.push_back(*node); | 82 | 11 | return *node->value_ptr; | 83 | 11 | } |
Unexecuted instantiation: yb::rpc_test::LWLightweightSubMessagePB& yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB>::emplace_back<yb::rpc_test::LWLightweightSubMessagePB const&>(yb::rpc_test::LWLightweightSubMessagePB const&) Unexecuted instantiation: yb::rpc_test::LWLightweightPairPB& yb::ArenaList<yb::rpc_test::LWLightweightPairPB>::emplace_back<yb::rpc_test::LWLightweightPairPB const&>(yb::rpc_test::LWLightweightPairPB const&) Unexecuted instantiation: yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse& yb::ArenaList<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>::emplace_back<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse const&>(yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse const&) yb::rpc_test::LWLightweightSubMessagePB& yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB>::emplace_back<yb::rpc_test::LightweightSubMessagePB const&>(yb::rpc_test::LightweightSubMessagePB const&) Line | Count | Source | 78 | 5 | Entry& emplace_back(Args&&... args) { | 79 | 5 | auto node = arena_.NewObject<ArenaListNodeWithValue<Entry>>( | 80 | 5 | &arena_, std::forward<Args>(args)...); | 81 | 5 | list_.push_back(*node); | 82 | 5 | return *node->value_ptr; | 83 | 5 | } |
yb::rpc_test::LWLightweightPairPB& yb::ArenaList<yb::rpc_test::LWLightweightPairPB>::emplace_back<yb::rpc_test::LightweightPairPB const&>(yb::rpc_test::LightweightPairPB const&) Line | Count | Source | 78 | 13 | Entry& emplace_back(Args&&... args) { | 79 | 13 | auto node = arena_.NewObject<ArenaListNodeWithValue<Entry>>( | 80 | 13 | &arena_, std::forward<Args>(args)...); | 81 | 13 | list_.push_back(*node); | 82 | 13 | return *node->value_ptr; | 83 | 13 | } |
Unexecuted instantiation: yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse& yb::ArenaList<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>::emplace_back<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long long> const&>(google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long long> const&) Unexecuted instantiation: yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse& yb::ArenaList<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>::emplace_back<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse const&>(yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse const&) Unexecuted instantiation: yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse& yb::ArenaList<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>::emplace_back<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long long> const&>(google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long long> const&) |
84 | | |
85 | 5 | Entry& push_back_ref(Entry* entry) { |
86 | 5 | auto node = arena_.NewObject<ArenaListNode<Entry>>(); |
87 | 5 | node->value_ptr = entry; |
88 | 5 | list_.push_back(*node); |
89 | 5 | return *entry; |
90 | 5 | } |
91 | | |
92 | | Entry& front() { |
93 | | return *list_.front().value_ptr; |
94 | | } |
95 | | |
96 | | const Entry& front() const { |
97 | | return *list_.front().value_ptr; |
98 | | } |
99 | | |
100 | | Entry& back() { |
101 | | return *list_.back().value_ptr; |
102 | | } |
103 | | |
104 | | const Entry& back() const { |
105 | | return *list_.back().value_ptr; |
106 | | } |
107 | | |
108 | 4 | void clear() { |
109 | 4 | list_.clear(); |
110 | 4 | } yb::ArenaList<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>::clear() Line | Count | Source | 108 | 2 | void clear() { | 109 | 2 | list_.clear(); | 110 | 2 | } |
yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB>::clear() Line | Count | Source | 108 | 1 | void clear() { | 109 | 1 | list_.clear(); | 110 | 1 | } |
yb::ArenaList<yb::rpc_test::LWLightweightPairPB>::clear() Line | Count | Source | 108 | 1 | void clear() { | 109 | 1 | list_.clear(); | 110 | 1 | } |
Unexecuted instantiation: yb::ArenaList<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>::clear() |
111 | | |
112 | | iterator erase(iterator it) { |
113 | | return iterator(list_.erase(it.base())); |
114 | | } |
115 | | |
116 | | bool empty() const { |
117 | | return list_.empty(); |
118 | | } |
119 | | |
120 | 8 | size_t size() const { |
121 | 8 | return list_.size(); |
122 | 8 | } yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB>::size() const Line | Count | Source | 120 | 4 | size_t size() const { | 121 | 4 | return list_.size(); | 122 | 4 | } |
yb::ArenaList<yb::rpc_test::LWLightweightPairPB>::size() const Line | Count | Source | 120 | 2 | size_t size() const { | 121 | 2 | return list_.size(); | 122 | 2 | } |
Unexecuted instantiation: yb::ArenaList<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>::size() const yb::ArenaList<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>::size() const Line | Count | Source | 120 | 2 | size_t size() const { | 121 | 2 | return list_.size(); | 122 | 2 | } |
|
123 | | |
124 | | const_iterator cbegin() const { |
125 | | return const_iterator(list_.cbegin()); |
126 | | } |
127 | | |
128 | | const_iterator cend() const { |
129 | | return const_iterator(list_.cend()); |
130 | | } |
131 | | |
132 | 40 | const_iterator begin() const { |
133 | 40 | return const_iterator(list_.begin()); |
134 | 40 | } yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB>::begin() const Line | Count | Source | 132 | 18 | const_iterator begin() const { | 133 | 18 | return const_iterator(list_.begin()); | 134 | 18 | } |
yb::ArenaList<yb::rpc_test::LWLightweightPairPB>::begin() const Line | Count | Source | 132 | 11 | const_iterator begin() const { | 133 | 11 | return const_iterator(list_.begin()); | 134 | 11 | } |
yb::ArenaList<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>::begin() const Line | Count | Source | 132 | 4 | const_iterator begin() const { | 133 | 4 | return const_iterator(list_.begin()); | 134 | 4 | } |
yb::ArenaList<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>::begin() const Line | Count | Source | 132 | 7 | const_iterator begin() const { | 133 | 7 | return const_iterator(list_.begin()); | 134 | 7 | } |
|
135 | | |
136 | 40 | const_iterator end() const { |
137 | 40 | return const_iterator(list_.end()); |
138 | 40 | } yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB>::end() const Line | Count | Source | 136 | 18 | const_iterator end() const { | 137 | 18 | return const_iterator(list_.end()); | 138 | 18 | } |
yb::ArenaList<yb::rpc_test::LWLightweightPairPB>::end() const Line | Count | Source | 136 | 11 | const_iterator end() const { | 137 | 11 | return const_iterator(list_.end()); | 138 | 11 | } |
yb::ArenaList<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>::end() const Line | Count | Source | 136 | 4 | const_iterator end() const { | 137 | 4 | return const_iterator(list_.end()); | 138 | 4 | } |
yb::ArenaList<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>::end() const Line | Count | Source | 136 | 7 | const_iterator end() const { | 137 | 7 | return const_iterator(list_.end()); | 138 | 7 | } |
|
139 | | |
140 | | iterator begin() { |
141 | | return iterator(list_.begin()); |
142 | | } |
143 | | |
144 | | iterator end() { |
145 | | return iterator(list_.end()); |
146 | | } |
147 | | |
148 | | const_reverse_iterator crbegin() const { |
149 | | return const_reverse_iterator(list_.crbegin()); |
150 | | } |
151 | | |
152 | | const_reverse_iterator crrend() const { |
153 | | return const_reverse_iterator(list_.crend()); |
154 | | } |
155 | | |
156 | | const_reverse_iterator rbegin() const { |
157 | | return const_reverse_iterator(list_.rbegin()); |
158 | | } |
159 | | |
160 | | const_reverse_iterator rend() const { |
161 | | return const_reverse_iterator(list_.rend()); |
162 | | } |
163 | | |
164 | 1 | reverse_iterator rbegin() { |
165 | 1 | return reverse_iterator(list_.rbegin()); |
166 | 1 | } |
167 | | |
168 | 6 | reverse_iterator rend() { |
169 | 6 | return reverse_iterator(list_.rend()); |
170 | 6 | } |
171 | | |
172 | | template <class PB> |
173 | 6 | void ToGoogleProtobuf(PB* out) const { |
174 | 6 | out->Clear(); |
175 | 6 | out->Reserve(narrow_cast<int>(list_.size())); |
176 | 46 | for (const auto& entry : *this) { |
177 | 46 | entry.ToGoogleProtobuf(out->Add()); |
178 | 46 | } |
179 | 6 | } void yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB>::ToGoogleProtobuf<google::protobuf::RepeatedPtrField<yb::rpc_test::LightweightSubMessagePB> >(google::protobuf::RepeatedPtrField<yb::rpc_test::LightweightSubMessagePB>*) const Line | Count | Source | 173 | 4 | void ToGoogleProtobuf(PB* out) const { | 174 | 4 | out->Clear(); | 175 | 4 | out->Reserve(narrow_cast<int>(list_.size())); | 176 | 20 | for (const auto& entry : *this) { | 177 | 20 | entry.ToGoogleProtobuf(out->Add()); | 178 | 20 | } | 179 | 4 | } |
void yb::ArenaList<yb::rpc_test::LWLightweightPairPB>::ToGoogleProtobuf<google::protobuf::RepeatedPtrField<yb::rpc_test::LightweightPairPB> >(google::protobuf::RepeatedPtrField<yb::rpc_test::LightweightPairPB>*) const Line | Count | Source | 173 | 2 | void ToGoogleProtobuf(PB* out) const { | 174 | 2 | out->Clear(); | 175 | 2 | out->Reserve(narrow_cast<int>(list_.size())); | 176 | 26 | for (const auto& entry : *this) { | 177 | 26 | entry.ToGoogleProtobuf(out->Add()); | 178 | 26 | } | 179 | 2 | } |
|
180 | | |
181 | | template <class It> |
182 | 3 | void assign(It begin, const It& end) { |
183 | 3 | clear(); |
184 | 21 | for (; begin != end; ++begin18 ) { |
185 | 18 | emplace_back(*begin); |
186 | 18 | } |
187 | 3 | } void yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB>::assign<google::protobuf::internal::RepeatedPtrIterator<yb::rpc_test::LightweightSubMessagePB const> >(google::protobuf::internal::RepeatedPtrIterator<yb::rpc_test::LightweightSubMessagePB const>, google::protobuf::internal::RepeatedPtrIterator<yb::rpc_test::LightweightSubMessagePB const> const&) Line | Count | Source | 182 | 1 | void assign(It begin, const It& end) { | 183 | 1 | clear(); | 184 | 6 | for (; begin != end; ++begin5 ) { | 185 | 5 | emplace_back(*begin); | 186 | 5 | } | 187 | 1 | } |
void yb::ArenaList<yb::rpc_test::LWLightweightPairPB>::assign<google::protobuf::internal::RepeatedPtrIterator<yb::rpc_test::LightweightPairPB const> >(google::protobuf::internal::RepeatedPtrIterator<yb::rpc_test::LightweightPairPB const>, google::protobuf::internal::RepeatedPtrIterator<yb::rpc_test::LightweightPairPB const> const&) Line | Count | Source | 182 | 1 | void assign(It begin, const It& end) { | 183 | 1 | clear(); | 184 | 14 | for (; begin != end; ++begin13 ) { | 185 | 13 | emplace_back(*begin); | 186 | 13 | } | 187 | 1 | } |
void yb::ArenaList<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>::assign<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long long>::const_iterator>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long long>::const_iterator, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long long>::const_iterator const&) Line | Count | Source | 182 | 1 | void assign(It begin, const It& end) { | 183 | 1 | clear(); | 184 | 1 | for (; begin != end; ++begin0 ) { | 185 | 0 | emplace_back(*begin); | 186 | 0 | } | 187 | 1 | } |
Unexecuted instantiation: void yb::ArenaList<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>::assign<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long long>::const_iterator>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long long>::const_iterator, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long long>::const_iterator const&) |
188 | | |
189 | | template <class Collection> |
190 | | void assign(const Collection& collection) { |
191 | | assign(collection.begin(), collection.end()); |
192 | | } |
193 | | |
194 | | private: |
195 | | Arena& arena_; |
196 | | List list_; |
197 | | }; |
198 | | |
199 | | } // namespace yb |
200 | | |
201 | | #endif // YB_UTIL_MEMORY_ARENA_LIST_H |