/src/protobuf_install/include/google/protobuf/map.h
Line | Count | Source |
1 | | // Protocol Buffers - Google's data interchange format |
2 | | // Copyright 2008 Google Inc. All rights reserved. |
3 | | // https://developers.google.com/protocol-buffers/ |
4 | | // |
5 | | // Redistribution and use in source and binary forms, with or without |
6 | | // modification, are permitted provided that the following conditions are |
7 | | // met: |
8 | | // |
9 | | // * Redistributions of source code must retain the above copyright |
10 | | // notice, this list of conditions and the following disclaimer. |
11 | | // * Redistributions in binary form must reproduce the above |
12 | | // copyright notice, this list of conditions and the following disclaimer |
13 | | // in the documentation and/or other materials provided with the |
14 | | // distribution. |
15 | | // * Neither the name of Google Inc. nor the names of its |
16 | | // contributors may be used to endorse or promote products derived from |
17 | | // this software without specific prior written permission. |
18 | | // |
19 | | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
20 | | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
21 | | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
22 | | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
23 | | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
24 | | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
25 | | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
26 | | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 | | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 | | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 | | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 | | |
31 | | // This file defines the map container and its helpers to support protobuf maps. |
32 | | // |
33 | | // The Map and MapIterator types are provided by this header file. |
34 | | // Please avoid using other types defined here, unless they are public |
35 | | // types within Map or MapIterator, such as Map::value_type. |
36 | | |
37 | | #ifndef GOOGLE_PROTOBUF_MAP_H__ |
38 | | #define GOOGLE_PROTOBUF_MAP_H__ |
39 | | |
40 | | |
41 | | #include <functional> |
42 | | #include <initializer_list> |
43 | | #include <iterator> |
44 | | #include <limits> // To support Visual Studio 2008 |
45 | | #include <map> |
46 | | #include <string> |
47 | | #include <type_traits> |
48 | | #include <utility> |
49 | | |
50 | | #if defined(__cpp_lib_string_view) |
51 | | #include <string_view> |
52 | | #endif // defined(__cpp_lib_string_view) |
53 | | |
54 | | #if !defined(GOOGLE_PROTOBUF_NO_RDTSC) && defined(__APPLE__) |
55 | | #include <mach/mach_time.h> |
56 | | #endif |
57 | | |
58 | | #include <google/protobuf/stubs/common.h> |
59 | | #include <google/protobuf/arena.h> |
60 | | #include <google/protobuf/generated_enum_util.h> |
61 | | #include <google/protobuf/map_type_handler.h> |
62 | | #include <google/protobuf/port.h> |
63 | | #include <google/protobuf/stubs/hash.h> |
64 | | |
65 | | #ifdef SWIG |
66 | | #error "You cannot SWIG proto headers" |
67 | | #endif |
68 | | |
69 | | // Must be included last. |
70 | | #include <google/protobuf/port_def.inc> |
71 | | |
72 | | namespace google { |
73 | | namespace protobuf { |
74 | | |
75 | | template <typename Key, typename T> |
76 | | class Map; |
77 | | |
78 | | class MapIterator; |
79 | | |
80 | | template <typename Enum> |
81 | | struct is_proto_enum; |
82 | | |
83 | | namespace internal { |
84 | | template <typename Derived, typename Key, typename T, |
85 | | WireFormatLite::FieldType key_wire_type, |
86 | | WireFormatLite::FieldType value_wire_type> |
87 | | class MapFieldLite; |
88 | | |
89 | | template <typename Derived, typename Key, typename T, |
90 | | WireFormatLite::FieldType key_wire_type, |
91 | | WireFormatLite::FieldType value_wire_type> |
92 | | class MapField; |
93 | | |
94 | | template <typename Key, typename T> |
95 | | class TypeDefinedMapFieldBase; |
96 | | |
97 | | class DynamicMapField; |
98 | | |
99 | | class GeneratedMessageReflection; |
100 | | |
101 | | // re-implement std::allocator to use arena allocator for memory allocation. |
102 | | // Used for Map implementation. Users should not use this class |
103 | | // directly. |
104 | | template <typename U> |
105 | | class MapAllocator { |
106 | | public: |
107 | | using value_type = U; |
108 | | using pointer = value_type*; |
109 | | using const_pointer = const value_type*; |
110 | | using reference = value_type&; |
111 | | using const_reference = const value_type&; |
112 | | using size_type = size_t; |
113 | | using difference_type = ptrdiff_t; |
114 | | |
115 | | constexpr MapAllocator() : arena_(nullptr) {} |
116 | 563k | explicit constexpr MapAllocator(Arena* arena) : arena_(arena) {} |
117 | | template <typename X> |
118 | | MapAllocator(const MapAllocator<X>& allocator) // NOLINT(runtime/explicit) |
119 | 133k | : arena_(allocator.arena()) {}google::protobuf::internal::MapAllocator<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node>::MapAllocator<void*>(google::protobuf::internal::MapAllocator<void*> const&) Line | Count | Source | 119 | 36.9k | : arena_(allocator.arena()) {} |
Unexecuted instantiation: google::protobuf::internal::MapAllocator<std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*> >::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> >(google::protobuf::internal::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> > const&) Unexecuted instantiation: google::protobuf::internal::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> >::MapAllocator<void*>(google::protobuf::internal::MapAllocator<void*> const&) google::protobuf::internal::MapAllocator<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node>::MapAllocator<void*>(google::protobuf::internal::MapAllocator<void*> const&) Line | Count | Source | 119 | 55.5k | : arena_(allocator.arena()) {} |
google::protobuf::internal::MapAllocator<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node>::MapAllocator<void*>(google::protobuf::internal::MapAllocator<void*> const&) Line | Count | Source | 119 | 41.0k | : arena_(allocator.arena()) {} |
|
120 | | |
121 | | // MapAllocator does not support alignments beyond 8. Technically we should |
122 | | // support up to std::max_align_t, but this fails with ubsan and tcmalloc |
123 | | // debug allocation logic which assume 8 as default alignment. |
124 | | static_assert(alignof(value_type) <= 8, ""); |
125 | | |
126 | 192k | pointer allocate(size_type n, const void* /* hint */ = nullptr) { |
127 | | // If arena is not given, malloc needs to be called which doesn't |
128 | | // construct element object. |
129 | 192k | if (arena_ == nullptr) { |
130 | 192k | return static_cast<pointer>(::operator new(n * sizeof(value_type))); |
131 | 192k | } else { |
132 | 0 | return reinterpret_cast<pointer>( |
133 | 0 | Arena::CreateArray<uint8_t>(arena_, n * sizeof(value_type))); |
134 | 0 | } |
135 | 192k | } google::protobuf::internal::MapAllocator<void*>::allocate(unsigned long, void const*) Line | Count | Source | 126 | 58.7k | pointer allocate(size_type n, const void* /* hint */ = nullptr) { | 127 | | // If arena is not given, malloc needs to be called which doesn't | 128 | | // construct element object. | 129 | 58.7k | if (arena_ == nullptr) { | 130 | 58.7k | return static_cast<pointer>(::operator new(n * sizeof(value_type))); | 131 | 58.7k | } else { | 132 | 0 | return reinterpret_cast<pointer>( | 133 | 0 | Arena::CreateArray<uint8_t>(arena_, n * sizeof(value_type))); | 134 | 0 | } | 135 | 58.7k | } |
google::protobuf::internal::MapAllocator<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node>::allocate(unsigned long, void const*) Line | Count | Source | 126 | 36.9k | pointer allocate(size_type n, const void* /* hint */ = nullptr) { | 127 | | // If arena is not given, malloc needs to be called which doesn't | 128 | | // construct element object. | 129 | 36.9k | if (arena_ == nullptr) { | 130 | 36.9k | return static_cast<pointer>(::operator new(n * sizeof(value_type))); | 131 | 36.9k | } else { | 132 | 0 | return reinterpret_cast<pointer>( | 133 | 0 | Arena::CreateArray<uint8_t>(arena_, n * sizeof(value_type))); | 134 | 0 | } | 135 | 36.9k | } |
Unexecuted instantiation: google::protobuf::internal::MapAllocator<std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*> >::allocate(unsigned long, void const*) google::protobuf::internal::MapAllocator<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node>::allocate(unsigned long, void const*) Line | Count | Source | 126 | 55.5k | pointer allocate(size_type n, const void* /* hint */ = nullptr) { | 127 | | // If arena is not given, malloc needs to be called which doesn't | 128 | | // construct element object. | 129 | 55.5k | if (arena_ == nullptr) { | 130 | 55.5k | return static_cast<pointer>(::operator new(n * sizeof(value_type))); | 131 | 55.5k | } else { | 132 | 0 | return reinterpret_cast<pointer>( | 133 | 0 | Arena::CreateArray<uint8_t>(arena_, n * sizeof(value_type))); | 134 | 0 | } | 135 | 55.5k | } |
google::protobuf::internal::MapAllocator<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node>::allocate(unsigned long, void const*) Line | Count | Source | 126 | 41.0k | pointer allocate(size_type n, const void* /* hint */ = nullptr) { | 127 | | // If arena is not given, malloc needs to be called which doesn't | 128 | | // construct element object. | 129 | 41.0k | if (arena_ == nullptr) { | 130 | 41.0k | return static_cast<pointer>(::operator new(n * sizeof(value_type))); | 131 | 41.0k | } else { | 132 | 0 | return reinterpret_cast<pointer>( | 133 | 0 | Arena::CreateArray<uint8_t>(arena_, n * sizeof(value_type))); | 134 | 0 | } | 135 | 41.0k | } |
|
136 | | |
137 | 58.7k | void deallocate(pointer p, size_type n) { |
138 | 58.7k | if (arena_ == nullptr) { |
139 | 58.7k | internal::SizedDelete(p, n * sizeof(value_type)); |
140 | 58.7k | } |
141 | 58.7k | } Unexecuted instantiation: google::protobuf::internal::MapAllocator<std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*> >::deallocate(std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, unsigned long) google::protobuf::internal::MapAllocator<void*>::deallocate(void**, unsigned long) Line | Count | Source | 137 | 58.7k | void deallocate(pointer p, size_type n) { | 138 | 58.7k | if (arena_ == nullptr) { | 139 | 58.7k | internal::SizedDelete(p, n * sizeof(value_type)); | 140 | 58.7k | } | 141 | 58.7k | } |
|
142 | | |
143 | | #if !defined(GOOGLE_PROTOBUF_OS_APPLE) && !defined(GOOGLE_PROTOBUF_OS_NACL) && \ |
144 | | !defined(GOOGLE_PROTOBUF_OS_EMSCRIPTEN) |
145 | | template <class NodeType, class... Args> |
146 | 0 | void construct(NodeType* p, Args&&... args) { |
147 | | // Clang 3.6 doesn't compile static casting to void* directly. (Issue |
148 | | // #1266) According C++ standard 5.2.9/1: "The static_cast operator shall |
149 | | // not cast away constness". So first the maybe const pointer is casted to |
150 | | // const void* and after the const void* is const casted. |
151 | 0 | new (const_cast<void*>(static_cast<const void*>(p))) |
152 | 0 | NodeType(std::forward<Args>(args)...); |
153 | 0 | } |
154 | | |
155 | | template <class NodeType> |
156 | 0 | void destroy(NodeType* p) { |
157 | 0 | p->~NodeType(); |
158 | 0 | } |
159 | | #else |
160 | | void construct(pointer p, const_reference t) { new (p) value_type(t); } |
161 | | |
162 | | void destroy(pointer p) { p->~value_type(); } |
163 | | #endif |
164 | | |
165 | | template <typename X> |
166 | | struct rebind { |
167 | | using other = MapAllocator<X>; |
168 | | }; |
169 | | |
170 | | template <typename X> |
171 | | bool operator==(const MapAllocator<X>& other) const { |
172 | | return arena_ == other.arena_; |
173 | | } |
174 | | |
175 | | template <typename X> |
176 | | bool operator!=(const MapAllocator<X>& other) const { |
177 | | return arena_ != other.arena_; |
178 | | } |
179 | | |
180 | | // To support Visual Studio 2008 |
181 | | size_type max_size() const { |
182 | | // parentheses around (std::...:max) prevents macro warning of max() |
183 | | return (std::numeric_limits<size_type>::max)(); |
184 | | } |
185 | | |
186 | | // To support gcc-4.4, which does not properly |
187 | | // support templated friend classes |
188 | 1.57M | Arena* arena() const { return arena_; }google::protobuf::internal::MapAllocator<void*>::arena() const Line | Count | Source | 188 | 1.57M | Arena* arena() const { return arena_; } |
Unexecuted instantiation: google::protobuf::internal::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> >::arena() const |
189 | | |
190 | | private: |
191 | | using DestructorSkippable_ = void; |
192 | | Arena* arena_; |
193 | | }; |
194 | | |
195 | | template <typename T> |
196 | | using KeyForTree = |
197 | | typename std::conditional<std::is_scalar<T>::value, T, |
198 | | std::reference_wrapper<const T>>::type; |
199 | | |
200 | | // Default case: Not transparent. |
201 | | // We use std::hash<key_type>/std::less<key_type> and all the lookup functions |
202 | | // only accept `key_type`. |
203 | | template <typename key_type> |
204 | | struct TransparentSupport { |
205 | | using hash = std::hash<key_type>; |
206 | | using less = std::less<key_type>; |
207 | | |
208 | | static bool Equals(const key_type& a, const key_type& b) { return a == b; } |
209 | | |
210 | | template <typename K> |
211 | | using key_arg = key_type; |
212 | | }; |
213 | | |
214 | | #if defined(__cpp_lib_string_view) |
215 | | // If std::string_view is available, we add transparent support for std::string |
216 | | // keys. We use std::hash<std::string_view> as it supports the input types we |
217 | | // care about. The lookup functions accept arbitrary `K`. This will include any |
218 | | // key type that is convertible to std::string_view. |
219 | | template <> |
220 | | struct TransparentSupport<std::string> { |
221 | 0 | static std::string_view ImplicitConvert(std::string_view str) { return str; } |
222 | | // If the element is not convertible to std::string_view, try to convert to |
223 | | // std::string first. |
224 | | // The template makes this overload lose resolution when both have the same |
225 | | // rank otherwise. |
226 | | template <typename = void> |
227 | 1.18M | static std::string_view ImplicitConvert(const std::string& str) { |
228 | 1.18M | return str; |
229 | 1.18M | } |
230 | | |
231 | | struct hash : private std::hash<std::string_view> { |
232 | | using is_transparent = void; |
233 | | |
234 | | template <typename T> |
235 | 635k | size_t operator()(const T& str) const { |
236 | 635k | return base()(ImplicitConvert(str)); |
237 | 635k | } |
238 | | |
239 | | private: |
240 | 635k | const std::hash<std::string_view>& base() const { return *this; } |
241 | | }; |
242 | | struct less { |
243 | | using is_transparent = void; |
244 | | |
245 | | template <typename T, typename U> |
246 | 0 | bool operator()(const T& t, const U& u) const { |
247 | 0 | return ImplicitConvert(t) < ImplicitConvert(u); |
248 | 0 | } Unexecuted instantiation: bool google::protobuf::internal::TransparentSupport<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::less::operator()<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Unexecuted instantiation: bool google::protobuf::internal::TransparentSupport<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::less::operator()<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const&) const Unexecuted instantiation: bool google::protobuf::internal::TransparentSupport<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::less::operator()<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> >(std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const&, std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const&) const |
249 | | }; |
250 | | |
251 | | template <typename T, typename U> |
252 | 274k | static bool Equals(const T& t, const U& u) { |
253 | 274k | return ImplicitConvert(t) == ImplicitConvert(u); |
254 | 274k | } |
255 | | |
256 | | template <typename K> |
257 | | using key_arg = K; |
258 | | }; |
259 | | #endif // defined(__cpp_lib_string_view) |
260 | | |
261 | | template <typename Key> |
262 | | using TreeForMap = |
263 | | std::map<KeyForTree<Key>, void*, typename TransparentSupport<Key>::less, |
264 | | MapAllocator<std::pair<const KeyForTree<Key>, void*>>>; |
265 | | |
266 | 1.18M | inline bool TableEntryIsEmpty(void* const* table, size_t b) { |
267 | 1.18M | return table[b] == nullptr; |
268 | 1.18M | } |
269 | 1.51M | inline bool TableEntryIsNonEmptyList(void* const* table, size_t b) { |
270 | 1.51M | return table[b] != nullptr && table[b] != table[b ^ 1]; |
271 | 1.51M | } |
272 | 998k | inline bool TableEntryIsTree(void* const* table, size_t b) { |
273 | 998k | return !TableEntryIsEmpty(table, b) && !TableEntryIsNonEmptyList(table, b); |
274 | 998k | } |
275 | 0 | inline bool TableEntryIsList(void* const* table, size_t b) { |
276 | 0 | return !TableEntryIsTree(table, b); |
277 | 0 | } |
278 | | |
279 | | // This captures all numeric types. |
280 | 0 | inline size_t MapValueSpaceUsedExcludingSelfLong(bool) { return 0; } |
281 | 0 | inline size_t MapValueSpaceUsedExcludingSelfLong(const std::string& str) { |
282 | 0 | return StringSpaceUsedExcludingSelfLong(str); |
283 | 0 | } |
284 | | template <typename T, |
285 | | typename = decltype(std::declval<const T&>().SpaceUsedLong())> |
286 | 0 | size_t MapValueSpaceUsedExcludingSelfLong(const T& message) { |
287 | 0 | return message.SpaceUsedLong() - sizeof(T); |
288 | 0 | } Unexecuted instantiation: unsigned long google::protobuf::internal::MapValueSpaceUsedExcludingSelfLong<safepower_agent_proto::NodeState, unsigned long>(safepower_agent_proto::NodeState const&) Unexecuted instantiation: unsigned long google::protobuf::internal::MapValueSpaceUsedExcludingSelfLong<safepower_agent_proto::DaemonState, unsigned long>(safepower_agent_proto::DaemonState const&) Unexecuted instantiation: unsigned long google::protobuf::internal::MapValueSpaceUsedExcludingSelfLong<safepower_agent_proto::SystemdUnitState, unsigned long>(safepower_agent_proto::SystemdUnitState const&) |
289 | | |
290 | | constexpr size_t kGlobalEmptyTableSize = 1; |
291 | | PROTOBUF_EXPORT extern void* const kGlobalEmptyTable[kGlobalEmptyTableSize]; |
292 | | |
293 | | // Space used for the table, trees, and nodes. |
294 | | // Does not include the indirect space used. Eg the data of a std::string. |
295 | | template <typename Key> |
296 | | PROTOBUF_NOINLINE size_t SpaceUsedInTable(void** table, size_t num_buckets, |
297 | | size_t num_elements, |
298 | 0 | size_t sizeof_node) { |
299 | 0 | size_t size = 0; |
300 | | // The size of the table. |
301 | 0 | size += sizeof(void*) * num_buckets; |
302 | | // All the nodes. |
303 | 0 | size += sizeof_node * num_elements; |
304 | | // For each tree, count the overhead of the those nodes. |
305 | | // Two buckets at a time because we only care about trees. |
306 | 0 | for (size_t b = 0; b < num_buckets; b += 2) { |
307 | 0 | if (internal::TableEntryIsTree(table, b)) { |
308 | 0 | using Tree = TreeForMap<Key>; |
309 | 0 | Tree* tree = static_cast<Tree*>(table[b]); |
310 | | // Estimated cost of the red-black tree nodes, 3 pointers plus a |
311 | | // bool (plus alignment, so 4 pointers). |
312 | 0 | size += tree->size() * |
313 | 0 | (sizeof(typename Tree::value_type) + sizeof(void*) * 4); |
314 | 0 | } |
315 | 0 | } |
316 | 0 | return size; |
317 | 0 | } |
318 | | |
319 | | template <typename Map, |
320 | | typename = typename std::enable_if< |
321 | | !std::is_scalar<typename Map::key_type>::value || |
322 | | !std::is_scalar<typename Map::mapped_type>::value>::type> |
323 | 0 | size_t SpaceUsedInValues(const Map* map) { |
324 | 0 | size_t size = 0; |
325 | 0 | for (const auto& v : *map) { |
326 | 0 | size += internal::MapValueSpaceUsedExcludingSelfLong(v.first) + |
327 | 0 | internal::MapValueSpaceUsedExcludingSelfLong(v.second); |
328 | 0 | } |
329 | 0 | return size; |
330 | 0 | } Unexecuted instantiation: unsigned long google::protobuf::internal::SpaceUsedInValues<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>, void>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const*) Unexecuted instantiation: unsigned long google::protobuf::internal::SpaceUsedInValues<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>, void>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const*) Unexecuted instantiation: unsigned long google::protobuf::internal::SpaceUsedInValues<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>, void>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const*) |
331 | | |
332 | 0 | inline size_t SpaceUsedInValues(const void*) { return 0; } |
333 | | |
334 | | } // namespace internal |
335 | | |
336 | | // This is the class for Map's internal value_type. Instead of using |
337 | | // std::pair as value_type, we use this class which provides us more control of |
338 | | // its process of construction and destruction. |
339 | | template <typename Key, typename T> |
340 | | struct PROTOBUF_ATTRIBUTE_STANDALONE_DEBUG MapPair { |
341 | | using first_type = const Key; |
342 | | using second_type = T; |
343 | | |
344 | | MapPair(const Key& other_first, const T& other_second) |
345 | | : first(other_first), second(other_second) {} |
346 | | explicit MapPair(const Key& other_first) : first(other_first), second() {} |
347 | | explicit MapPair(Key&& other_first) |
348 | | : first(std::move(other_first)), second() {} |
349 | | MapPair(const MapPair& other) : first(other.first), second(other.second) {} |
350 | | |
351 | 133k | ~MapPair() {}google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::~MapPair() Line | Count | Source | 351 | 36.9k | ~MapPair() {} |
google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::~MapPair() Line | Count | Source | 351 | 55.5k | ~MapPair() {} |
google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::~MapPair() Line | Count | Source | 351 | 41.0k | ~MapPair() {} |
|
352 | | |
353 | | // Implicitly convertible to std::pair of compatible types. |
354 | | template <typename T1, typename T2> |
355 | | operator std::pair<T1, T2>() const { // NOLINT(runtime/explicit) |
356 | | return std::pair<T1, T2>(first, second); |
357 | | } |
358 | | |
359 | | const Key first; |
360 | | T second; |
361 | | |
362 | | private: |
363 | | friend class Arena; |
364 | | friend class Map<Key, T>; |
365 | | }; |
366 | | |
367 | | // Map is an associative container type used to store protobuf map |
368 | | // fields. Each Map instance may or may not use a different hash function, a |
369 | | // different iteration order, and so on. E.g., please don't examine |
370 | | // implementation details to decide if the following would work: |
371 | | // Map<int, int> m0, m1; |
372 | | // m0[0] = m1[0] = m0[1] = m1[1] = 0; |
373 | | // assert(m0.begin()->first == m1.begin()->first); // Bug! |
374 | | // |
375 | | // Map's interface is similar to std::unordered_map, except that Map is not |
376 | | // designed to play well with exceptions. |
377 | | template <typename Key, typename T> |
378 | | class Map { |
379 | | public: |
380 | | using key_type = Key; |
381 | | using mapped_type = T; |
382 | | using value_type = MapPair<Key, T>; |
383 | | |
384 | | using pointer = value_type*; |
385 | | using const_pointer = const value_type*; |
386 | | using reference = value_type&; |
387 | | using const_reference = const value_type&; |
388 | | |
389 | | using size_type = size_t; |
390 | | using hasher = typename internal::TransparentSupport<Key>::hash; |
391 | | |
392 | 5.43k | constexpr Map() : elements_(nullptr) {}google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::Map() Line | Count | Source | 392 | 5.43k | constexpr Map() : elements_(nullptr) {} |
Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::Map() Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::Map() |
393 | 557k | explicit Map(Arena* arena) : elements_(arena) {}google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::Map(google::protobuf::Arena*) Line | Count | Source | 393 | 47.1k | explicit Map(Arena* arena) : elements_(arena) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::Map(google::protobuf::Arena*) Line | Count | Source | 393 | 255k | explicit Map(Arena* arena) : elements_(arena) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::Map(google::protobuf::Arena*) Line | Count | Source | 393 | 255k | explicit Map(Arena* arena) : elements_(arena) {} |
|
394 | | |
395 | 0 | Map(const Map& other) : Map() { insert(other.begin(), other.end()); }Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::Map(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const&) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::Map(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const&) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::Map(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const&) |
396 | | |
397 | | Map(Map&& other) noexcept : Map() { |
398 | | if (other.arena() != nullptr) { |
399 | | *this = other; |
400 | | } else { |
401 | | swap(other); |
402 | | } |
403 | | } |
404 | | |
405 | | Map& operator=(Map&& other) noexcept { |
406 | | if (this != &other) { |
407 | | if (arena() != other.arena()) { |
408 | | *this = other; |
409 | | } else { |
410 | | swap(other); |
411 | | } |
412 | | } |
413 | | return *this; |
414 | | } |
415 | | |
416 | | template <class InputIt> |
417 | | Map(const InputIt& first, const InputIt& last) : Map() { |
418 | | insert(first, last); |
419 | | } |
420 | | |
421 | 281k | ~Map() {}google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::~Map() Line | Count | Source | 421 | 26.2k | ~Map() {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::~Map() Line | Count | Source | 421 | 127k | ~Map() {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::~Map() Line | Count | Source | 421 | 127k | ~Map() {} |
|
422 | | |
423 | | private: |
424 | | using Allocator = internal::MapAllocator<void*>; |
425 | | |
426 | | // InnerMap is a generic hash-based map. It doesn't contain any |
427 | | // protocol-buffer-specific logic. It is a chaining hash map with the |
428 | | // additional feature that some buckets can be converted to use an ordered |
429 | | // container. This ensures O(lg n) bounds on find, insert, and erase, while |
430 | | // avoiding the overheads of ordered containers most of the time. |
431 | | // |
432 | | // The implementation doesn't need the full generality of unordered_map, |
433 | | // and it doesn't have it. More bells and whistles can be added as needed. |
434 | | // Some implementation details: |
435 | | // 1. The hash function has type hasher and the equality function |
436 | | // equal_to<Key>. We inherit from hasher to save space |
437 | | // (empty-base-class optimization). |
438 | | // 2. The number of buckets is a power of two. |
439 | | // 3. Buckets are converted to trees in pairs: if we convert bucket b then |
440 | | // buckets b and b^1 will share a tree. Invariant: buckets b and b^1 have |
441 | | // the same non-null value iff they are sharing a tree. (An alternative |
442 | | // implementation strategy would be to have a tag bit per bucket.) |
443 | | // 4. As is typical for hash_map and such, the Keys and Values are always |
444 | | // stored in linked list nodes. Pointers to elements are never invalidated |
445 | | // until the element is deleted. |
446 | | // 5. The trees' payload type is pointer to linked-list node. Tree-converting |
447 | | // a bucket doesn't copy Key-Value pairs. |
448 | | // 6. Once we've tree-converted a bucket, it is never converted back. However, |
449 | | // the items a tree contains may wind up assigned to trees or lists upon a |
450 | | // rehash. |
451 | | // 7. The code requires no C++ features from C++14 or later. |
452 | | // 8. Mutations to a map do not invalidate the map's iterators, pointers to |
453 | | // elements, or references to elements. |
454 | | // 9. Except for erase(iterator), any non-const method can reorder iterators. |
455 | | // 10. InnerMap uses KeyForTree<Key> when using the Tree representation, which |
456 | | // is either `Key`, if Key is a scalar, or `reference_wrapper<const Key>` |
457 | | // otherwise. This avoids unnecessary copies of string keys, for example. |
458 | | class InnerMap : private hasher { |
459 | | public: |
460 | | explicit constexpr InnerMap(Arena* arena) |
461 | 563k | : hasher(), |
462 | 563k | num_elements_(0), |
463 | 563k | num_buckets_(internal::kGlobalEmptyTableSize), |
464 | 563k | seed_(0), |
465 | 563k | index_of_first_non_null_(internal::kGlobalEmptyTableSize), |
466 | 563k | table_(const_cast<void**>(internal::kGlobalEmptyTable)), |
467 | 563k | alloc_(arena) {}google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::InnerMap(google::protobuf::Arena*) Line | Count | Source | 461 | 52.5k | : hasher(), | 462 | 52.5k | num_elements_(0), | 463 | 52.5k | num_buckets_(internal::kGlobalEmptyTableSize), | 464 | 52.5k | seed_(0), | 465 | 52.5k | index_of_first_non_null_(internal::kGlobalEmptyTableSize), | 466 | 52.5k | table_(const_cast<void**>(internal::kGlobalEmptyTable)), | 467 | 52.5k | alloc_(arena) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::InnerMap(google::protobuf::Arena*) Line | Count | Source | 461 | 255k | : hasher(), | 462 | 255k | num_elements_(0), | 463 | 255k | num_buckets_(internal::kGlobalEmptyTableSize), | 464 | 255k | seed_(0), | 465 | 255k | index_of_first_non_null_(internal::kGlobalEmptyTableSize), | 466 | 255k | table_(const_cast<void**>(internal::kGlobalEmptyTable)), | 467 | 255k | alloc_(arena) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::InnerMap(google::protobuf::Arena*) Line | Count | Source | 461 | 255k | : hasher(), | 462 | 255k | num_elements_(0), | 463 | 255k | num_buckets_(internal::kGlobalEmptyTableSize), | 464 | 255k | seed_(0), | 465 | 255k | index_of_first_non_null_(internal::kGlobalEmptyTableSize), | 466 | 255k | table_(const_cast<void**>(internal::kGlobalEmptyTable)), | 467 | 255k | alloc_(arena) {} |
|
468 | | |
469 | 281k | ~InnerMap() { |
470 | 281k | if (alloc_.arena() == nullptr && |
471 | 281k | num_buckets_ != internal::kGlobalEmptyTableSize) { |
472 | 53.6k | clear(); |
473 | 53.6k | Dealloc<void*>(table_, num_buckets_); |
474 | 53.6k | } |
475 | 281k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::~InnerMap() Line | Count | Source | 469 | 26.2k | ~InnerMap() { | 470 | 26.2k | if (alloc_.arena() == nullptr && | 471 | 26.2k | num_buckets_ != internal::kGlobalEmptyTableSize) { | 472 | 9.39k | clear(); | 473 | 9.39k | Dealloc<void*>(table_, num_buckets_); | 474 | 9.39k | } | 475 | 26.2k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::~InnerMap() Line | Count | Source | 469 | 127k | ~InnerMap() { | 470 | 127k | if (alloc_.arena() == nullptr && | 471 | 127k | num_buckets_ != internal::kGlobalEmptyTableSize) { | 472 | 27.6k | clear(); | 473 | 27.6k | Dealloc<void*>(table_, num_buckets_); | 474 | 27.6k | } | 475 | 127k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::~InnerMap() Line | Count | Source | 469 | 127k | ~InnerMap() { | 470 | 127k | if (alloc_.arena() == nullptr && | 471 | 127k | num_buckets_ != internal::kGlobalEmptyTableSize) { | 472 | 16.5k | clear(); | 473 | 16.5k | Dealloc<void*>(table_, num_buckets_); | 474 | 16.5k | } | 475 | 127k | } |
|
476 | | |
477 | | private: |
478 | | enum { kMinTableSize = 8 }; |
479 | | |
480 | | // Linked-list nodes, as one would expect for a chaining hash table. |
481 | | struct Node { |
482 | | value_type kv; |
483 | | Node* next; |
484 | | }; |
485 | | |
486 | | // Trees. The payload type is a copy of Key, so that we can query the tree |
487 | | // with Keys that are not in any particular data structure. |
488 | | // The value is a void* pointing to Node. We use void* instead of Node* to |
489 | | // avoid code bloat. That way there is only one instantiation of the tree |
490 | | // class per key type. |
491 | | using Tree = internal::TreeForMap<Key>; |
492 | | using TreeIterator = typename Tree::iterator; |
493 | | |
494 | 0 | static Node* NodeFromTreeIterator(TreeIterator it) { |
495 | 0 | return static_cast<Node*>(it->second); |
496 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::NodeFromTreeIterator(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::NodeFromTreeIterator(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::NodeFromTreeIterator(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >) |
497 | | |
498 | | // iterator and const_iterator are instantiations of iterator_base. |
499 | | template <typename KeyValueType> |
500 | | class iterator_base { |
501 | | public: |
502 | | using reference = KeyValueType&; |
503 | | using pointer = KeyValueType*; |
504 | | |
505 | | // Invariants: |
506 | | // node_ is always correct. This is handy because the most common |
507 | | // operations are operator* and operator-> and they only use node_. |
508 | | // When node_ is set to a non-null value, all the other non-const fields |
509 | | // are updated to be correct also, but those fields can become stale |
510 | | // if the underlying map is modified. When those fields are needed they |
511 | | // are rechecked, and updated if necessary. |
512 | 1.08M | iterator_base() : node_(nullptr), m_(nullptr), bucket_index_(0) {}google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>::iterator_base() Line | Count | Source | 512 | 179k | iterator_base() : node_(nullptr), m_(nullptr), bucket_index_(0) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::iterator_base() Line | Count | Source | 512 | 128k | iterator_base() : node_(nullptr), m_(nullptr), bucket_index_(0) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>::iterator_base() Line | Count | Source | 512 | 297k | iterator_base() : node_(nullptr), m_(nullptr), bucket_index_(0) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::iterator_base() Line | Count | Source | 512 | 154k | iterator_base() : node_(nullptr), m_(nullptr), bucket_index_(0) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>::iterator_base() Line | Count | Source | 512 | 204k | iterator_base() : node_(nullptr), m_(nullptr), bucket_index_(0) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::iterator_base() Line | Count | Source | 512 | 117k | iterator_base() : node_(nullptr), m_(nullptr), bucket_index_(0) {} |
|
513 | | |
514 | 98.7k | explicit iterator_base(const InnerMap* m) : m_(m) { |
515 | 98.7k | SearchFrom(m->index_of_first_non_null_); |
516 | 98.7k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>::iterator_base(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap const*) Line | Count | Source | 514 | 8.53k | explicit iterator_base(const InnerMap* m) : m_(m) { | 515 | 8.53k | SearchFrom(m->index_of_first_non_null_); | 516 | 8.53k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>::iterator_base(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap const*) Line | Count | Source | 514 | 46.7k | explicit iterator_base(const InnerMap* m) : m_(m) { | 515 | 46.7k | SearchFrom(m->index_of_first_non_null_); | 516 | 46.7k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>::iterator_base(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap const*) Line | Count | Source | 514 | 43.4k | explicit iterator_base(const InnerMap* m) : m_(m) { | 515 | 43.4k | SearchFrom(m->index_of_first_non_null_); | 516 | 43.4k | } |
|
517 | | |
518 | | // Any iterator_base can convert to any other. This is overkill, and we |
519 | | // rely on the enclosing class to use it wisely. The standard "iterator |
520 | | // can convert to const_iterator" is OK but the reverse direction is not. |
521 | | template <typename U> |
522 | | explicit iterator_base(const iterator_base<U>& it) |
523 | 319k | : node_(it.node_), m_(it.m_), bucket_index_(it.bucket_index_) {}google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const> const&) Line | Count | Source | 523 | 112k | : node_(it.node_), m_(it.m_), bucket_index_(it.bucket_index_) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const> const&) Line | Count | Source | 523 | 117k | : node_(it.node_), m_(it.m_), bucket_index_(it.bucket_index_) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const> const&) Line | Count | Source | 523 | 89.1k | : node_(it.node_), m_(it.m_), bucket_index_(it.bucket_index_) {} |
|
524 | | |
525 | | iterator_base(Node* n, const InnerMap* m, size_type index) |
526 | 364k | : node_(n), m_(m), bucket_index_(index) {}google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>::iterator_base(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node*, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap const*, unsigned long) Line | Count | Source | 526 | 94.2k | : node_(n), m_(m), bucket_index_(index) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::iterator_base(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node*, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap const*, unsigned long) Line | Count | Source | 526 | 56.1k | : node_(n), m_(m), bucket_index_(index) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>::iterator_base(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node*, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap const*, unsigned long) Line | Count | Source | 526 | 49.6k | : node_(n), m_(m), bucket_index_(index) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::iterator_base(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node*, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap const*, unsigned long) Line | Count | Source | 526 | 72.4k | : node_(n), m_(m), bucket_index_(index) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>::iterator_base(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node*, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap const*, unsigned long) Line | Count | Source | 526 | 37.4k | : node_(n), m_(m), bucket_index_(index) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::iterator_base(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node*, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap const*, unsigned long) Line | Count | Source | 526 | 54.2k | : node_(n), m_(m), bucket_index_(index) {} |
|
527 | | |
528 | | iterator_base(TreeIterator tree_it, const InnerMap* m, size_type index) |
529 | 0 | : node_(NodeFromTreeIterator(tree_it)), m_(m), bucket_index_(index) { |
530 | | // Invariant: iterators that use buckets with trees have an even |
531 | | // bucket_index_. |
532 | 0 | GOOGLE_DCHECK_EQ(bucket_index_ % 2, 0u); |
533 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>::iterator_base(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap const*, unsigned long) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::iterator_base(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap const*, unsigned long) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>::iterator_base(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap const*, unsigned long) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::iterator_base(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap const*, unsigned long) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>::iterator_base(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap const*, unsigned long) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::iterator_base(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap const*, unsigned long) |
534 | | |
535 | | // Advance through buckets, looking for the first that isn't empty. |
536 | | // If nothing non-empty is found then leave node_ == nullptr. |
537 | 173k | void SearchFrom(size_type start_bucket) { |
538 | 173k | GOOGLE_DCHECK(m_->index_of_first_non_null_ == m_->num_buckets_ || |
539 | 173k | m_->table_[m_->index_of_first_non_null_] != nullptr); |
540 | 173k | node_ = nullptr; |
541 | 350k | for (bucket_index_ = start_bucket; bucket_index_ < m_->num_buckets_; |
542 | 248k | bucket_index_++) { |
543 | 248k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { |
544 | 71.1k | node_ = static_cast<Node*>(m_->table_[bucket_index_]); |
545 | 71.1k | break; |
546 | 177k | } else if (m_->TableEntryIsTree(bucket_index_)) { |
547 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); |
548 | 0 | GOOGLE_DCHECK(!tree->empty()); |
549 | 0 | node_ = NodeFromTreeIterator(tree->begin()); |
550 | 0 | break; |
551 | 0 | } |
552 | 248k | } |
553 | 173k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::SearchFrom(unsigned long) Line | Count | Source | 537 | 8.11k | void SearchFrom(size_type start_bucket) { | 538 | 8.11k | GOOGLE_DCHECK(m_->index_of_first_non_null_ == m_->num_buckets_ || | 539 | 8.11k | m_->table_[m_->index_of_first_non_null_] != nullptr); | 540 | 8.11k | node_ = nullptr; | 541 | 19.0k | for (bucket_index_ = start_bucket; bucket_index_ < m_->num_buckets_; | 542 | 17.2k | bucket_index_++) { | 543 | 17.2k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 544 | 6.33k | node_ = static_cast<Node*>(m_->table_[bucket_index_]); | 545 | 6.33k | break; | 546 | 10.9k | } else if (m_->TableEntryIsTree(bucket_index_)) { | 547 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 548 | 0 | GOOGLE_DCHECK(!tree->empty()); | 549 | 0 | node_ = NodeFromTreeIterator(tree->begin()); | 550 | 0 | break; | 551 | 0 | } | 552 | 17.2k | } | 553 | 8.11k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>::SearchFrom(unsigned long) Line | Count | Source | 537 | 16.0k | void SearchFrom(size_type start_bucket) { | 538 | 16.0k | GOOGLE_DCHECK(m_->index_of_first_non_null_ == m_->num_buckets_ || | 539 | 16.0k | m_->table_[m_->index_of_first_non_null_] != nullptr); | 540 | 16.0k | node_ = nullptr; | 541 | 32.6k | for (bucket_index_ = start_bucket; bucket_index_ < m_->num_buckets_; | 542 | 27.2k | bucket_index_++) { | 543 | 27.2k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 544 | 10.6k | node_ = static_cast<Node*>(m_->table_[bucket_index_]); | 545 | 10.6k | break; | 546 | 16.6k | } else if (m_->TableEntryIsTree(bucket_index_)) { | 547 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 548 | 0 | GOOGLE_DCHECK(!tree->empty()); | 549 | 0 | node_ = NodeFromTreeIterator(tree->begin()); | 550 | 0 | break; | 551 | 0 | } | 552 | 27.2k | } | 553 | 16.0k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::SearchFrom(unsigned long) Line | Count | Source | 537 | 7.95k | void SearchFrom(size_type start_bucket) { | 538 | 7.95k | GOOGLE_DCHECK(m_->index_of_first_non_null_ == m_->num_buckets_ || | 539 | 7.95k | m_->table_[m_->index_of_first_non_null_] != nullptr); | 540 | 7.95k | node_ = nullptr; | 541 | 22.2k | for (bucket_index_ = start_bucket; bucket_index_ < m_->num_buckets_; | 542 | 19.9k | bucket_index_++) { | 543 | 19.9k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 544 | 5.68k | node_ = static_cast<Node*>(m_->table_[bucket_index_]); | 545 | 5.68k | break; | 546 | 14.2k | } else if (m_->TableEntryIsTree(bucket_index_)) { | 547 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 548 | 0 | GOOGLE_DCHECK(!tree->empty()); | 549 | 0 | node_ = NodeFromTreeIterator(tree->begin()); | 550 | 0 | break; | 551 | 0 | } | 552 | 19.9k | } | 553 | 7.95k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::SearchFrom(unsigned long) Line | Count | Source | 537 | 7.69k | void SearchFrom(size_type start_bucket) { | 538 | 7.69k | GOOGLE_DCHECK(m_->index_of_first_non_null_ == m_->num_buckets_ || | 539 | 7.69k | m_->table_[m_->index_of_first_non_null_] != nullptr); | 540 | 7.69k | node_ = nullptr; | 541 | 20.1k | for (bucket_index_ = start_bucket; bucket_index_ < m_->num_buckets_; | 542 | 17.5k | bucket_index_++) { | 543 | 17.5k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 544 | 5.14k | node_ = static_cast<Node*>(m_->table_[bucket_index_]); | 545 | 5.14k | break; | 546 | 12.4k | } else if (m_->TableEntryIsTree(bucket_index_)) { | 547 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 548 | 0 | GOOGLE_DCHECK(!tree->empty()); | 549 | 0 | node_ = NodeFromTreeIterator(tree->begin()); | 550 | 0 | break; | 551 | 0 | } | 552 | 17.5k | } | 553 | 7.69k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>::SearchFrom(unsigned long) Line | Count | Source | 537 | 74.7k | void SearchFrom(size_type start_bucket) { | 538 | 74.7k | GOOGLE_DCHECK(m_->index_of_first_non_null_ == m_->num_buckets_ || | 539 | 74.7k | m_->table_[m_->index_of_first_non_null_] != nullptr); | 540 | 74.7k | node_ = nullptr; | 541 | 151k | for (bucket_index_ = start_bucket; bucket_index_ < m_->num_buckets_; | 542 | 105k | bucket_index_++) { | 543 | 105k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 544 | 28.0k | node_ = static_cast<Node*>(m_->table_[bucket_index_]); | 545 | 28.0k | break; | 546 | 77.0k | } else if (m_->TableEntryIsTree(bucket_index_)) { | 547 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 548 | 0 | GOOGLE_DCHECK(!tree->empty()); | 549 | 0 | node_ = NodeFromTreeIterator(tree->begin()); | 550 | 0 | break; | 551 | 0 | } | 552 | 105k | } | 553 | 74.7k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>::SearchFrom(unsigned long) Line | Count | Source | 537 | 58.7k | void SearchFrom(size_type start_bucket) { | 538 | 58.7k | GOOGLE_DCHECK(m_->index_of_first_non_null_ == m_->num_buckets_ || | 539 | 58.7k | m_->table_[m_->index_of_first_non_null_] != nullptr); | 540 | 58.7k | node_ = nullptr; | 541 | 104k | for (bucket_index_ = start_bucket; bucket_index_ < m_->num_buckets_; | 542 | 61.3k | bucket_index_++) { | 543 | 61.3k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 544 | 15.3k | node_ = static_cast<Node*>(m_->table_[bucket_index_]); | 545 | 15.3k | break; | 546 | 46.0k | } else if (m_->TableEntryIsTree(bucket_index_)) { | 547 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 548 | 0 | GOOGLE_DCHECK(!tree->empty()); | 549 | 0 | node_ = NodeFromTreeIterator(tree->begin()); | 550 | 0 | break; | 551 | 0 | } | 552 | 61.3k | } | 553 | 58.7k | } |
|
554 | | |
555 | 375k | reference operator*() const { return node_->kv; }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::operator*() const Line | Count | Source | 555 | 80.4k | reference operator*() const { return node_->kv; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>::operator*() const Line | Count | Source | 555 | 60.8k | reference operator*() const { return node_->kv; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::operator*() const Line | Count | Source | 555 | 90.9k | reference operator*() const { return node_->kv; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::operator*() const Line | Count | Source | 555 | 66.7k | reference operator*() const { return node_->kv; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>::operator*() const Line | Count | Source | 555 | 49.6k | reference operator*() const { return node_->kv; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>::operator*() const Line | Count | Source | 555 | 26.4k | reference operator*() const { return node_->kv; } |
|
556 | 0 | pointer operator->() const { return &(operator*()); }Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::operator->() const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::operator->() const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::operator->() const |
557 | | |
558 | 475k | friend bool operator==(const iterator_base& a, const iterator_base& b) { |
559 | 475k | return a.node_ == b.node_; |
560 | 475k | } google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> > const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> > const&) Line | Count | Source | 558 | 72.4k | friend bool operator==(const iterator_base& a, const iterator_base& b) { | 559 | 72.4k | return a.node_ == b.node_; | 560 | 72.4k | } |
google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const> const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const> const&) Line | Count | Source | 558 | 63.9k | friend bool operator==(const iterator_base& a, const iterator_base& b) { | 559 | 63.9k | return a.node_ == b.node_; | 560 | 63.9k | } |
google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> > const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> > const&) Line | Count | Source | 558 | 82.4k | friend bool operator==(const iterator_base& a, const iterator_base& b) { | 559 | 82.4k | return a.node_ == b.node_; | 560 | 82.4k | } |
google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> > const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> > const&) Line | Count | Source | 558 | 63.4k | friend bool operator==(const iterator_base& a, const iterator_base& b) { | 559 | 63.4k | return a.node_ == b.node_; | 560 | 63.4k | } |
google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const> const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const> const&) Line | Count | Source | 558 | 114k | friend bool operator==(const iterator_base& a, const iterator_base& b) { | 559 | 114k | return a.node_ == b.node_; | 560 | 114k | } |
google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const> const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const> const&) Line | Count | Source | 558 | 78.2k | friend bool operator==(const iterator_base& a, const iterator_base& b) { | 559 | 78.2k | return a.node_ == b.node_; | 560 | 78.2k | } |
|
561 | | friend bool operator!=(const iterator_base& a, const iterator_base& b) { |
562 | | return a.node_ != b.node_; |
563 | | } |
564 | | |
565 | 85.7k | iterator_base& operator++() { |
566 | 85.7k | if (node_->next == nullptr) { |
567 | 74.4k | TreeIterator tree_it; |
568 | 74.4k | const bool is_list = revalidate_if_necessary(&tree_it); |
569 | 74.4k | if (is_list) { |
570 | 74.4k | SearchFrom(bucket_index_ + 1); |
571 | 74.4k | } else { |
572 | 0 | GOOGLE_DCHECK_EQ(bucket_index_ & 1, 0u); |
573 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); |
574 | 0 | if (++tree_it == tree->end()) { |
575 | 0 | SearchFrom(bucket_index_ + 2); |
576 | 0 | } else { |
577 | 0 | node_ = NodeFromTreeIterator(tree_it); |
578 | 0 | } |
579 | 0 | } |
580 | 74.4k | } else { |
581 | 11.3k | node_ = node_->next; |
582 | 11.3k | } |
583 | 85.7k | return *this; |
584 | 85.7k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::operator++() Line | Count | Source | 565 | 10.8k | iterator_base& operator++() { | 566 | 10.8k | if (node_->next == nullptr) { | 567 | 8.11k | TreeIterator tree_it; | 568 | 8.11k | const bool is_list = revalidate_if_necessary(&tree_it); | 569 | 8.11k | if (is_list) { | 570 | 8.11k | SearchFrom(bucket_index_ + 1); | 571 | 8.11k | } else { | 572 | 0 | GOOGLE_DCHECK_EQ(bucket_index_ & 1, 0u); | 573 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 574 | 0 | if (++tree_it == tree->end()) { | 575 | 0 | SearchFrom(bucket_index_ + 2); | 576 | 0 | } else { | 577 | 0 | node_ = NodeFromTreeIterator(tree_it); | 578 | 0 | } | 579 | 0 | } | 580 | 8.11k | } else { | 581 | 2.69k | node_ = node_->next; | 582 | 2.69k | } | 583 | 10.8k | return *this; | 584 | 10.8k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>::operator++() Line | Count | Source | 565 | 8.86k | iterator_base& operator++() { | 566 | 8.86k | if (node_->next == nullptr) { | 567 | 7.53k | TreeIterator tree_it; | 568 | 7.53k | const bool is_list = revalidate_if_necessary(&tree_it); | 569 | 7.53k | if (is_list) { | 570 | 7.53k | SearchFrom(bucket_index_ + 1); | 571 | 7.53k | } else { | 572 | 0 | GOOGLE_DCHECK_EQ(bucket_index_ & 1, 0u); | 573 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 574 | 0 | if (++tree_it == tree->end()) { | 575 | 0 | SearchFrom(bucket_index_ + 2); | 576 | 0 | } else { | 577 | 0 | node_ = NodeFromTreeIterator(tree_it); | 578 | 0 | } | 579 | 0 | } | 580 | 7.53k | } else { | 581 | 1.32k | node_ = node_->next; | 582 | 1.32k | } | 583 | 8.86k | return *this; | 584 | 8.86k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::operator++() Line | Count | Source | 565 | 10.0k | iterator_base& operator++() { | 566 | 10.0k | if (node_->next == nullptr) { | 567 | 7.95k | TreeIterator tree_it; | 568 | 7.95k | const bool is_list = revalidate_if_necessary(&tree_it); | 569 | 7.95k | if (is_list) { | 570 | 7.95k | SearchFrom(bucket_index_ + 1); | 571 | 7.95k | } else { | 572 | 0 | GOOGLE_DCHECK_EQ(bucket_index_ & 1, 0u); | 573 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 574 | 0 | if (++tree_it == tree->end()) { | 575 | 0 | SearchFrom(bucket_index_ + 2); | 576 | 0 | } else { | 577 | 0 | node_ = NodeFromTreeIterator(tree_it); | 578 | 0 | } | 579 | 0 | } | 580 | 7.95k | } else { | 581 | 2.09k | node_ = node_->next; | 582 | 2.09k | } | 583 | 10.0k | return *this; | 584 | 10.0k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::operator++() Line | Count | Source | 565 | 9.21k | iterator_base& operator++() { | 566 | 9.21k | if (node_->next == nullptr) { | 567 | 7.69k | TreeIterator tree_it; | 568 | 7.69k | const bool is_list = revalidate_if_necessary(&tree_it); | 569 | 7.69k | if (is_list) { | 570 | 7.69k | SearchFrom(bucket_index_ + 1); | 571 | 7.69k | } else { | 572 | 0 | GOOGLE_DCHECK_EQ(bucket_index_ & 1, 0u); | 573 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 574 | 0 | if (++tree_it == tree->end()) { | 575 | 0 | SearchFrom(bucket_index_ + 2); | 576 | 0 | } else { | 577 | 0 | node_ = NodeFromTreeIterator(tree_it); | 578 | 0 | } | 579 | 0 | } | 580 | 7.69k | } else { | 581 | 1.52k | node_ = node_->next; | 582 | 1.52k | } | 583 | 9.21k | return *this; | 584 | 9.21k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>::operator++() Line | Count | Source | 565 | 30.8k | iterator_base& operator++() { | 566 | 30.8k | if (node_->next == nullptr) { | 567 | 27.9k | TreeIterator tree_it; | 568 | 27.9k | const bool is_list = revalidate_if_necessary(&tree_it); | 569 | 27.9k | if (is_list) { | 570 | 27.9k | SearchFrom(bucket_index_ + 1); | 571 | 27.9k | } else { | 572 | 0 | GOOGLE_DCHECK_EQ(bucket_index_ & 1, 0u); | 573 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 574 | 0 | if (++tree_it == tree->end()) { | 575 | 0 | SearchFrom(bucket_index_ + 2); | 576 | 0 | } else { | 577 | 0 | node_ = NodeFromTreeIterator(tree_it); | 578 | 0 | } | 579 | 0 | } | 580 | 27.9k | } else { | 581 | 2.85k | node_ = node_->next; | 582 | 2.85k | } | 583 | 30.8k | return *this; | 584 | 30.8k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>::operator++() Line | Count | Source | 565 | 16.0k | iterator_base& operator++() { | 566 | 16.0k | if (node_->next == nullptr) { | 567 | 15.2k | TreeIterator tree_it; | 568 | 15.2k | const bool is_list = revalidate_if_necessary(&tree_it); | 569 | 15.2k | if (is_list) { | 570 | 15.2k | SearchFrom(bucket_index_ + 1); | 571 | 15.2k | } else { | 572 | 0 | GOOGLE_DCHECK_EQ(bucket_index_ & 1, 0u); | 573 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 574 | 0 | if (++tree_it == tree->end()) { | 575 | 0 | SearchFrom(bucket_index_ + 2); | 576 | 0 | } else { | 577 | 0 | node_ = NodeFromTreeIterator(tree_it); | 578 | 0 | } | 579 | 0 | } | 580 | 15.2k | } else { | 581 | 807 | node_ = node_->next; | 582 | 807 | } | 583 | 16.0k | return *this; | 584 | 16.0k | } |
|
585 | | |
586 | 30.0k | iterator_base operator++(int /* unused */) { |
587 | 30.0k | iterator_base tmp = *this; |
588 | 30.0k | ++*this; |
589 | 30.0k | return tmp; |
590 | 30.0k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::operator++(int) Line | Count | Source | 586 | 10.8k | iterator_base operator++(int /* unused */) { | 587 | 10.8k | iterator_base tmp = *this; | 588 | 10.8k | ++*this; | 589 | 10.8k | return tmp; | 590 | 10.8k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::operator++(int) Line | Count | Source | 586 | 10.0k | iterator_base operator++(int /* unused */) { | 587 | 10.0k | iterator_base tmp = *this; | 588 | 10.0k | ++*this; | 589 | 10.0k | return tmp; | 590 | 10.0k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::operator++(int) Line | Count | Source | 586 | 9.21k | iterator_base operator++(int /* unused */) { | 587 | 9.21k | iterator_base tmp = *this; | 588 | 9.21k | ++*this; | 589 | 9.21k | return tmp; | 590 | 9.21k | } |
|
591 | | |
592 | | // Assumes node_ and m_ are correct and non-null, but other fields may be |
593 | | // stale. Fix them as needed. Then return true iff node_ points to a |
594 | | // Node in a list. If false is returned then *it is modified to be |
595 | | // a valid iterator for node_. |
596 | 104k | bool revalidate_if_necessary(TreeIterator* it) { |
597 | 104k | GOOGLE_DCHECK(node_ != nullptr && m_ != nullptr); |
598 | | // Force bucket_index_ to be in range. |
599 | 104k | bucket_index_ &= (m_->num_buckets_ - 1); |
600 | | // Common case: the bucket we think is relevant points to node_. |
601 | 104k | if (m_->table_[bucket_index_] == static_cast<void*>(node_)) return true; |
602 | | // Less common: the bucket is a linked list with node_ somewhere in it, |
603 | | // but not at the head. |
604 | 11.8k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { |
605 | 11.8k | Node* l = static_cast<Node*>(m_->table_[bucket_index_]); |
606 | 12.6k | while ((l = l->next) != nullptr) { |
607 | 12.6k | if (l == node_) { |
608 | 11.8k | return true; |
609 | 11.8k | } |
610 | 12.6k | } |
611 | 11.8k | } |
612 | | // Well, bucket_index_ still might be correct, but probably |
613 | | // not. Revalidate just to be sure. This case is rare enough that we |
614 | | // don't worry about potential optimizations, such as having a custom |
615 | | // find-like method that compares Node* instead of the key. |
616 | 0 | iterator_base i(m_->find(node_->kv.first, it)); |
617 | 0 | bucket_index_ = i.bucket_index_; |
618 | 0 | return m_->TableEntryIsList(bucket_index_); |
619 | 11.8k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::revalidate_if_necessary(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) Line | Count | Source | 596 | 18.9k | bool revalidate_if_necessary(TreeIterator* it) { | 597 | 18.9k | GOOGLE_DCHECK(node_ != nullptr && m_ != nullptr); | 598 | | // Force bucket_index_ to be in range. | 599 | 18.9k | bucket_index_ &= (m_->num_buckets_ - 1); | 600 | | // Common case: the bucket we think is relevant points to node_. | 601 | 18.9k | if (m_->table_[bucket_index_] == static_cast<void*>(node_)) return true; | 602 | | // Less common: the bucket is a linked list with node_ somewhere in it, | 603 | | // but not at the head. | 604 | 3.19k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 605 | 3.19k | Node* l = static_cast<Node*>(m_->table_[bucket_index_]); | 606 | 3.19k | while ((l = l->next) != nullptr) { | 607 | 3.19k | if (l == node_) { | 608 | 3.19k | return true; | 609 | 3.19k | } | 610 | 3.19k | } | 611 | 3.19k | } | 612 | | // Well, bucket_index_ still might be correct, but probably | 613 | | // not. Revalidate just to be sure. This case is rare enough that we | 614 | | // don't worry about potential optimizations, such as having a custom | 615 | | // find-like method that compares Node* instead of the key. | 616 | 0 | iterator_base i(m_->find(node_->kv.first, it)); | 617 | 0 | bucket_index_ = i.bucket_index_; | 618 | 0 | return m_->TableEntryIsList(bucket_index_); | 619 | 3.19k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>::revalidate_if_necessary(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) Line | Count | Source | 596 | 7.53k | bool revalidate_if_necessary(TreeIterator* it) { | 597 | 7.53k | GOOGLE_DCHECK(node_ != nullptr && m_ != nullptr); | 598 | | // Force bucket_index_ to be in range. | 599 | 7.53k | bucket_index_ &= (m_->num_buckets_ - 1); | 600 | | // Common case: the bucket we think is relevant points to node_. | 601 | 7.53k | if (m_->table_[bucket_index_] == static_cast<void*>(node_)) return true; | 602 | | // Less common: the bucket is a linked list with node_ somewhere in it, | 603 | | // but not at the head. | 604 | 1.12k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 605 | 1.12k | Node* l = static_cast<Node*>(m_->table_[bucket_index_]); | 606 | 1.32k | while ((l = l->next) != nullptr) { | 607 | 1.32k | if (l == node_) { | 608 | 1.12k | return true; | 609 | 1.12k | } | 610 | 1.32k | } | 611 | 1.12k | } | 612 | | // Well, bucket_index_ still might be correct, but probably | 613 | | // not. Revalidate just to be sure. This case is rare enough that we | 614 | | // don't worry about potential optimizations, such as having a custom | 615 | | // find-like method that compares Node* instead of the key. | 616 | 0 | iterator_base i(m_->find(node_->kv.first, it)); | 617 | 0 | bucket_index_ = i.bucket_index_; | 618 | 0 | return m_->TableEntryIsList(bucket_index_); | 619 | 1.12k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::revalidate_if_necessary(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) Line | Count | Source | 596 | 18.0k | bool revalidate_if_necessary(TreeIterator* it) { | 597 | 18.0k | GOOGLE_DCHECK(node_ != nullptr && m_ != nullptr); | 598 | | // Force bucket_index_ to be in range. | 599 | 18.0k | bucket_index_ &= (m_->num_buckets_ - 1); | 600 | | // Common case: the bucket we think is relevant points to node_. | 601 | 18.0k | if (m_->table_[bucket_index_] == static_cast<void*>(node_)) return true; | 602 | | // Less common: the bucket is a linked list with node_ somewhere in it, | 603 | | // but not at the head. | 604 | 2.54k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 605 | 2.54k | Node* l = static_cast<Node*>(m_->table_[bucket_index_]); | 606 | 2.54k | while ((l = l->next) != nullptr) { | 607 | 2.54k | if (l == node_) { | 608 | 2.54k | return true; | 609 | 2.54k | } | 610 | 2.54k | } | 611 | 2.54k | } | 612 | | // Well, bucket_index_ still might be correct, but probably | 613 | | // not. Revalidate just to be sure. This case is rare enough that we | 614 | | // don't worry about potential optimizations, such as having a custom | 615 | | // find-like method that compares Node* instead of the key. | 616 | 0 | iterator_base i(m_->find(node_->kv.first, it)); | 617 | 0 | bucket_index_ = i.bucket_index_; | 618 | 0 | return m_->TableEntryIsList(bucket_index_); | 619 | 2.54k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::revalidate_if_necessary(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) Line | Count | Source | 596 | 16.9k | bool revalidate_if_necessary(TreeIterator* it) { | 597 | 16.9k | GOOGLE_DCHECK(node_ != nullptr && m_ != nullptr); | 598 | | // Force bucket_index_ to be in range. | 599 | 16.9k | bucket_index_ &= (m_->num_buckets_ - 1); | 600 | | // Common case: the bucket we think is relevant points to node_. | 601 | 16.9k | if (m_->table_[bucket_index_] == static_cast<void*>(node_)) return true; | 602 | | // Less common: the bucket is a linked list with node_ somewhere in it, | 603 | | // but not at the head. | 604 | 1.87k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 605 | 1.87k | Node* l = static_cast<Node*>(m_->table_[bucket_index_]); | 606 | 1.87k | while ((l = l->next) != nullptr) { | 607 | 1.87k | if (l == node_) { | 608 | 1.87k | return true; | 609 | 1.87k | } | 610 | 1.87k | } | 611 | 1.87k | } | 612 | | // Well, bucket_index_ still might be correct, but probably | 613 | | // not. Revalidate just to be sure. This case is rare enough that we | 614 | | // don't worry about potential optimizations, such as having a custom | 615 | | // find-like method that compares Node* instead of the key. | 616 | 0 | iterator_base i(m_->find(node_->kv.first, it)); | 617 | 0 | bucket_index_ = i.bucket_index_; | 618 | 0 | return m_->TableEntryIsList(bucket_index_); | 619 | 1.87k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>::revalidate_if_necessary(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) Line | Count | Source | 596 | 27.9k | bool revalidate_if_necessary(TreeIterator* it) { | 597 | 27.9k | GOOGLE_DCHECK(node_ != nullptr && m_ != nullptr); | 598 | | // Force bucket_index_ to be in range. | 599 | 27.9k | bucket_index_ &= (m_->num_buckets_ - 1); | 600 | | // Common case: the bucket we think is relevant points to node_. | 601 | 27.9k | if (m_->table_[bucket_index_] == static_cast<void*>(node_)) return true; | 602 | | // Less common: the bucket is a linked list with node_ somewhere in it, | 603 | | // but not at the head. | 604 | 2.43k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 605 | 2.43k | Node* l = static_cast<Node*>(m_->table_[bucket_index_]); | 606 | 2.85k | while ((l = l->next) != nullptr) { | 607 | 2.85k | if (l == node_) { | 608 | 2.43k | return true; | 609 | 2.43k | } | 610 | 2.85k | } | 611 | 2.43k | } | 612 | | // Well, bucket_index_ still might be correct, but probably | 613 | | // not. Revalidate just to be sure. This case is rare enough that we | 614 | | // don't worry about potential optimizations, such as having a custom | 615 | | // find-like method that compares Node* instead of the key. | 616 | 0 | iterator_base i(m_->find(node_->kv.first, it)); | 617 | 0 | bucket_index_ = i.bucket_index_; | 618 | 0 | return m_->TableEntryIsList(bucket_index_); | 619 | 2.43k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>::revalidate_if_necessary(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) Line | Count | Source | 596 | 15.2k | bool revalidate_if_necessary(TreeIterator* it) { | 597 | 15.2k | GOOGLE_DCHECK(node_ != nullptr && m_ != nullptr); | 598 | | // Force bucket_index_ to be in range. | 599 | 15.2k | bucket_index_ &= (m_->num_buckets_ - 1); | 600 | | // Common case: the bucket we think is relevant points to node_. | 601 | 15.2k | if (m_->table_[bucket_index_] == static_cast<void*>(node_)) return true; | 602 | | // Less common: the bucket is a linked list with node_ somewhere in it, | 603 | | // but not at the head. | 604 | 724 | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 605 | 724 | Node* l = static_cast<Node*>(m_->table_[bucket_index_]); | 606 | 807 | while ((l = l->next) != nullptr) { | 607 | 807 | if (l == node_) { | 608 | 724 | return true; | 609 | 724 | } | 610 | 807 | } | 611 | 724 | } | 612 | | // Well, bucket_index_ still might be correct, but probably | 613 | | // not. Revalidate just to be sure. This case is rare enough that we | 614 | | // don't worry about potential optimizations, such as having a custom | 615 | | // find-like method that compares Node* instead of the key. | 616 | 0 | iterator_base i(m_->find(node_->kv.first, it)); | 617 | 0 | bucket_index_ = i.bucket_index_; | 618 | 0 | return m_->TableEntryIsList(bucket_index_); | 619 | 724 | } |
|
620 | | |
621 | | Node* node_; |
622 | | const InnerMap* m_; |
623 | | size_type bucket_index_; |
624 | | }; |
625 | | |
626 | | public: |
627 | | using iterator = iterator_base<value_type>; |
628 | | using const_iterator = iterator_base<const value_type>; |
629 | | |
630 | 759k | Arena* arena() const { return alloc_.arena(); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::arena() const Line | Count | Source | 630 | 334k | Arena* arena() const { return alloc_.arena(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::arena() const Line | Count | Source | 630 | 115k | Arena* arena() const { return alloc_.arena(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::arena() const Line | Count | Source | 630 | 309k | Arena* arena() const { return alloc_.arena(); } |
|
631 | | |
632 | 413k | void Swap(InnerMap* other) { |
633 | 413k | std::swap(num_elements_, other->num_elements_); |
634 | 413k | std::swap(num_buckets_, other->num_buckets_); |
635 | 413k | std::swap(seed_, other->seed_); |
636 | 413k | std::swap(index_of_first_non_null_, other->index_of_first_non_null_); |
637 | 413k | std::swap(table_, other->table_); |
638 | 413k | std::swap(alloc_, other->alloc_); |
639 | 413k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Swap(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap*) Line | Count | Source | 632 | 26.2k | void Swap(InnerMap* other) { | 633 | 26.2k | std::swap(num_elements_, other->num_elements_); | 634 | 26.2k | std::swap(num_buckets_, other->num_buckets_); | 635 | 26.2k | std::swap(seed_, other->seed_); | 636 | 26.2k | std::swap(index_of_first_non_null_, other->index_of_first_non_null_); | 637 | 26.2k | std::swap(table_, other->table_); | 638 | 26.2k | std::swap(alloc_, other->alloc_); | 639 | 26.2k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Swap(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap*) Line | Count | Source | 632 | 193k | void Swap(InnerMap* other) { | 633 | 193k | std::swap(num_elements_, other->num_elements_); | 634 | 193k | std::swap(num_buckets_, other->num_buckets_); | 635 | 193k | std::swap(seed_, other->seed_); | 636 | 193k | std::swap(index_of_first_non_null_, other->index_of_first_non_null_); | 637 | 193k | std::swap(table_, other->table_); | 638 | 193k | std::swap(alloc_, other->alloc_); | 639 | 193k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Swap(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap*) Line | Count | Source | 632 | 193k | void Swap(InnerMap* other) { | 633 | 193k | std::swap(num_elements_, other->num_elements_); | 634 | 193k | std::swap(num_buckets_, other->num_buckets_); | 635 | 193k | std::swap(seed_, other->seed_); | 636 | 193k | std::swap(index_of_first_non_null_, other->index_of_first_non_null_); | 637 | 193k | std::swap(table_, other->table_); | 638 | 193k | std::swap(alloc_, other->alloc_); | 639 | 193k | } |
|
640 | | |
641 | | iterator begin() { return iterator(this); } |
642 | 218k | iterator end() { return iterator(); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::end() Line | Count | Source | 642 | 72.4k | iterator end() { return iterator(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::end() Line | Count | Source | 642 | 82.4k | iterator end() { return iterator(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::end() Line | Count | Source | 642 | 63.4k | iterator end() { return iterator(); } |
|
643 | 98.7k | const_iterator begin() const { return const_iterator(this); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::begin() const Line | Count | Source | 643 | 8.53k | const_iterator begin() const { return const_iterator(this); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::begin() const Line | Count | Source | 643 | 46.7k | const_iterator begin() const { return const_iterator(this); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::begin() const Line | Count | Source | 643 | 43.4k | const_iterator begin() const { return const_iterator(this); } |
|
644 | 637k | const_iterator end() const { return const_iterator(); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::end() const Line | Count | Source | 644 | 179k | const_iterator end() const { return const_iterator(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::end() const Line | Count | Source | 644 | 268k | const_iterator end() const { return const_iterator(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::end() const Line | Count | Source | 644 | 189k | const_iterator end() const { return const_iterator(); } |
|
645 | | |
646 | 91.4k | void clear() { |
647 | 630k | for (size_type b = 0; b < num_buckets_; b++) { |
648 | 539k | if (TableEntryIsNonEmptyList(b)) { |
649 | 92.9k | Node* node = static_cast<Node*>(table_[b]); |
650 | 92.9k | table_[b] = nullptr; |
651 | 103k | do { |
652 | 103k | Node* next = node->next; |
653 | 103k | DestroyNode(node); |
654 | 103k | node = next; |
655 | 103k | } while (node != nullptr); |
656 | 446k | } else if (TableEntryIsTree(b)) { |
657 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); |
658 | 0 | GOOGLE_DCHECK(table_[b] == table_[b + 1] && (b & 1) == 0); |
659 | 0 | table_[b] = table_[b + 1] = nullptr; |
660 | 0 | typename Tree::iterator tree_it = tree->begin(); |
661 | 0 | do { |
662 | 0 | Node* node = NodeFromTreeIterator(tree_it); |
663 | 0 | typename Tree::iterator next = tree_it; |
664 | 0 | ++next; |
665 | 0 | tree->erase(tree_it); |
666 | 0 | DestroyNode(node); |
667 | 0 | tree_it = next; |
668 | 0 | } while (tree_it != tree->end()); |
669 | 0 | DestroyTree(tree); |
670 | 0 | b++; |
671 | 0 | } |
672 | 539k | } |
673 | 91.4k | num_elements_ = 0; |
674 | 91.4k | index_of_first_non_null_ = num_buckets_; |
675 | 91.4k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::clear() Line | Count | Source | 646 | 29.4k | void clear() { | 647 | 152k | for (size_type b = 0; b < num_buckets_; b++) { | 648 | 122k | if (TableEntryIsNonEmptyList(b)) { | 649 | 22.4k | Node* node = static_cast<Node*>(table_[b]); | 650 | 22.4k | table_[b] = nullptr; | 651 | 26.1k | do { | 652 | 26.1k | Node* next = node->next; | 653 | 26.1k | DestroyNode(node); | 654 | 26.1k | node = next; | 655 | 26.1k | } while (node != nullptr); | 656 | 100k | } else if (TableEntryIsTree(b)) { | 657 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); | 658 | 0 | GOOGLE_DCHECK(table_[b] == table_[b + 1] && (b & 1) == 0); | 659 | 0 | table_[b] = table_[b + 1] = nullptr; | 660 | 0 | typename Tree::iterator tree_it = tree->begin(); | 661 | 0 | do { | 662 | 0 | Node* node = NodeFromTreeIterator(tree_it); | 663 | 0 | typename Tree::iterator next = tree_it; | 664 | 0 | ++next; | 665 | 0 | tree->erase(tree_it); | 666 | 0 | DestroyNode(node); | 667 | 0 | tree_it = next; | 668 | 0 | } while (tree_it != tree->end()); | 669 | 0 | DestroyTree(tree); | 670 | 0 | b++; | 671 | 0 | } | 672 | 122k | } | 673 | 29.4k | num_elements_ = 0; | 674 | 29.4k | index_of_first_non_null_ = num_buckets_; | 675 | 29.4k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::clear() Line | Count | Source | 646 | 36.5k | void clear() { | 647 | 291k | for (size_type b = 0; b < num_buckets_; b++) { | 648 | 254k | if (TableEntryIsNonEmptyList(b)) { | 649 | 41.6k | Node* node = static_cast<Node*>(table_[b]); | 650 | 41.6k | table_[b] = nullptr; | 651 | 45.4k | do { | 652 | 45.4k | Node* next = node->next; | 653 | 45.4k | DestroyNode(node); | 654 | 45.4k | node = next; | 655 | 45.4k | } while (node != nullptr); | 656 | 213k | } else if (TableEntryIsTree(b)) { | 657 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); | 658 | 0 | GOOGLE_DCHECK(table_[b] == table_[b + 1] && (b & 1) == 0); | 659 | 0 | table_[b] = table_[b + 1] = nullptr; | 660 | 0 | typename Tree::iterator tree_it = tree->begin(); | 661 | 0 | do { | 662 | 0 | Node* node = NodeFromTreeIterator(tree_it); | 663 | 0 | typename Tree::iterator next = tree_it; | 664 | 0 | ++next; | 665 | 0 | tree->erase(tree_it); | 666 | 0 | DestroyNode(node); | 667 | 0 | tree_it = next; | 668 | 0 | } while (tree_it != tree->end()); | 669 | 0 | DestroyTree(tree); | 670 | 0 | b++; | 671 | 0 | } | 672 | 254k | } | 673 | 36.5k | num_elements_ = 0; | 674 | 36.5k | index_of_first_non_null_ = num_buckets_; | 675 | 36.5k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::clear() Line | Count | Source | 646 | 25.4k | void clear() { | 647 | 187k | for (size_type b = 0; b < num_buckets_; b++) { | 648 | 161k | if (TableEntryIsNonEmptyList(b)) { | 649 | 28.9k | Node* node = static_cast<Node*>(table_[b]); | 650 | 28.9k | table_[b] = nullptr; | 651 | 31.8k | do { | 652 | 31.8k | Node* next = node->next; | 653 | 31.8k | DestroyNode(node); | 654 | 31.8k | node = next; | 655 | 31.8k | } while (node != nullptr); | 656 | 132k | } else if (TableEntryIsTree(b)) { | 657 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); | 658 | 0 | GOOGLE_DCHECK(table_[b] == table_[b + 1] && (b & 1) == 0); | 659 | 0 | table_[b] = table_[b + 1] = nullptr; | 660 | 0 | typename Tree::iterator tree_it = tree->begin(); | 661 | 0 | do { | 662 | 0 | Node* node = NodeFromTreeIterator(tree_it); | 663 | 0 | typename Tree::iterator next = tree_it; | 664 | 0 | ++next; | 665 | 0 | tree->erase(tree_it); | 666 | 0 | DestroyNode(node); | 667 | 0 | tree_it = next; | 668 | 0 | } while (tree_it != tree->end()); | 669 | 0 | DestroyTree(tree); | 670 | 0 | b++; | 671 | 0 | } | 672 | 161k | } | 673 | 25.4k | num_elements_ = 0; | 674 | 25.4k | index_of_first_non_null_ = num_buckets_; | 675 | 25.4k | } |
|
676 | | |
677 | 635k | const hasher& hash_function() const { return *this; }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::hash_function() const Line | Count | Source | 677 | 229k | const hasher& hash_function() const { return *this; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::hash_function() const Line | Count | Source | 677 | 235k | const hasher& hash_function() const { return *this; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::hash_function() const Line | Count | Source | 677 | 170k | const hasher& hash_function() const { return *this; } |
|
678 | | |
679 | 58.7k | static size_type max_size() { |
680 | 58.7k | return static_cast<size_type>(1) << (sizeof(void**) >= 8 ? 60 : 28); |
681 | 58.7k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::max_size() Line | Count | Source | 679 | 10.6k | static size_type max_size() { | 680 | 10.6k | return static_cast<size_type>(1) << (sizeof(void**) >= 8 ? 60 : 28); | 681 | 10.6k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::max_size() Line | Count | Source | 679 | 29.3k | static size_type max_size() { | 680 | 29.3k | return static_cast<size_type>(1) << (sizeof(void**) >= 8 ? 60 : 28); | 681 | 29.3k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::max_size() Line | Count | Source | 679 | 18.7k | static size_type max_size() { | 680 | 18.7k | return static_cast<size_type>(1) << (sizeof(void**) >= 8 ? 60 : 28); | 681 | 18.7k | } |
|
682 | 400k | size_type size() const { return num_elements_; }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::size() const Line | Count | Source | 682 | 57.9k | size_type size() const { return num_elements_; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::size() const Line | Count | Source | 682 | 173k | size_type size() const { return num_elements_; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::size() const Line | Count | Source | 682 | 169k | size_type size() const { return num_elements_; } |
|
683 | | bool empty() const { return size() == 0; } |
684 | | |
685 | | template <typename K> |
686 | 218k | iterator find(const K& k) { |
687 | 218k | return iterator(FindHelper(k).first); |
688 | 218k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> > google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 686 | 72.4k | iterator find(const K& k) { | 687 | 72.4k | return iterator(FindHelper(k).first); | 688 | 72.4k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> > google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 686 | 82.4k | iterator find(const K& k) { | 687 | 82.4k | return iterator(FindHelper(k).first); | 688 | 82.4k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> > google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 686 | 63.4k | iterator find(const K& k) { | 687 | 63.4k | return iterator(FindHelper(k).first); | 688 | 63.4k | } |
|
689 | | |
690 | | template <typename K> |
691 | 74.3k | const_iterator find(const K& k) const { |
692 | 74.3k | return FindHelper(k).first; |
693 | 74.3k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 691 | 49.6k | const_iterator find(const K& k) const { | 692 | 49.6k | return FindHelper(k).first; | 693 | 49.6k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 691 | 16.2k | const_iterator find(const K& k) const { | 692 | 16.2k | return FindHelper(k).first; | 693 | 16.2k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 691 | 8.44k | const_iterator find(const K& k) const { | 692 | 8.44k | return FindHelper(k).first; | 693 | 8.44k | } |
|
694 | | |
695 | | // Inserts a new element into the container if there is no element with the |
696 | | // key in the container. |
697 | | // The new element is: |
698 | | // (1) Constructed in-place with the given args, if mapped_type is not |
699 | | // arena constructible. |
700 | | // (2) Constructed in-place with the arena and then assigned with a |
701 | | // mapped_type temporary constructed with the given args, otherwise. |
702 | | template <typename K, typename... Args> |
703 | 234k | std::pair<iterator, bool> try_emplace(K&& k, Args&&... args) { |
704 | 234k | return ArenaAwareTryEmplace(Arena::is_arena_constructable<mapped_type>(), |
705 | 234k | std::forward<K>(k), |
706 | 234k | std::forward<Args>(args)...); |
707 | 234k | } std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 703 | 8.86k | std::pair<iterator, bool> try_emplace(K&& k, Args&&... args) { | 704 | 8.86k | return ArenaAwareTryEmplace(Arena::is_arena_constructable<mapped_type>(), | 705 | 8.86k | std::forward<K>(k), | 706 | 8.86k | std::forward<Args>(args)...); | 707 | 8.86k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 703 | 68.4k | std::pair<iterator, bool> try_emplace(K&& k, Args&&... args) { | 704 | 68.4k | return ArenaAwareTryEmplace(Arena::is_arena_constructable<mapped_type>(), | 705 | 68.4k | std::forward<K>(k), | 706 | 68.4k | std::forward<Args>(args)...); | 707 | 68.4k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 703 | 1.33k | std::pair<iterator, bool> try_emplace(K&& k, Args&&... args) { | 704 | 1.33k | return ArenaAwareTryEmplace(Arena::is_arena_constructable<mapped_type>(), | 705 | 1.33k | std::forward<K>(k), | 706 | 1.33k | std::forward<Args>(args)...); | 707 | 1.33k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 703 | 1.98k | std::pair<iterator, bool> try_emplace(K&& k, Args&&... args) { | 704 | 1.98k | return ArenaAwareTryEmplace(Arena::is_arena_constructable<mapped_type>(), | 705 | 1.98k | std::forward<K>(k), | 706 | 1.98k | std::forward<Args>(args)...); | 707 | 1.98k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 703 | 89.6k | std::pair<iterator, bool> try_emplace(K&& k, Args&&... args) { | 704 | 89.6k | return ArenaAwareTryEmplace(Arena::is_arena_constructable<mapped_type>(), | 705 | 89.6k | std::forward<K>(k), | 706 | 89.6k | std::forward<Args>(args)...); | 707 | 89.6k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 703 | 64.7k | std::pair<iterator, bool> try_emplace(K&& k, Args&&... args) { | 704 | 64.7k | return ArenaAwareTryEmplace(Arena::is_arena_constructable<mapped_type>(), | 705 | 64.7k | std::forward<K>(k), | 706 | 64.7k | std::forward<Args>(args)...); | 707 | 64.7k | } |
Unexecuted instantiation: std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::NodeState const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::NodeState const&) Unexecuted instantiation: std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::DaemonState const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::DaemonState const&) Unexecuted instantiation: std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::SystemdUnitState const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::SystemdUnitState const&) |
708 | | |
709 | | // Inserts the key into the map, if not present. In that case, the value |
710 | | // will be value initialized. |
711 | | template <typename K> |
712 | | std::pair<iterator, bool> insert(K&& k) { |
713 | | return try_emplace(std::forward<K>(k)); |
714 | | } |
715 | | |
716 | | template <typename K> |
717 | 234k | value_type& operator[](K&& k) { |
718 | 234k | return *try_emplace(std::forward<K>(k)).first; |
719 | 234k | } google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 717 | 8.86k | value_type& operator[](K&& k) { | 718 | 8.86k | return *try_emplace(std::forward<K>(k)).first; | 719 | 8.86k | } |
google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 717 | 68.4k | value_type& operator[](K&& k) { | 718 | 68.4k | return *try_emplace(std::forward<K>(k)).first; | 719 | 68.4k | } |
google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 717 | 1.33k | value_type& operator[](K&& k) { | 718 | 1.33k | return *try_emplace(std::forward<K>(k)).first; | 719 | 1.33k | } |
google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 717 | 1.98k | value_type& operator[](K&& k) { | 718 | 1.98k | return *try_emplace(std::forward<K>(k)).first; | 719 | 1.98k | } |
google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 717 | 89.6k | value_type& operator[](K&& k) { | 718 | 89.6k | return *try_emplace(std::forward<K>(k)).first; | 719 | 89.6k | } |
google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 717 | 64.7k | value_type& operator[](K&& k) { | 718 | 64.7k | return *try_emplace(std::forward<K>(k)).first; | 719 | 64.7k | } |
|
720 | | |
721 | 30.0k | void erase(iterator it) { |
722 | 30.0k | GOOGLE_DCHECK_EQ(it.m_, this); |
723 | 30.0k | typename Tree::iterator tree_it; |
724 | 30.0k | const bool is_list = it.revalidate_if_necessary(&tree_it); |
725 | 30.0k | size_type b = it.bucket_index_; |
726 | 30.0k | Node* const item = it.node_; |
727 | 30.0k | if (is_list) { |
728 | 30.0k | GOOGLE_DCHECK(TableEntryIsNonEmptyList(b)); |
729 | 30.0k | Node* head = static_cast<Node*>(table_[b]); |
730 | 30.0k | head = EraseFromLinkedList(item, head); |
731 | 30.0k | table_[b] = static_cast<void*>(head); |
732 | 30.0k | } else { |
733 | 0 | GOOGLE_DCHECK(TableEntryIsTree(b)); |
734 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); |
735 | 0 | tree->erase(tree_it); |
736 | 0 | if (tree->empty()) { |
737 | | // Force b to be the minimum of b and b ^ 1. This is important |
738 | | // only because we want index_of_first_non_null_ to be correct. |
739 | 0 | b &= ~static_cast<size_type>(1); |
740 | 0 | DestroyTree(tree); |
741 | 0 | table_[b] = table_[b + 1] = nullptr; |
742 | 0 | } |
743 | 0 | } |
744 | 30.0k | DestroyNode(item); |
745 | 30.0k | --num_elements_; |
746 | 30.0k | if (PROTOBUF_PREDICT_FALSE(b == index_of_first_non_null_)) { |
747 | 27.9k | while (index_of_first_non_null_ < num_buckets_ && |
748 | 26.0k | table_[index_of_first_non_null_] == nullptr) { |
749 | 19.3k | ++index_of_first_non_null_; |
750 | 19.3k | } |
751 | 8.59k | } |
752 | 30.0k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::erase(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >) Line | Count | Source | 721 | 10.8k | void erase(iterator it) { | 722 | 10.8k | GOOGLE_DCHECK_EQ(it.m_, this); | 723 | 10.8k | typename Tree::iterator tree_it; | 724 | 10.8k | const bool is_list = it.revalidate_if_necessary(&tree_it); | 725 | 10.8k | size_type b = it.bucket_index_; | 726 | 10.8k | Node* const item = it.node_; | 727 | 10.8k | if (is_list) { | 728 | 10.8k | GOOGLE_DCHECK(TableEntryIsNonEmptyList(b)); | 729 | 10.8k | Node* head = static_cast<Node*>(table_[b]); | 730 | 10.8k | head = EraseFromLinkedList(item, head); | 731 | 10.8k | table_[b] = static_cast<void*>(head); | 732 | 10.8k | } else { | 733 | 0 | GOOGLE_DCHECK(TableEntryIsTree(b)); | 734 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); | 735 | 0 | tree->erase(tree_it); | 736 | 0 | if (tree->empty()) { | 737 | | // Force b to be the minimum of b and b ^ 1. This is important | 738 | | // only because we want index_of_first_non_null_ to be correct. | 739 | 0 | b &= ~static_cast<size_type>(1); | 740 | 0 | DestroyTree(tree); | 741 | 0 | table_[b] = table_[b + 1] = nullptr; | 742 | 0 | } | 743 | 0 | } | 744 | 10.8k | DestroyNode(item); | 745 | 10.8k | --num_elements_; | 746 | 10.8k | if (PROTOBUF_PREDICT_FALSE(b == index_of_first_non_null_)) { | 747 | 7.51k | while (index_of_first_non_null_ < num_buckets_ && | 748 | 7.21k | table_[index_of_first_non_null_] == nullptr) { | 749 | 4.61k | ++index_of_first_non_null_; | 750 | 4.61k | } | 751 | 2.90k | } | 752 | 10.8k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::erase(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >) Line | Count | Source | 721 | 10.0k | void erase(iterator it) { | 722 | 10.0k | GOOGLE_DCHECK_EQ(it.m_, this); | 723 | 10.0k | typename Tree::iterator tree_it; | 724 | 10.0k | const bool is_list = it.revalidate_if_necessary(&tree_it); | 725 | 10.0k | size_type b = it.bucket_index_; | 726 | 10.0k | Node* const item = it.node_; | 727 | 10.0k | if (is_list) { | 728 | 10.0k | GOOGLE_DCHECK(TableEntryIsNonEmptyList(b)); | 729 | 10.0k | Node* head = static_cast<Node*>(table_[b]); | 730 | 10.0k | head = EraseFromLinkedList(item, head); | 731 | 10.0k | table_[b] = static_cast<void*>(head); | 732 | 10.0k | } else { | 733 | 0 | GOOGLE_DCHECK(TableEntryIsTree(b)); | 734 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); | 735 | 0 | tree->erase(tree_it); | 736 | 0 | if (tree->empty()) { | 737 | | // Force b to be the minimum of b and b ^ 1. This is important | 738 | | // only because we want index_of_first_non_null_ to be correct. | 739 | 0 | b &= ~static_cast<size_type>(1); | 740 | 0 | DestroyTree(tree); | 741 | 0 | table_[b] = table_[b + 1] = nullptr; | 742 | 0 | } | 743 | 0 | } | 744 | 10.0k | DestroyNode(item); | 745 | 10.0k | --num_elements_; | 746 | 10.0k | if (PROTOBUF_PREDICT_FALSE(b == index_of_first_non_null_)) { | 747 | 8.65k | while (index_of_first_non_null_ < num_buckets_ && | 748 | 7.81k | table_[index_of_first_non_null_] == nullptr) { | 749 | 6.40k | ++index_of_first_non_null_; | 750 | 6.40k | } | 751 | 2.25k | } | 752 | 10.0k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::erase(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >) Line | Count | Source | 721 | 9.21k | void erase(iterator it) { | 722 | 9.21k | GOOGLE_DCHECK_EQ(it.m_, this); | 723 | 9.21k | typename Tree::iterator tree_it; | 724 | 9.21k | const bool is_list = it.revalidate_if_necessary(&tree_it); | 725 | 9.21k | size_type b = it.bucket_index_; | 726 | 9.21k | Node* const item = it.node_; | 727 | 9.21k | if (is_list) { | 728 | 9.21k | GOOGLE_DCHECK(TableEntryIsNonEmptyList(b)); | 729 | 9.21k | Node* head = static_cast<Node*>(table_[b]); | 730 | 9.21k | head = EraseFromLinkedList(item, head); | 731 | 9.21k | table_[b] = static_cast<void*>(head); | 732 | 9.21k | } else { | 733 | 0 | GOOGLE_DCHECK(TableEntryIsTree(b)); | 734 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); | 735 | 0 | tree->erase(tree_it); | 736 | 0 | if (tree->empty()) { | 737 | | // Force b to be the minimum of b and b ^ 1. This is important | 738 | | // only because we want index_of_first_non_null_ to be correct. | 739 | 0 | b &= ~static_cast<size_type>(1); | 740 | 0 | DestroyTree(tree); | 741 | 0 | table_[b] = table_[b + 1] = nullptr; | 742 | 0 | } | 743 | 0 | } | 744 | 9.21k | DestroyNode(item); | 745 | 9.21k | --num_elements_; | 746 | 9.21k | if (PROTOBUF_PREDICT_FALSE(b == index_of_first_non_null_)) { | 747 | 11.7k | while (index_of_first_non_null_ < num_buckets_ && | 748 | 10.9k | table_[index_of_first_non_null_] == nullptr) { | 749 | 8.32k | ++index_of_first_non_null_; | 750 | 8.32k | } | 751 | 3.44k | } | 752 | 9.21k | } |
|
753 | | |
754 | 0 | size_t SpaceUsedInternal() const { |
755 | 0 | return internal::SpaceUsedInTable<Key>(table_, num_buckets_, |
756 | 0 | num_elements_, sizeof(Node)); |
757 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::SpaceUsedInternal() const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::SpaceUsedInternal() const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::SpaceUsedInternal() const |
758 | | |
759 | | private: |
760 | | template <typename K, typename... Args> |
761 | 234k | std::pair<iterator, bool> TryEmplaceInternal(K&& k, Args&&... args) { |
762 | 234k | std::pair<const_iterator, size_type> p = FindHelper(k); |
763 | | // Case 1: key was already present. |
764 | 234k | if (p.first.node_ != nullptr) |
765 | 101k | return std::make_pair(iterator(p.first), false); |
766 | | // Case 2: insert. |
767 | 133k | if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) { |
768 | 58.7k | p = FindHelper(k); |
769 | 58.7k | } |
770 | 133k | const size_type b = p.second; // bucket number |
771 | | // If K is not key_type, make the conversion to key_type explicit. |
772 | 133k | using TypeToInit = typename std::conditional< |
773 | 133k | std::is_same<typename std::decay<K>::type, key_type>::value, K&&, |
774 | 133k | key_type>::type; |
775 | 133k | Node* node = Alloc<Node>(1); |
776 | | // Even when arena is nullptr, CreateInArenaStorage is still used to |
777 | | // ensure the arena of submessage will be consistent. Otherwise, |
778 | | // submessage may have its own arena when message-owned arena is enabled. |
779 | | // Note: This only works if `Key` is not arena constructible. |
780 | 133k | Arena::CreateInArenaStorage(const_cast<Key*>(&node->kv.first), |
781 | 133k | alloc_.arena(), |
782 | 133k | static_cast<TypeToInit>(std::forward<K>(k))); |
783 | | // Note: if `T` is arena constructible, `Args` needs to be empty. |
784 | 133k | Arena::CreateInArenaStorage(&node->kv.second, alloc_.arena(), |
785 | 133k | std::forward<Args>(args)...); |
786 | | |
787 | 133k | iterator result = InsertUnique(b, node); |
788 | 133k | ++num_elements_; |
789 | 133k | return std::make_pair(result, true); |
790 | 234k | } std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TryEmplaceInternal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 761 | 8.86k | std::pair<iterator, bool> TryEmplaceInternal(K&& k, Args&&... args) { | 762 | 8.86k | std::pair<const_iterator, size_type> p = FindHelper(k); | 763 | | // Case 1: key was already present. | 764 | 8.86k | if (p.first.node_ != nullptr) | 765 | 0 | return std::make_pair(iterator(p.first), false); | 766 | | // Case 2: insert. | 767 | 8.86k | if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) { | 768 | 3.49k | p = FindHelper(k); | 769 | 3.49k | } | 770 | 8.86k | const size_type b = p.second; // bucket number | 771 | | // If K is not key_type, make the conversion to key_type explicit. | 772 | 8.86k | using TypeToInit = typename std::conditional< | 773 | 8.86k | std::is_same<typename std::decay<K>::type, key_type>::value, K&&, | 774 | 8.86k | key_type>::type; | 775 | 8.86k | Node* node = Alloc<Node>(1); | 776 | | // Even when arena is nullptr, CreateInArenaStorage is still used to | 777 | | // ensure the arena of submessage will be consistent. Otherwise, | 778 | | // submessage may have its own arena when message-owned arena is enabled. | 779 | | // Note: This only works if `Key` is not arena constructible. | 780 | 8.86k | Arena::CreateInArenaStorage(const_cast<Key*>(&node->kv.first), | 781 | 8.86k | alloc_.arena(), | 782 | 8.86k | static_cast<TypeToInit>(std::forward<K>(k))); | 783 | | // Note: if `T` is arena constructible, `Args` needs to be empty. | 784 | 8.86k | Arena::CreateInArenaStorage(&node->kv.second, alloc_.arena(), | 785 | 8.86k | std::forward<Args>(args)...); | 786 | | | 787 | 8.86k | iterator result = InsertUnique(b, node); | 788 | 8.86k | ++num_elements_; | 789 | 8.86k | return std::make_pair(result, true); | 790 | 8.86k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TryEmplaceInternal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 761 | 68.4k | std::pair<iterator, bool> TryEmplaceInternal(K&& k, Args&&... args) { | 762 | 68.4k | std::pair<const_iterator, size_type> p = FindHelper(k); | 763 | | // Case 1: key was already present. | 764 | 68.4k | if (p.first.node_ != nullptr) | 765 | 40.3k | return std::make_pair(iterator(p.first), false); | 766 | | // Case 2: insert. | 767 | 28.0k | if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) { | 768 | 7.16k | p = FindHelper(k); | 769 | 7.16k | } | 770 | 28.0k | const size_type b = p.second; // bucket number | 771 | | // If K is not key_type, make the conversion to key_type explicit. | 772 | 28.0k | using TypeToInit = typename std::conditional< | 773 | 28.0k | std::is_same<typename std::decay<K>::type, key_type>::value, K&&, | 774 | 28.0k | key_type>::type; | 775 | 28.0k | Node* node = Alloc<Node>(1); | 776 | | // Even when arena is nullptr, CreateInArenaStorage is still used to | 777 | | // ensure the arena of submessage will be consistent. Otherwise, | 778 | | // submessage may have its own arena when message-owned arena is enabled. | 779 | | // Note: This only works if `Key` is not arena constructible. | 780 | 28.0k | Arena::CreateInArenaStorage(const_cast<Key*>(&node->kv.first), | 781 | 28.0k | alloc_.arena(), | 782 | 28.0k | static_cast<TypeToInit>(std::forward<K>(k))); | 783 | | // Note: if `T` is arena constructible, `Args` needs to be empty. | 784 | 28.0k | Arena::CreateInArenaStorage(&node->kv.second, alloc_.arena(), | 785 | 28.0k | std::forward<Args>(args)...); | 786 | | | 787 | 28.0k | iterator result = InsertUnique(b, node); | 788 | 28.0k | ++num_elements_; | 789 | 28.0k | return std::make_pair(result, true); | 790 | 68.4k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TryEmplaceInternal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 761 | 1.33k | std::pair<iterator, bool> TryEmplaceInternal(K&& k, Args&&... args) { | 762 | 1.33k | std::pair<const_iterator, size_type> p = FindHelper(k); | 763 | | // Case 1: key was already present. | 764 | 1.33k | if (p.first.node_ != nullptr) | 765 | 0 | return std::make_pair(iterator(p.first), false); | 766 | | // Case 2: insert. | 767 | 1.33k | if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) { | 768 | 1.03k | p = FindHelper(k); | 769 | 1.03k | } | 770 | 1.33k | const size_type b = p.second; // bucket number | 771 | | // If K is not key_type, make the conversion to key_type explicit. | 772 | 1.33k | using TypeToInit = typename std::conditional< | 773 | 1.33k | std::is_same<typename std::decay<K>::type, key_type>::value, K&&, | 774 | 1.33k | key_type>::type; | 775 | 1.33k | Node* node = Alloc<Node>(1); | 776 | | // Even when arena is nullptr, CreateInArenaStorage is still used to | 777 | | // ensure the arena of submessage will be consistent. Otherwise, | 778 | | // submessage may have its own arena when message-owned arena is enabled. | 779 | | // Note: This only works if `Key` is not arena constructible. | 780 | 1.33k | Arena::CreateInArenaStorage(const_cast<Key*>(&node->kv.first), | 781 | 1.33k | alloc_.arena(), | 782 | 1.33k | static_cast<TypeToInit>(std::forward<K>(k))); | 783 | | // Note: if `T` is arena constructible, `Args` needs to be empty. | 784 | 1.33k | Arena::CreateInArenaStorage(&node->kv.second, alloc_.arena(), | 785 | 1.33k | std::forward<Args>(args)...); | 786 | | | 787 | 1.33k | iterator result = InsertUnique(b, node); | 788 | 1.33k | ++num_elements_; | 789 | 1.33k | return std::make_pair(result, true); | 790 | 1.33k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TryEmplaceInternal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 761 | 1.98k | std::pair<iterator, bool> TryEmplaceInternal(K&& k, Args&&... args) { | 762 | 1.98k | std::pair<const_iterator, size_type> p = FindHelper(k); | 763 | | // Case 1: key was already present. | 764 | 1.98k | if (p.first.node_ != nullptr) | 765 | 0 | return std::make_pair(iterator(p.first), false); | 766 | | // Case 2: insert. | 767 | 1.98k | if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) { | 768 | 1.05k | p = FindHelper(k); | 769 | 1.05k | } | 770 | 1.98k | const size_type b = p.second; // bucket number | 771 | | // If K is not key_type, make the conversion to key_type explicit. | 772 | 1.98k | using TypeToInit = typename std::conditional< | 773 | 1.98k | std::is_same<typename std::decay<K>::type, key_type>::value, K&&, | 774 | 1.98k | key_type>::type; | 775 | 1.98k | Node* node = Alloc<Node>(1); | 776 | | // Even when arena is nullptr, CreateInArenaStorage is still used to | 777 | | // ensure the arena of submessage will be consistent. Otherwise, | 778 | | // submessage may have its own arena when message-owned arena is enabled. | 779 | | // Note: This only works if `Key` is not arena constructible. | 780 | 1.98k | Arena::CreateInArenaStorage(const_cast<Key*>(&node->kv.first), | 781 | 1.98k | alloc_.arena(), | 782 | 1.98k | static_cast<TypeToInit>(std::forward<K>(k))); | 783 | | // Note: if `T` is arena constructible, `Args` needs to be empty. | 784 | 1.98k | Arena::CreateInArenaStorage(&node->kv.second, alloc_.arena(), | 785 | 1.98k | std::forward<Args>(args)...); | 786 | | | 787 | 1.98k | iterator result = InsertUnique(b, node); | 788 | 1.98k | ++num_elements_; | 789 | 1.98k | return std::make_pair(result, true); | 790 | 1.98k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TryEmplaceInternal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 761 | 89.6k | std::pair<iterator, bool> TryEmplaceInternal(K&& k, Args&&... args) { | 762 | 89.6k | std::pair<const_iterator, size_type> p = FindHelper(k); | 763 | | // Case 1: key was already present. | 764 | 89.6k | if (p.first.node_ != nullptr) | 765 | 35.4k | return std::make_pair(iterator(p.first), false); | 766 | | // Case 2: insert. | 767 | 54.1k | if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) { | 768 | 28.2k | p = FindHelper(k); | 769 | 28.2k | } | 770 | 54.1k | const size_type b = p.second; // bucket number | 771 | | // If K is not key_type, make the conversion to key_type explicit. | 772 | 54.1k | using TypeToInit = typename std::conditional< | 773 | 54.1k | std::is_same<typename std::decay<K>::type, key_type>::value, K&&, | 774 | 54.1k | key_type>::type; | 775 | 54.1k | Node* node = Alloc<Node>(1); | 776 | | // Even when arena is nullptr, CreateInArenaStorage is still used to | 777 | | // ensure the arena of submessage will be consistent. Otherwise, | 778 | | // submessage may have its own arena when message-owned arena is enabled. | 779 | | // Note: This only works if `Key` is not arena constructible. | 780 | 54.1k | Arena::CreateInArenaStorage(const_cast<Key*>(&node->kv.first), | 781 | 54.1k | alloc_.arena(), | 782 | 54.1k | static_cast<TypeToInit>(std::forward<K>(k))); | 783 | | // Note: if `T` is arena constructible, `Args` needs to be empty. | 784 | 54.1k | Arena::CreateInArenaStorage(&node->kv.second, alloc_.arena(), | 785 | 54.1k | std::forward<Args>(args)...); | 786 | | | 787 | 54.1k | iterator result = InsertUnique(b, node); | 788 | 54.1k | ++num_elements_; | 789 | 54.1k | return std::make_pair(result, true); | 790 | 89.6k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TryEmplaceInternal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 761 | 64.7k | std::pair<iterator, bool> TryEmplaceInternal(K&& k, Args&&... args) { | 762 | 64.7k | std::pair<const_iterator, size_type> p = FindHelper(k); | 763 | | // Case 1: key was already present. | 764 | 64.7k | if (p.first.node_ != nullptr) | 765 | 25.6k | return std::make_pair(iterator(p.first), false); | 766 | | // Case 2: insert. | 767 | 39.0k | if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) { | 768 | 17.7k | p = FindHelper(k); | 769 | 17.7k | } | 770 | 39.0k | const size_type b = p.second; // bucket number | 771 | | // If K is not key_type, make the conversion to key_type explicit. | 772 | 39.0k | using TypeToInit = typename std::conditional< | 773 | 39.0k | std::is_same<typename std::decay<K>::type, key_type>::value, K&&, | 774 | 39.0k | key_type>::type; | 775 | 39.0k | Node* node = Alloc<Node>(1); | 776 | | // Even when arena is nullptr, CreateInArenaStorage is still used to | 777 | | // ensure the arena of submessage will be consistent. Otherwise, | 778 | | // submessage may have its own arena when message-owned arena is enabled. | 779 | | // Note: This only works if `Key` is not arena constructible. | 780 | 39.0k | Arena::CreateInArenaStorage(const_cast<Key*>(&node->kv.first), | 781 | 39.0k | alloc_.arena(), | 782 | 39.0k | static_cast<TypeToInit>(std::forward<K>(k))); | 783 | | // Note: if `T` is arena constructible, `Args` needs to be empty. | 784 | 39.0k | Arena::CreateInArenaStorage(&node->kv.second, alloc_.arena(), | 785 | 39.0k | std::forward<Args>(args)...); | 786 | | | 787 | 39.0k | iterator result = InsertUnique(b, node); | 788 | 39.0k | ++num_elements_; | 789 | 39.0k | return std::make_pair(result, true); | 790 | 64.7k | } |
|
791 | | |
792 | | // A helper function to perform an assignment of `mapped_type`. |
793 | | // If the first argument is true, then it is a regular assignment. |
794 | | // Otherwise, we first create a temporary and then perform an assignment. |
795 | | template <typename V> |
796 | 0 | static void AssignMapped(std::true_type, mapped_type& mapped, V&& v) { |
797 | 0 | mapped = std::forward<V>(v); |
798 | 0 | } Unexecuted instantiation: void google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::AssignMapped<safepower_agent_proto::NodeState const&>(std::__1::integral_constant<bool, true>, safepower_agent_proto::NodeState&, safepower_agent_proto::NodeState const&) Unexecuted instantiation: void google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::AssignMapped<safepower_agent_proto::DaemonState const&>(std::__1::integral_constant<bool, true>, safepower_agent_proto::DaemonState&, safepower_agent_proto::DaemonState const&) Unexecuted instantiation: void google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::AssignMapped<safepower_agent_proto::SystemdUnitState const&>(std::__1::integral_constant<bool, true>, safepower_agent_proto::SystemdUnitState&, safepower_agent_proto::SystemdUnitState const&) |
799 | | template <typename... Args> |
800 | | static void AssignMapped(std::false_type, mapped_type& mapped, |
801 | | Args&&... args) { |
802 | | mapped = mapped_type(std::forward<Args>(args)...); |
803 | | } |
804 | | |
805 | | // Case 1: `mapped_type` is arena constructible. A temporary object is |
806 | | // created and then (if `Args` are not empty) assigned to a mapped value |
807 | | // that was created with the arena. |
808 | | template <typename K> |
809 | 234k | std::pair<iterator, bool> ArenaAwareTryEmplace(std::true_type, K&& k) { |
810 | | // case 1.1: "default" constructed (e.g. from arena only). |
811 | 234k | return TryEmplaceInternal(std::forward<K>(k)); |
812 | 234k | } std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::ArenaAwareTryEmplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::integral_constant<bool, true>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 809 | 8.86k | std::pair<iterator, bool> ArenaAwareTryEmplace(std::true_type, K&& k) { | 810 | | // case 1.1: "default" constructed (e.g. from arena only). | 811 | 8.86k | return TryEmplaceInternal(std::forward<K>(k)); | 812 | 8.86k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::ArenaAwareTryEmplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::integral_constant<bool, true>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 809 | 68.4k | std::pair<iterator, bool> ArenaAwareTryEmplace(std::true_type, K&& k) { | 810 | | // case 1.1: "default" constructed (e.g. from arena only). | 811 | 68.4k | return TryEmplaceInternal(std::forward<K>(k)); | 812 | 68.4k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::ArenaAwareTryEmplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::integral_constant<bool, true>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 809 | 1.33k | std::pair<iterator, bool> ArenaAwareTryEmplace(std::true_type, K&& k) { | 810 | | // case 1.1: "default" constructed (e.g. from arena only). | 811 | 1.33k | return TryEmplaceInternal(std::forward<K>(k)); | 812 | 1.33k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::ArenaAwareTryEmplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::integral_constant<bool, true>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 809 | 1.98k | std::pair<iterator, bool> ArenaAwareTryEmplace(std::true_type, K&& k) { | 810 | | // case 1.1: "default" constructed (e.g. from arena only). | 811 | 1.98k | return TryEmplaceInternal(std::forward<K>(k)); | 812 | 1.98k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::ArenaAwareTryEmplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::integral_constant<bool, true>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 809 | 89.6k | std::pair<iterator, bool> ArenaAwareTryEmplace(std::true_type, K&& k) { | 810 | | // case 1.1: "default" constructed (e.g. from arena only). | 811 | 89.6k | return TryEmplaceInternal(std::forward<K>(k)); | 812 | 89.6k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::ArenaAwareTryEmplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::integral_constant<bool, true>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 809 | 64.7k | std::pair<iterator, bool> ArenaAwareTryEmplace(std::true_type, K&& k) { | 810 | | // case 1.1: "default" constructed (e.g. from arena only). | 811 | 64.7k | return TryEmplaceInternal(std::forward<K>(k)); | 812 | 64.7k | } |
|
813 | | template <typename K, typename... Args> |
814 | | std::pair<iterator, bool> ArenaAwareTryEmplace(std::true_type, K&& k, |
815 | 0 | Args&&... args) { |
816 | | // case 1.2: "default" constructed + copy/move assignment |
817 | 0 | auto p = TryEmplaceInternal(std::forward<K>(k)); |
818 | 0 | if (p.second) { |
819 | 0 | AssignMapped(std::is_same<void(typename std::decay<Args>::type...), |
820 | 0 | void(mapped_type)>(), |
821 | 0 | p.first->second, std::forward<Args>(args)...); |
822 | 0 | } |
823 | 0 | return p; |
824 | 0 | } Unexecuted instantiation: std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::ArenaAwareTryEmplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::NodeState const&>(std::__1::integral_constant<bool, true>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::NodeState const&) Unexecuted instantiation: std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::ArenaAwareTryEmplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::DaemonState const&>(std::__1::integral_constant<bool, true>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::DaemonState const&) Unexecuted instantiation: std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::ArenaAwareTryEmplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::SystemdUnitState const&>(std::__1::integral_constant<bool, true>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::SystemdUnitState const&) |
825 | | // Case 2: `mapped_type` is not arena constructible. Using in-place |
826 | | // construction. |
827 | | template <typename... Args> |
828 | | std::pair<iterator, bool> ArenaAwareTryEmplace(std::false_type, |
829 | | Args&&... args) { |
830 | | return TryEmplaceInternal(std::forward<Args>(args)...); |
831 | | } |
832 | | |
833 | 0 | const_iterator find(const Key& k, TreeIterator* it) const { |
834 | 0 | return FindHelper(k, it).first; |
835 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::find(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::find(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::find(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) const |
836 | | template <typename K> |
837 | 586k | std::pair<const_iterator, size_type> FindHelper(const K& k) const { |
838 | 586k | return FindHelper(k, nullptr); |
839 | 586k | } std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>, unsigned long> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::FindHelper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 837 | 210k | std::pair<const_iterator, size_type> FindHelper(const K& k) const { | 838 | 210k | return FindHelper(k, nullptr); | 839 | 210k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>, unsigned long> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::FindHelper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 837 | 218k | std::pair<const_iterator, size_type> FindHelper(const K& k) const { | 838 | 218k | return FindHelper(k, nullptr); | 839 | 218k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>, unsigned long> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::FindHelper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 837 | 157k | std::pair<const_iterator, size_type> FindHelper(const K& k) const { | 838 | 157k | return FindHelper(k, nullptr); | 839 | 157k | } |
|
840 | | template <typename K> |
841 | | std::pair<const_iterator, size_type> FindHelper(const K& k, |
842 | 586k | TreeIterator* it) const { |
843 | 586k | size_type b = BucketNumber(k); |
844 | 586k | if (TableEntryIsNonEmptyList(b)) { |
845 | 243k | Node* node = static_cast<Node*>(table_[b]); |
846 | 274k | do { |
847 | 274k | if (internal::TransparentSupport<Key>::Equals(node->kv.first, k)) { |
848 | 181k | return std::make_pair(const_iterator(node, this, b), b); |
849 | 181k | } else { |
850 | 92.9k | node = node->next; |
851 | 92.9k | } |
852 | 274k | } while (node != nullptr); |
853 | 343k | } else if (TableEntryIsTree(b)) { |
854 | 0 | GOOGLE_DCHECK_EQ(table_[b], table_[b ^ 1]); |
855 | 0 | b &= ~static_cast<size_t>(1); |
856 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); |
857 | 0 | auto tree_it = tree->find(k); |
858 | 0 | if (tree_it != tree->end()) { |
859 | 0 | if (it != nullptr) *it = tree_it; |
860 | 0 | return std::make_pair(const_iterator(tree_it, this, b), b); |
861 | 0 | } |
862 | 0 | } |
863 | 405k | return std::make_pair(end(), b); |
864 | 586k | } std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>, unsigned long> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::FindHelper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) const Line | Count | Source | 842 | 210k | TreeIterator* it) const { | 843 | 210k | size_type b = BucketNumber(k); | 844 | 210k | if (TableEntryIsNonEmptyList(b)) { | 845 | 118k | Node* node = static_cast<Node*>(table_[b]); | 846 | 130k | do { | 847 | 130k | if (internal::TransparentSupport<Key>::Equals(node->kv.first, k)) { | 848 | 94.2k | return std::make_pair(const_iterator(node, this, b), b); | 849 | 94.2k | } else { | 850 | 35.9k | node = node->next; | 851 | 35.9k | } | 852 | 130k | } while (node != nullptr); | 853 | 118k | } else if (TableEntryIsTree(b)) { | 854 | 0 | GOOGLE_DCHECK_EQ(table_[b], table_[b ^ 1]); | 855 | 0 | b &= ~static_cast<size_t>(1); | 856 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); | 857 | 0 | auto tree_it = tree->find(k); | 858 | 0 | if (tree_it != tree->end()) { | 859 | 0 | if (it != nullptr) *it = tree_it; | 860 | 0 | return std::make_pair(const_iterator(tree_it, this, b), b); | 861 | 0 | } | 862 | 0 | } | 863 | 115k | return std::make_pair(end(), b); | 864 | 210k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>, unsigned long> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::FindHelper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) const Line | Count | Source | 842 | 218k | TreeIterator* it) const { | 843 | 218k | size_type b = BucketNumber(k); | 844 | 218k | if (TableEntryIsNonEmptyList(b)) { | 845 | 71.4k | Node* node = static_cast<Node*>(table_[b]); | 846 | 84.8k | do { | 847 | 84.8k | if (internal::TransparentSupport<Key>::Equals(node->kv.first, k)) { | 848 | 49.6k | return std::make_pair(const_iterator(node, this, b), b); | 849 | 49.6k | } else { | 850 | 35.2k | node = node->next; | 851 | 35.2k | } | 852 | 84.8k | } while (node != nullptr); | 853 | 147k | } else if (TableEntryIsTree(b)) { | 854 | 0 | GOOGLE_DCHECK_EQ(table_[b], table_[b ^ 1]); | 855 | 0 | b &= ~static_cast<size_t>(1); | 856 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); | 857 | 0 | auto tree_it = tree->find(k); | 858 | 0 | if (tree_it != tree->end()) { | 859 | 0 | if (it != nullptr) *it = tree_it; | 860 | 0 | return std::make_pair(const_iterator(tree_it, this, b), b); | 861 | 0 | } | 862 | 0 | } | 863 | 169k | return std::make_pair(end(), b); | 864 | 218k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>, unsigned long> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::FindHelper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) const Line | Count | Source | 842 | 157k | TreeIterator* it) const { | 843 | 157k | size_type b = BucketNumber(k); | 844 | 157k | if (TableEntryIsNonEmptyList(b)) { | 845 | 53.7k | Node* node = static_cast<Node*>(table_[b]); | 846 | 59.2k | do { | 847 | 59.2k | if (internal::TransparentSupport<Key>::Equals(node->kv.first, k)) { | 848 | 37.4k | return std::make_pair(const_iterator(node, this, b), b); | 849 | 37.4k | } else { | 850 | 21.7k | node = node->next; | 851 | 21.7k | } | 852 | 59.2k | } while (node != nullptr); | 853 | 103k | } else if (TableEntryIsTree(b)) { | 854 | 0 | GOOGLE_DCHECK_EQ(table_[b], table_[b ^ 1]); | 855 | 0 | b &= ~static_cast<size_t>(1); | 856 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); | 857 | 0 | auto tree_it = tree->find(k); | 858 | 0 | if (tree_it != tree->end()) { | 859 | 0 | if (it != nullptr) *it = tree_it; | 860 | 0 | return std::make_pair(const_iterator(tree_it, this, b), b); | 861 | 0 | } | 862 | 0 | } | 863 | 119k | return std::make_pair(end(), b); | 864 | 157k | } |
|
865 | | |
866 | | // Insert the given Node in bucket b. If that would make bucket b too big, |
867 | | // and bucket b is not a tree, create a tree for buckets b and b^1 to share. |
868 | | // Requires count(*KeyPtrFromNodePtr(node)) == 0 and that b is the correct |
869 | | // bucket. num_elements_ is not modified. |
870 | 182k | iterator InsertUnique(size_type b, Node* node) { |
871 | 182k | GOOGLE_DCHECK(index_of_first_non_null_ == num_buckets_ || |
872 | 182k | table_[index_of_first_non_null_] != nullptr); |
873 | | // In practice, the code that led to this point may have already |
874 | | // determined whether we are inserting into an empty list, a short list, |
875 | | // or whatever. But it's probably cheap enough to recompute that here; |
876 | | // it's likely that we're inserting into an empty or short list. |
877 | 182k | iterator result; |
878 | 182k | GOOGLE_DCHECK(find(node->kv.first) == end()); |
879 | 182k | if (TableEntryIsEmpty(b)) { |
880 | 150k | result = InsertUniqueInList(b, node); |
881 | 150k | } else if (TableEntryIsNonEmptyList(b)) { |
882 | 32.7k | if (PROTOBUF_PREDICT_FALSE(TableEntryIsTooLong(b))) { |
883 | 0 | TreeConvert(b); |
884 | 0 | result = InsertUniqueInTree(b, node); |
885 | 0 | GOOGLE_DCHECK_EQ(result.bucket_index_, b & ~static_cast<size_type>(1)); |
886 | 32.7k | } else { |
887 | | // Insert into a pre-existing list. This case cannot modify |
888 | | // index_of_first_non_null_, so we skip the code to update it. |
889 | 32.7k | return InsertUniqueInList(b, node); |
890 | 32.7k | } |
891 | 32.7k | } else { |
892 | | // Insert into a pre-existing tree. This case cannot modify |
893 | | // index_of_first_non_null_, so we skip the code to update it. |
894 | 0 | return InsertUniqueInTree(b, node); |
895 | 0 | } |
896 | | // parentheses around (std::min) prevents macro expansion of min(...) |
897 | 150k | index_of_first_non_null_ = |
898 | 150k | (std::min)(index_of_first_non_null_, result.bucket_index_); |
899 | 150k | return result; |
900 | 182k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::InsertUnique(unsigned long, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node*) Line | Count | Source | 870 | 56.1k | iterator InsertUnique(size_type b, Node* node) { | 871 | 56.1k | GOOGLE_DCHECK(index_of_first_non_null_ == num_buckets_ || | 872 | 56.1k | table_[index_of_first_non_null_] != nullptr); | 873 | | // In practice, the code that led to this point may have already | 874 | | // determined whether we are inserting into an empty list, a short list, | 875 | | // or whatever. But it's probably cheap enough to recompute that here; | 876 | | // it's likely that we're inserting into an empty or short list. | 877 | 56.1k | iterator result; | 878 | 56.1k | GOOGLE_DCHECK(find(node->kv.first) == end()); | 879 | 56.1k | if (TableEntryIsEmpty(b)) { | 880 | 43.3k | result = InsertUniqueInList(b, node); | 881 | 43.3k | } else if (TableEntryIsNonEmptyList(b)) { | 882 | 12.8k | if (PROTOBUF_PREDICT_FALSE(TableEntryIsTooLong(b))) { | 883 | 0 | TreeConvert(b); | 884 | 0 | result = InsertUniqueInTree(b, node); | 885 | 0 | GOOGLE_DCHECK_EQ(result.bucket_index_, b & ~static_cast<size_type>(1)); | 886 | 12.8k | } else { | 887 | | // Insert into a pre-existing list. This case cannot modify | 888 | | // index_of_first_non_null_, so we skip the code to update it. | 889 | 12.8k | return InsertUniqueInList(b, node); | 890 | 12.8k | } | 891 | 12.8k | } else { | 892 | | // Insert into a pre-existing tree. This case cannot modify | 893 | | // index_of_first_non_null_, so we skip the code to update it. | 894 | 0 | return InsertUniqueInTree(b, node); | 895 | 0 | } | 896 | | // parentheses around (std::min) prevents macro expansion of min(...) | 897 | 43.3k | index_of_first_non_null_ = | 898 | 43.3k | (std::min)(index_of_first_non_null_, result.bucket_index_); | 899 | 43.3k | return result; | 900 | 56.1k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::InsertUnique(unsigned long, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node*) Line | Count | Source | 870 | 72.4k | iterator InsertUnique(size_type b, Node* node) { | 871 | 72.4k | GOOGLE_DCHECK(index_of_first_non_null_ == num_buckets_ || | 872 | 72.4k | table_[index_of_first_non_null_] != nullptr); | 873 | | // In practice, the code that led to this point may have already | 874 | | // determined whether we are inserting into an empty list, a short list, | 875 | | // or whatever. But it's probably cheap enough to recompute that here; | 876 | | // it's likely that we're inserting into an empty or short list. | 877 | 72.4k | iterator result; | 878 | 72.4k | GOOGLE_DCHECK(find(node->kv.first) == end()); | 879 | 72.4k | if (TableEntryIsEmpty(b)) { | 880 | 60.8k | result = InsertUniqueInList(b, node); | 881 | 60.8k | } else if (TableEntryIsNonEmptyList(b)) { | 882 | 11.5k | if (PROTOBUF_PREDICT_FALSE(TableEntryIsTooLong(b))) { | 883 | 0 | TreeConvert(b); | 884 | 0 | result = InsertUniqueInTree(b, node); | 885 | 0 | GOOGLE_DCHECK_EQ(result.bucket_index_, b & ~static_cast<size_type>(1)); | 886 | 11.5k | } else { | 887 | | // Insert into a pre-existing list. This case cannot modify | 888 | | // index_of_first_non_null_, so we skip the code to update it. | 889 | 11.5k | return InsertUniqueInList(b, node); | 890 | 11.5k | } | 891 | 11.5k | } else { | 892 | | // Insert into a pre-existing tree. This case cannot modify | 893 | | // index_of_first_non_null_, so we skip the code to update it. | 894 | 0 | return InsertUniqueInTree(b, node); | 895 | 0 | } | 896 | | // parentheses around (std::min) prevents macro expansion of min(...) | 897 | 60.8k | index_of_first_non_null_ = | 898 | 60.8k | (std::min)(index_of_first_non_null_, result.bucket_index_); | 899 | 60.8k | return result; | 900 | 72.4k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::InsertUnique(unsigned long, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node*) Line | Count | Source | 870 | 54.2k | iterator InsertUnique(size_type b, Node* node) { | 871 | 54.2k | GOOGLE_DCHECK(index_of_first_non_null_ == num_buckets_ || | 872 | 54.2k | table_[index_of_first_non_null_] != nullptr); | 873 | | // In practice, the code that led to this point may have already | 874 | | // determined whether we are inserting into an empty list, a short list, | 875 | | // or whatever. But it's probably cheap enough to recompute that here; | 876 | | // it's likely that we're inserting into an empty or short list. | 877 | 54.2k | iterator result; | 878 | 54.2k | GOOGLE_DCHECK(find(node->kv.first) == end()); | 879 | 54.2k | if (TableEntryIsEmpty(b)) { | 880 | 45.8k | result = InsertUniqueInList(b, node); | 881 | 45.8k | } else if (TableEntryIsNonEmptyList(b)) { | 882 | 8.36k | if (PROTOBUF_PREDICT_FALSE(TableEntryIsTooLong(b))) { | 883 | 0 | TreeConvert(b); | 884 | 0 | result = InsertUniqueInTree(b, node); | 885 | 0 | GOOGLE_DCHECK_EQ(result.bucket_index_, b & ~static_cast<size_type>(1)); | 886 | 8.36k | } else { | 887 | | // Insert into a pre-existing list. This case cannot modify | 888 | | // index_of_first_non_null_, so we skip the code to update it. | 889 | 8.36k | return InsertUniqueInList(b, node); | 890 | 8.36k | } | 891 | 8.36k | } else { | 892 | | // Insert into a pre-existing tree. This case cannot modify | 893 | | // index_of_first_non_null_, so we skip the code to update it. | 894 | 0 | return InsertUniqueInTree(b, node); | 895 | 0 | } | 896 | | // parentheses around (std::min) prevents macro expansion of min(...) | 897 | 45.8k | index_of_first_non_null_ = | 898 | 45.8k | (std::min)(index_of_first_non_null_, result.bucket_index_); | 899 | 45.8k | return result; | 900 | 54.2k | } |
|
901 | | |
902 | | // Returns whether we should insert after the head of the list. For |
903 | | // non-optimized builds, we randomly decide whether to insert right at the |
904 | | // head of the list or just after the head. This helps add a little bit of |
905 | | // non-determinism to the map ordering. |
906 | 32.7k | bool ShouldInsertAfterHead(void* node) { |
907 | | #ifdef NDEBUG |
908 | | (void)node; |
909 | | return false; |
910 | | #else |
911 | | // Doing modulo with a prime mixes the bits more. |
912 | 32.7k | return (reinterpret_cast<uintptr_t>(node) ^ seed_) % 13 > 6; |
913 | 32.7k | #endif |
914 | 32.7k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::ShouldInsertAfterHead(void*) Line | Count | Source | 906 | 12.8k | bool ShouldInsertAfterHead(void* node) { | 907 | | #ifdef NDEBUG | 908 | | (void)node; | 909 | | return false; | 910 | | #else | 911 | | // Doing modulo with a prime mixes the bits more. | 912 | 12.8k | return (reinterpret_cast<uintptr_t>(node) ^ seed_) % 13 > 6; | 913 | 12.8k | #endif | 914 | 12.8k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::ShouldInsertAfterHead(void*) Line | Count | Source | 906 | 11.5k | bool ShouldInsertAfterHead(void* node) { | 907 | | #ifdef NDEBUG | 908 | | (void)node; | 909 | | return false; | 910 | | #else | 911 | | // Doing modulo with a prime mixes the bits more. | 912 | 11.5k | return (reinterpret_cast<uintptr_t>(node) ^ seed_) % 13 > 6; | 913 | 11.5k | #endif | 914 | 11.5k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::ShouldInsertAfterHead(void*) Line | Count | Source | 906 | 8.36k | bool ShouldInsertAfterHead(void* node) { | 907 | | #ifdef NDEBUG | 908 | | (void)node; | 909 | | return false; | 910 | | #else | 911 | | // Doing modulo with a prime mixes the bits more. | 912 | 8.36k | return (reinterpret_cast<uintptr_t>(node) ^ seed_) % 13 > 6; | 913 | 8.36k | #endif | 914 | 8.36k | } |
|
915 | | |
916 | | // Helper for InsertUnique. Handles the case where bucket b is a |
917 | | // not-too-long linked list. |
918 | 182k | iterator InsertUniqueInList(size_type b, Node* node) { |
919 | 182k | if (table_[b] != nullptr && ShouldInsertAfterHead(node)) { |
920 | 16.5k | Node* first = static_cast<Node*>(table_[b]); |
921 | 16.5k | node->next = first->next; |
922 | 16.5k | first->next = node; |
923 | 16.5k | return iterator(node, this, b); |
924 | 16.5k | } |
925 | | |
926 | 166k | node->next = static_cast<Node*>(table_[b]); |
927 | 166k | table_[b] = static_cast<void*>(node); |
928 | 166k | return iterator(node, this, b); |
929 | 182k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::InsertUniqueInList(unsigned long, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node*) Line | Count | Source | 918 | 56.1k | iterator InsertUniqueInList(size_type b, Node* node) { | 919 | 56.1k | if (table_[b] != nullptr && ShouldInsertAfterHead(node)) { | 920 | 6.61k | Node* first = static_cast<Node*>(table_[b]); | 921 | 6.61k | node->next = first->next; | 922 | 6.61k | first->next = node; | 923 | 6.61k | return iterator(node, this, b); | 924 | 6.61k | } | 925 | | | 926 | 49.5k | node->next = static_cast<Node*>(table_[b]); | 927 | 49.5k | table_[b] = static_cast<void*>(node); | 928 | 49.5k | return iterator(node, this, b); | 929 | 56.1k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::InsertUniqueInList(unsigned long, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node*) Line | Count | Source | 918 | 72.4k | iterator InsertUniqueInList(size_type b, Node* node) { | 919 | 72.4k | if (table_[b] != nullptr && ShouldInsertAfterHead(node)) { | 920 | 5.85k | Node* first = static_cast<Node*>(table_[b]); | 921 | 5.85k | node->next = first->next; | 922 | 5.85k | first->next = node; | 923 | 5.85k | return iterator(node, this, b); | 924 | 5.85k | } | 925 | | | 926 | 66.5k | node->next = static_cast<Node*>(table_[b]); | 927 | 66.5k | table_[b] = static_cast<void*>(node); | 928 | 66.5k | return iterator(node, this, b); | 929 | 72.4k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::InsertUniqueInList(unsigned long, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node*) Line | Count | Source | 918 | 54.2k | iterator InsertUniqueInList(size_type b, Node* node) { | 919 | 54.2k | if (table_[b] != nullptr && ShouldInsertAfterHead(node)) { | 920 | 4.10k | Node* first = static_cast<Node*>(table_[b]); | 921 | 4.10k | node->next = first->next; | 922 | 4.10k | first->next = node; | 923 | 4.10k | return iterator(node, this, b); | 924 | 4.10k | } | 925 | | | 926 | 50.1k | node->next = static_cast<Node*>(table_[b]); | 927 | 50.1k | table_[b] = static_cast<void*>(node); | 928 | 50.1k | return iterator(node, this, b); | 929 | 54.2k | } |
|
930 | | |
931 | | // Helper for InsertUnique. Handles the case where bucket b points to a |
932 | | // Tree. |
933 | 0 | iterator InsertUniqueInTree(size_type b, Node* node) { |
934 | 0 | GOOGLE_DCHECK_EQ(table_[b], table_[b ^ 1]); |
935 | | // Maintain the invariant that node->next is null for all Nodes in Trees. |
936 | 0 | node->next = nullptr; |
937 | 0 | return iterator( |
938 | 0 | static_cast<Tree*>(table_[b])->insert({node->kv.first, node}).first, |
939 | 0 | this, b & ~static_cast<size_t>(1)); |
940 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::InsertUniqueInTree(unsigned long, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node*) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::InsertUniqueInTree(unsigned long, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node*) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::InsertUniqueInTree(unsigned long, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node*) |
941 | | |
942 | | // Returns whether it did resize. Currently this is only used when |
943 | | // num_elements_ increases, though it could be used in other situations. |
944 | | // It checks for load too low as well as load too high: because any number |
945 | | // of erases can occur between inserts, the load could be as low as 0 here. |
946 | | // Resizing to a lower size is not always helpful, but failing to do so can |
947 | | // destroy the expected big-O bounds for some operations. By having the |
948 | | // policy that sometimes we resize down as well as up, clients can easily |
949 | | // keep O(size()) = O(number of buckets) if they want that. |
950 | 133k | bool ResizeIfLoadIsOutOfRange(size_type new_size) { |
951 | 133k | const size_type kMaxMapLoadTimes16 = 12; // controls RAM vs CPU tradeoff |
952 | 133k | const size_type hi_cutoff = num_buckets_ * kMaxMapLoadTimes16 / 16; |
953 | 133k | const size_type lo_cutoff = hi_cutoff / 4; |
954 | | // We don't care how many elements are in trees. If a lot are, |
955 | | // we may resize even though there are many empty buckets. In |
956 | | // practice, this seems fine. |
957 | 133k | if (PROTOBUF_PREDICT_FALSE(new_size >= hi_cutoff)) { |
958 | 58.7k | if (num_buckets_ <= max_size() / 2) { |
959 | 58.7k | Resize(num_buckets_ * 2); |
960 | 58.7k | return true; |
961 | 58.7k | } |
962 | 74.7k | } else if (PROTOBUF_PREDICT_FALSE(new_size <= lo_cutoff && |
963 | 74.7k | num_buckets_ > kMinTableSize)) { |
964 | 0 | size_type lg2_of_size_reduction_factor = 1; |
965 | | // It's possible we want to shrink a lot here... size() could even be 0. |
966 | | // So, estimate how much to shrink by making sure we don't shrink so |
967 | | // much that we would need to grow the table after a few inserts. |
968 | 0 | const size_type hypothetical_size = new_size * 5 / 4 + 1; |
969 | 0 | while ((hypothetical_size << lg2_of_size_reduction_factor) < |
970 | 0 | hi_cutoff) { |
971 | 0 | ++lg2_of_size_reduction_factor; |
972 | 0 | } |
973 | 0 | size_type new_num_buckets = std::max<size_type>( |
974 | 0 | kMinTableSize, num_buckets_ >> lg2_of_size_reduction_factor); |
975 | 0 | if (new_num_buckets != num_buckets_) { |
976 | 0 | Resize(new_num_buckets); |
977 | 0 | return true; |
978 | 0 | } |
979 | 0 | } |
980 | 74.7k | return false; |
981 | 133k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::ResizeIfLoadIsOutOfRange(unsigned long) Line | Count | Source | 950 | 36.9k | bool ResizeIfLoadIsOutOfRange(size_type new_size) { | 951 | 36.9k | const size_type kMaxMapLoadTimes16 = 12; // controls RAM vs CPU tradeoff | 952 | 36.9k | const size_type hi_cutoff = num_buckets_ * kMaxMapLoadTimes16 / 16; | 953 | 36.9k | const size_type lo_cutoff = hi_cutoff / 4; | 954 | | // We don't care how many elements are in trees. If a lot are, | 955 | | // we may resize even though there are many empty buckets. In | 956 | | // practice, this seems fine. | 957 | 36.9k | if (PROTOBUF_PREDICT_FALSE(new_size >= hi_cutoff)) { | 958 | 10.6k | if (num_buckets_ <= max_size() / 2) { | 959 | 10.6k | Resize(num_buckets_ * 2); | 960 | 10.6k | return true; | 961 | 10.6k | } | 962 | 26.2k | } else if (PROTOBUF_PREDICT_FALSE(new_size <= lo_cutoff && | 963 | 26.2k | num_buckets_ > kMinTableSize)) { | 964 | 0 | size_type lg2_of_size_reduction_factor = 1; | 965 | | // It's possible we want to shrink a lot here... size() could even be 0. | 966 | | // So, estimate how much to shrink by making sure we don't shrink so | 967 | | // much that we would need to grow the table after a few inserts. | 968 | 0 | const size_type hypothetical_size = new_size * 5 / 4 + 1; | 969 | 0 | while ((hypothetical_size << lg2_of_size_reduction_factor) < | 970 | 0 | hi_cutoff) { | 971 | 0 | ++lg2_of_size_reduction_factor; | 972 | 0 | } | 973 | 0 | size_type new_num_buckets = std::max<size_type>( | 974 | 0 | kMinTableSize, num_buckets_ >> lg2_of_size_reduction_factor); | 975 | 0 | if (new_num_buckets != num_buckets_) { | 976 | 0 | Resize(new_num_buckets); | 977 | 0 | return true; | 978 | 0 | } | 979 | 0 | } | 980 | 26.2k | return false; | 981 | 36.9k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::ResizeIfLoadIsOutOfRange(unsigned long) Line | Count | Source | 950 | 55.5k | bool ResizeIfLoadIsOutOfRange(size_type new_size) { | 951 | 55.5k | const size_type kMaxMapLoadTimes16 = 12; // controls RAM vs CPU tradeoff | 952 | 55.5k | const size_type hi_cutoff = num_buckets_ * kMaxMapLoadTimes16 / 16; | 953 | 55.5k | const size_type lo_cutoff = hi_cutoff / 4; | 954 | | // We don't care how many elements are in trees. If a lot are, | 955 | | // we may resize even though there are many empty buckets. In | 956 | | // practice, this seems fine. | 957 | 55.5k | if (PROTOBUF_PREDICT_FALSE(new_size >= hi_cutoff)) { | 958 | 29.3k | if (num_buckets_ <= max_size() / 2) { | 959 | 29.3k | Resize(num_buckets_ * 2); | 960 | 29.3k | return true; | 961 | 29.3k | } | 962 | 29.3k | } else if (PROTOBUF_PREDICT_FALSE(new_size <= lo_cutoff && | 963 | 26.2k | num_buckets_ > kMinTableSize)) { | 964 | 0 | size_type lg2_of_size_reduction_factor = 1; | 965 | | // It's possible we want to shrink a lot here... size() could even be 0. | 966 | | // So, estimate how much to shrink by making sure we don't shrink so | 967 | | // much that we would need to grow the table after a few inserts. | 968 | 0 | const size_type hypothetical_size = new_size * 5 / 4 + 1; | 969 | 0 | while ((hypothetical_size << lg2_of_size_reduction_factor) < | 970 | 0 | hi_cutoff) { | 971 | 0 | ++lg2_of_size_reduction_factor; | 972 | 0 | } | 973 | 0 | size_type new_num_buckets = std::max<size_type>( | 974 | 0 | kMinTableSize, num_buckets_ >> lg2_of_size_reduction_factor); | 975 | 0 | if (new_num_buckets != num_buckets_) { | 976 | 0 | Resize(new_num_buckets); | 977 | 0 | return true; | 978 | 0 | } | 979 | 0 | } | 980 | 26.2k | return false; | 981 | 55.5k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::ResizeIfLoadIsOutOfRange(unsigned long) Line | Count | Source | 950 | 41.0k | bool ResizeIfLoadIsOutOfRange(size_type new_size) { | 951 | 41.0k | const size_type kMaxMapLoadTimes16 = 12; // controls RAM vs CPU tradeoff | 952 | 41.0k | const size_type hi_cutoff = num_buckets_ * kMaxMapLoadTimes16 / 16; | 953 | 41.0k | const size_type lo_cutoff = hi_cutoff / 4; | 954 | | // We don't care how many elements are in trees. If a lot are, | 955 | | // we may resize even though there are many empty buckets. In | 956 | | // practice, this seems fine. | 957 | 41.0k | if (PROTOBUF_PREDICT_FALSE(new_size >= hi_cutoff)) { | 958 | 18.7k | if (num_buckets_ <= max_size() / 2) { | 959 | 18.7k | Resize(num_buckets_ * 2); | 960 | 18.7k | return true; | 961 | 18.7k | } | 962 | 22.2k | } else if (PROTOBUF_PREDICT_FALSE(new_size <= lo_cutoff && | 963 | 22.2k | num_buckets_ > kMinTableSize)) { | 964 | 0 | size_type lg2_of_size_reduction_factor = 1; | 965 | | // It's possible we want to shrink a lot here... size() could even be 0. | 966 | | // So, estimate how much to shrink by making sure we don't shrink so | 967 | | // much that we would need to grow the table after a few inserts. | 968 | 0 | const size_type hypothetical_size = new_size * 5 / 4 + 1; | 969 | 0 | while ((hypothetical_size << lg2_of_size_reduction_factor) < | 970 | 0 | hi_cutoff) { | 971 | 0 | ++lg2_of_size_reduction_factor; | 972 | 0 | } | 973 | 0 | size_type new_num_buckets = std::max<size_type>( | 974 | 0 | kMinTableSize, num_buckets_ >> lg2_of_size_reduction_factor); | 975 | 0 | if (new_num_buckets != num_buckets_) { | 976 | 0 | Resize(new_num_buckets); | 977 | 0 | return true; | 978 | 0 | } | 979 | 0 | } | 980 | 22.2k | return false; | 981 | 41.0k | } |
|
982 | | |
983 | | // Resize to the given number of buckets. |
984 | 58.7k | void Resize(size_t new_num_buckets) { |
985 | 58.7k | if (num_buckets_ == internal::kGlobalEmptyTableSize) { |
986 | | // This is the global empty array. |
987 | | // Just overwrite with a new one. No need to transfer or free anything. |
988 | 53.6k | num_buckets_ = index_of_first_non_null_ = kMinTableSize; |
989 | 53.6k | table_ = CreateEmptyTable(num_buckets_); |
990 | 53.6k | seed_ = Seed(); |
991 | 53.6k | return; |
992 | 53.6k | } |
993 | | |
994 | 5.13k | GOOGLE_DCHECK_GE(new_num_buckets, kMinTableSize); |
995 | 5.13k | void** const old_table = table_; |
996 | 5.13k | const size_type old_table_size = num_buckets_; |
997 | 5.13k | num_buckets_ = new_num_buckets; |
998 | 5.13k | table_ = CreateEmptyTable(num_buckets_); |
999 | 5.13k | const size_type start = index_of_first_non_null_; |
1000 | 5.13k | index_of_first_non_null_ = num_buckets_; |
1001 | 73.2k | for (size_type i = start; i < old_table_size; i++) { |
1002 | 68.0k | if (internal::TableEntryIsNonEmptyList(old_table, i)) { |
1003 | 36.5k | TransferList(old_table, i); |
1004 | 36.5k | } else if (internal::TableEntryIsTree(old_table, i)) { |
1005 | 0 | TransferTree(old_table, i++); |
1006 | 0 | } |
1007 | 68.0k | } |
1008 | 5.13k | Dealloc<void*>(old_table, old_table_size); |
1009 | 5.13k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Resize(unsigned long) Line | Count | Source | 984 | 10.6k | void Resize(size_t new_num_buckets) { | 985 | 10.6k | if (num_buckets_ == internal::kGlobalEmptyTableSize) { | 986 | | // This is the global empty array. | 987 | | // Just overwrite with a new one. No need to transfer or free anything. | 988 | 9.39k | num_buckets_ = index_of_first_non_null_ = kMinTableSize; | 989 | 9.39k | table_ = CreateEmptyTable(num_buckets_); | 990 | 9.39k | seed_ = Seed(); | 991 | 9.39k | return; | 992 | 9.39k | } | 993 | | | 994 | 1.26k | GOOGLE_DCHECK_GE(new_num_buckets, kMinTableSize); | 995 | 1.26k | void** const old_table = table_; | 996 | 1.26k | const size_type old_table_size = num_buckets_; | 997 | 1.26k | num_buckets_ = new_num_buckets; | 998 | 1.26k | table_ = CreateEmptyTable(num_buckets_); | 999 | 1.26k | const size_type start = index_of_first_non_null_; | 1000 | 1.26k | index_of_first_non_null_ = num_buckets_; | 1001 | 27.5k | for (size_type i = start; i < old_table_size; i++) { | 1002 | 26.2k | if (internal::TableEntryIsNonEmptyList(old_table, i)) { | 1003 | 14.0k | TransferList(old_table, i); | 1004 | 14.0k | } else if (internal::TableEntryIsTree(old_table, i)) { | 1005 | 0 | TransferTree(old_table, i++); | 1006 | 0 | } | 1007 | 26.2k | } | 1008 | 1.26k | Dealloc<void*>(old_table, old_table_size); | 1009 | 1.26k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Resize(unsigned long) Line | Count | Source | 984 | 29.3k | void Resize(size_t new_num_buckets) { | 985 | 29.3k | if (num_buckets_ == internal::kGlobalEmptyTableSize) { | 986 | | // This is the global empty array. | 987 | | // Just overwrite with a new one. No need to transfer or free anything. | 988 | 27.6k | num_buckets_ = index_of_first_non_null_ = kMinTableSize; | 989 | 27.6k | table_ = CreateEmptyTable(num_buckets_); | 990 | 27.6k | seed_ = Seed(); | 991 | 27.6k | return; | 992 | 27.6k | } | 993 | | | 994 | 1.65k | GOOGLE_DCHECK_GE(new_num_buckets, kMinTableSize); | 995 | 1.65k | void** const old_table = table_; | 996 | 1.65k | const size_type old_table_size = num_buckets_; | 997 | 1.65k | num_buckets_ = new_num_buckets; | 998 | 1.65k | table_ = CreateEmptyTable(num_buckets_); | 999 | 1.65k | const size_type start = index_of_first_non_null_; | 1000 | 1.65k | index_of_first_non_null_ = num_buckets_; | 1001 | 24.8k | for (size_type i = start; i < old_table_size; i++) { | 1002 | 23.2k | if (internal::TableEntryIsNonEmptyList(old_table, i)) { | 1003 | 12.3k | TransferList(old_table, i); | 1004 | 12.3k | } else if (internal::TableEntryIsTree(old_table, i)) { | 1005 | 0 | TransferTree(old_table, i++); | 1006 | 0 | } | 1007 | 23.2k | } | 1008 | 1.65k | Dealloc<void*>(old_table, old_table_size); | 1009 | 1.65k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Resize(unsigned long) Line | Count | Source | 984 | 18.7k | void Resize(size_t new_num_buckets) { | 985 | 18.7k | if (num_buckets_ == internal::kGlobalEmptyTableSize) { | 986 | | // This is the global empty array. | 987 | | // Just overwrite with a new one. No need to transfer or free anything. | 988 | 16.5k | num_buckets_ = index_of_first_non_null_ = kMinTableSize; | 989 | 16.5k | table_ = CreateEmptyTable(num_buckets_); | 990 | 16.5k | seed_ = Seed(); | 991 | 16.5k | return; | 992 | 16.5k | } | 993 | | | 994 | 2.22k | GOOGLE_DCHECK_GE(new_num_buckets, kMinTableSize); | 995 | 2.22k | void** const old_table = table_; | 996 | 2.22k | const size_type old_table_size = num_buckets_; | 997 | 2.22k | num_buckets_ = new_num_buckets; | 998 | 2.22k | table_ = CreateEmptyTable(num_buckets_); | 999 | 2.22k | const size_type start = index_of_first_non_null_; | 1000 | 2.22k | index_of_first_non_null_ = num_buckets_; | 1001 | 20.8k | for (size_type i = start; i < old_table_size; i++) { | 1002 | 18.6k | if (internal::TableEntryIsNonEmptyList(old_table, i)) { | 1003 | 10.1k | TransferList(old_table, i); | 1004 | 10.1k | } else if (internal::TableEntryIsTree(old_table, i)) { | 1005 | 0 | TransferTree(old_table, i++); | 1006 | 0 | } | 1007 | 18.6k | } | 1008 | 2.22k | Dealloc<void*>(old_table, old_table_size); | 1009 | 2.22k | } |
|
1010 | | |
1011 | 36.5k | void TransferList(void* const* table, size_type index) { |
1012 | 36.5k | Node* node = static_cast<Node*>(table[index]); |
1013 | 49.3k | do { |
1014 | 49.3k | Node* next = node->next; |
1015 | 49.3k | InsertUnique(BucketNumber(node->kv.first), node); |
1016 | 49.3k | node = next; |
1017 | 49.3k | } while (node != nullptr); |
1018 | 36.5k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TransferList(void* const*, unsigned long) Line | Count | Source | 1011 | 14.0k | void TransferList(void* const* table, size_type index) { | 1012 | 14.0k | Node* node = static_cast<Node*>(table[index]); | 1013 | 19.2k | do { | 1014 | 19.2k | Node* next = node->next; | 1015 | 19.2k | InsertUnique(BucketNumber(node->kv.first), node); | 1016 | 19.2k | node = next; | 1017 | 19.2k | } while (node != nullptr); | 1018 | 14.0k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TransferList(void* const*, unsigned long) Line | Count | Source | 1011 | 12.3k | void TransferList(void* const* table, size_type index) { | 1012 | 12.3k | Node* node = static_cast<Node*>(table[index]); | 1013 | 16.8k | do { | 1014 | 16.8k | Node* next = node->next; | 1015 | 16.8k | InsertUnique(BucketNumber(node->kv.first), node); | 1016 | 16.8k | node = next; | 1017 | 16.8k | } while (node != nullptr); | 1018 | 12.3k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TransferList(void* const*, unsigned long) Line | Count | Source | 1011 | 10.1k | void TransferList(void* const* table, size_type index) { | 1012 | 10.1k | Node* node = static_cast<Node*>(table[index]); | 1013 | 13.1k | do { | 1014 | 13.1k | Node* next = node->next; | 1015 | 13.1k | InsertUnique(BucketNumber(node->kv.first), node); | 1016 | 13.1k | node = next; | 1017 | 13.1k | } while (node != nullptr); | 1018 | 10.1k | } |
|
1019 | | |
1020 | 0 | void TransferTree(void* const* table, size_type index) { |
1021 | 0 | Tree* tree = static_cast<Tree*>(table[index]); |
1022 | 0 | typename Tree::iterator tree_it = tree->begin(); |
1023 | 0 | do { |
1024 | 0 | InsertUnique(BucketNumber(std::cref(tree_it->first).get()), |
1025 | 0 | NodeFromTreeIterator(tree_it)); |
1026 | 0 | } while (++tree_it != tree->end()); |
1027 | 0 | DestroyTree(tree); |
1028 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TransferTree(void* const*, unsigned long) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TransferTree(void* const*, unsigned long) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TransferTree(void* const*, unsigned long) |
1029 | | |
1030 | 34.4k | Node* EraseFromLinkedList(Node* item, Node* head) { |
1031 | 34.4k | if (head == item) { |
1032 | 30.0k | return head->next; |
1033 | 30.0k | } else { |
1034 | 4.33k | head->next = EraseFromLinkedList(item, head->next); |
1035 | 4.33k | return head; |
1036 | 4.33k | } |
1037 | 34.4k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::EraseFromLinkedList(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node*, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node*) Line | Count | Source | 1030 | 12.6k | Node* EraseFromLinkedList(Node* item, Node* head) { | 1031 | 12.6k | if (head == item) { | 1032 | 10.8k | return head->next; | 1033 | 10.8k | } else { | 1034 | 1.88k | head->next = EraseFromLinkedList(item, head->next); | 1035 | 1.88k | return head; | 1036 | 1.88k | } | 1037 | 12.6k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::EraseFromLinkedList(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node*, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node*) Line | Count | Source | 1030 | 11.4k | Node* EraseFromLinkedList(Node* item, Node* head) { | 1031 | 11.4k | if (head == item) { | 1032 | 10.0k | return head->next; | 1033 | 10.0k | } else { | 1034 | 1.44k | head->next = EraseFromLinkedList(item, head->next); | 1035 | 1.44k | return head; | 1036 | 1.44k | } | 1037 | 11.4k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::EraseFromLinkedList(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node*, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node*) Line | Count | Source | 1030 | 10.2k | Node* EraseFromLinkedList(Node* item, Node* head) { | 1031 | 10.2k | if (head == item) { | 1032 | 9.21k | return head->next; | 1033 | 9.21k | } else { | 1034 | 1.00k | head->next = EraseFromLinkedList(item, head->next); | 1035 | 1.00k | return head; | 1036 | 1.00k | } | 1037 | 10.2k | } |
|
1038 | | |
1039 | 182k | bool TableEntryIsEmpty(size_type b) const { |
1040 | 182k | return internal::TableEntryIsEmpty(table_, b); |
1041 | 182k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TableEntryIsEmpty(unsigned long) const Line | Count | Source | 1039 | 56.1k | bool TableEntryIsEmpty(size_type b) const { | 1040 | 56.1k | return internal::TableEntryIsEmpty(table_, b); | 1041 | 56.1k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TableEntryIsEmpty(unsigned long) const Line | Count | Source | 1039 | 72.4k | bool TableEntryIsEmpty(size_type b) const { | 1040 | 72.4k | return internal::TableEntryIsEmpty(table_, b); | 1041 | 72.4k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TableEntryIsEmpty(unsigned long) const Line | Count | Source | 1039 | 54.2k | bool TableEntryIsEmpty(size_type b) const { | 1040 | 54.2k | return internal::TableEntryIsEmpty(table_, b); | 1041 | 54.2k | } |
|
1042 | 1.44M | bool TableEntryIsNonEmptyList(size_type b) const { |
1043 | 1.44M | return internal::TableEntryIsNonEmptyList(table_, b); |
1044 | 1.44M | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TableEntryIsNonEmptyList(unsigned long) const Line | Count | Source | 1042 | 405k | bool TableEntryIsNonEmptyList(size_type b) const { | 1043 | 405k | return internal::TableEntryIsNonEmptyList(table_, b); | 1044 | 405k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TableEntryIsNonEmptyList(unsigned long) const Line | Count | Source | 1042 | 625k | bool TableEntryIsNonEmptyList(size_type b) const { | 1043 | 625k | return internal::TableEntryIsNonEmptyList(table_, b); | 1044 | 625k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TableEntryIsNonEmptyList(unsigned long) const Line | Count | Source | 1042 | 418k | bool TableEntryIsNonEmptyList(size_type b) const { | 1043 | 418k | return internal::TableEntryIsNonEmptyList(table_, b); | 1044 | 418k | } |
|
1045 | 966k | bool TableEntryIsTree(size_type b) const { |
1046 | 966k | return internal::TableEntryIsTree(table_, b); |
1047 | 966k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TableEntryIsTree(unsigned long) const Line | Count | Source | 1045 | 219k | bool TableEntryIsTree(size_type b) const { | 1046 | 219k | return internal::TableEntryIsTree(table_, b); | 1047 | 219k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TableEntryIsTree(unsigned long) const Line | Count | Source | 1045 | 452k | bool TableEntryIsTree(size_type b) const { | 1046 | 452k | return internal::TableEntryIsTree(table_, b); | 1047 | 452k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TableEntryIsTree(unsigned long) const Line | Count | Source | 1045 | 295k | bool TableEntryIsTree(size_type b) const { | 1046 | 295k | return internal::TableEntryIsTree(table_, b); | 1047 | 295k | } |
|
1048 | 0 | bool TableEntryIsList(size_type b) const { |
1049 | 0 | return internal::TableEntryIsList(table_, b); |
1050 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TableEntryIsList(unsigned long) const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TableEntryIsList(unsigned long) const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TableEntryIsList(unsigned long) const |
1051 | | |
1052 | 0 | void TreeConvert(size_type b) { |
1053 | 0 | GOOGLE_DCHECK(!TableEntryIsTree(b) && !TableEntryIsTree(b ^ 1)); |
1054 | 0 | Tree* tree = |
1055 | 0 | Arena::Create<Tree>(alloc_.arena(), typename Tree::key_compare(), |
1056 | 0 | typename Tree::allocator_type(alloc_)); |
1057 | 0 | size_type count = CopyListToTree(b, tree) + CopyListToTree(b ^ 1, tree); |
1058 | 0 | GOOGLE_DCHECK_EQ(count, tree->size()); |
1059 | 0 | table_[b] = table_[b ^ 1] = static_cast<void*>(tree); |
1060 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TreeConvert(unsigned long) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TreeConvert(unsigned long) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TreeConvert(unsigned long) |
1061 | | |
1062 | | // Copy a linked list in the given bucket to a tree. |
1063 | | // Returns the number of things it copied. |
1064 | 0 | size_type CopyListToTree(size_type b, Tree* tree) { |
1065 | 0 | size_type count = 0; |
1066 | 0 | Node* node = static_cast<Node*>(table_[b]); |
1067 | 0 | while (node != nullptr) { |
1068 | 0 | tree->insert({node->kv.first, node}); |
1069 | 0 | ++count; |
1070 | 0 | Node* next = node->next; |
1071 | 0 | node->next = nullptr; |
1072 | 0 | node = next; |
1073 | 0 | } |
1074 | 0 | return count; |
1075 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::CopyListToTree(unsigned long, std::__1::map<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*, google::protobuf::internal::TransparentSupport<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::less, google::protobuf::internal::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> > >*) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::CopyListToTree(unsigned long, std::__1::map<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*, google::protobuf::internal::TransparentSupport<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::less, google::protobuf::internal::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> > >*) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::CopyListToTree(unsigned long, std::__1::map<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*, google::protobuf::internal::TransparentSupport<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::less, google::protobuf::internal::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> > >*) |
1076 | | |
1077 | | // Return whether table_[b] is a linked list that seems awfully long. |
1078 | | // Requires table_[b] to point to a non-empty linked list. |
1079 | 32.7k | bool TableEntryIsTooLong(size_type b) { |
1080 | 32.7k | const size_type kMaxLength = 8; |
1081 | 32.7k | size_type count = 0; |
1082 | 32.7k | Node* node = static_cast<Node*>(table_[b]); |
1083 | 39.2k | do { |
1084 | 39.2k | ++count; |
1085 | 39.2k | node = node->next; |
1086 | 39.2k | } while (node != nullptr); |
1087 | | // Invariant: no linked list ever is more than kMaxLength in length. |
1088 | 32.7k | GOOGLE_DCHECK_LE(count, kMaxLength); |
1089 | 32.7k | return count >= kMaxLength; |
1090 | 32.7k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TableEntryIsTooLong(unsigned long) Line | Count | Source | 1079 | 12.8k | bool TableEntryIsTooLong(size_type b) { | 1080 | 12.8k | const size_type kMaxLength = 8; | 1081 | 12.8k | size_type count = 0; | 1082 | 12.8k | Node* node = static_cast<Node*>(table_[b]); | 1083 | 15.8k | do { | 1084 | 15.8k | ++count; | 1085 | 15.8k | node = node->next; | 1086 | 15.8k | } while (node != nullptr); | 1087 | | // Invariant: no linked list ever is more than kMaxLength in length. | 1088 | 12.8k | GOOGLE_DCHECK_LE(count, kMaxLength); | 1089 | 12.8k | return count >= kMaxLength; | 1090 | 12.8k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TableEntryIsTooLong(unsigned long) Line | Count | Source | 1079 | 11.5k | bool TableEntryIsTooLong(size_type b) { | 1080 | 11.5k | const size_type kMaxLength = 8; | 1081 | 11.5k | size_type count = 0; | 1082 | 11.5k | Node* node = static_cast<Node*>(table_[b]); | 1083 | 14.0k | do { | 1084 | 14.0k | ++count; | 1085 | 14.0k | node = node->next; | 1086 | 14.0k | } while (node != nullptr); | 1087 | | // Invariant: no linked list ever is more than kMaxLength in length. | 1088 | 11.5k | GOOGLE_DCHECK_LE(count, kMaxLength); | 1089 | 11.5k | return count >= kMaxLength; | 1090 | 11.5k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TableEntryIsTooLong(unsigned long) Line | Count | Source | 1079 | 8.36k | bool TableEntryIsTooLong(size_type b) { | 1080 | 8.36k | const size_type kMaxLength = 8; | 1081 | 8.36k | size_type count = 0; | 1082 | 8.36k | Node* node = static_cast<Node*>(table_[b]); | 1083 | 9.36k | do { | 1084 | 9.36k | ++count; | 1085 | 9.36k | node = node->next; | 1086 | 9.36k | } while (node != nullptr); | 1087 | | // Invariant: no linked list ever is more than kMaxLength in length. | 1088 | 8.36k | GOOGLE_DCHECK_LE(count, kMaxLength); | 1089 | 8.36k | return count >= kMaxLength; | 1090 | 8.36k | } |
|
1091 | | |
1092 | | template <typename K> |
1093 | 635k | size_type BucketNumber(const K& k) const { |
1094 | | // We xor the hash value against the random seed so that we effectively |
1095 | | // have a random hash function. |
1096 | 635k | uint64_t h = hash_function()(k) ^ seed_; |
1097 | | |
1098 | | // We use the multiplication method to determine the bucket number from |
1099 | | // the hash value. The constant kPhi (suggested by Knuth) is roughly |
1100 | | // (sqrt(5) - 1) / 2 * 2^64. |
1101 | 635k | constexpr uint64_t kPhi = uint64_t{0x9e3779b97f4a7c15}; |
1102 | 635k | return ((kPhi * h) >> 32) & (num_buckets_ - 1); |
1103 | 635k | } unsigned long google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::BucketNumber<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 1093 | 229k | size_type BucketNumber(const K& k) const { | 1094 | | // We xor the hash value against the random seed so that we effectively | 1095 | | // have a random hash function. | 1096 | 229k | uint64_t h = hash_function()(k) ^ seed_; | 1097 | | | 1098 | | // We use the multiplication method to determine the bucket number from | 1099 | | // the hash value. The constant kPhi (suggested by Knuth) is roughly | 1100 | | // (sqrt(5) - 1) / 2 * 2^64. | 1101 | 229k | constexpr uint64_t kPhi = uint64_t{0x9e3779b97f4a7c15}; | 1102 | 229k | return ((kPhi * h) >> 32) & (num_buckets_ - 1); | 1103 | 229k | } |
unsigned long google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::BucketNumber<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 1093 | 235k | size_type BucketNumber(const K& k) const { | 1094 | | // We xor the hash value against the random seed so that we effectively | 1095 | | // have a random hash function. | 1096 | 235k | uint64_t h = hash_function()(k) ^ seed_; | 1097 | | | 1098 | | // We use the multiplication method to determine the bucket number from | 1099 | | // the hash value. The constant kPhi (suggested by Knuth) is roughly | 1100 | | // (sqrt(5) - 1) / 2 * 2^64. | 1101 | 235k | constexpr uint64_t kPhi = uint64_t{0x9e3779b97f4a7c15}; | 1102 | 235k | return ((kPhi * h) >> 32) & (num_buckets_ - 1); | 1103 | 235k | } |
unsigned long google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::BucketNumber<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 1093 | 170k | size_type BucketNumber(const K& k) const { | 1094 | | // We xor the hash value against the random seed so that we effectively | 1095 | | // have a random hash function. | 1096 | 170k | uint64_t h = hash_function()(k) ^ seed_; | 1097 | | | 1098 | | // We use the multiplication method to determine the bucket number from | 1099 | | // the hash value. The constant kPhi (suggested by Knuth) is roughly | 1100 | | // (sqrt(5) - 1) / 2 * 2^64. | 1101 | 170k | constexpr uint64_t kPhi = uint64_t{0x9e3779b97f4a7c15}; | 1102 | 170k | return ((kPhi * h) >> 32) & (num_buckets_ - 1); | 1103 | 170k | } |
|
1104 | | |
1105 | | // Return a power of two no less than max(kMinTableSize, n). |
1106 | | // Assumes either n < kMinTableSize or n is a power of two. |
1107 | | size_type TableSize(size_type n) { |
1108 | | return n < static_cast<size_type>(kMinTableSize) |
1109 | | ? static_cast<size_type>(kMinTableSize) |
1110 | | : n; |
1111 | | } |
1112 | | |
1113 | | // Use alloc_ to allocate an array of n objects of type U. |
1114 | | template <typename U> |
1115 | 192k | U* Alloc(size_type n) { |
1116 | 192k | using alloc_type = typename Allocator::template rebind<U>::other; |
1117 | 192k | return alloc_type(alloc_).allocate(n); |
1118 | 192k | } void** google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Alloc<void*>(unsigned long) Line | Count | Source | 1115 | 10.6k | U* Alloc(size_type n) { | 1116 | 10.6k | using alloc_type = typename Allocator::template rebind<U>::other; | 1117 | 10.6k | return alloc_type(alloc_).allocate(n); | 1118 | 10.6k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node* google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Alloc<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node>(unsigned long) Line | Count | Source | 1115 | 36.9k | U* Alloc(size_type n) { | 1116 | 36.9k | using alloc_type = typename Allocator::template rebind<U>::other; | 1117 | 36.9k | return alloc_type(alloc_).allocate(n); | 1118 | 36.9k | } |
void** google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Alloc<void*>(unsigned long) Line | Count | Source | 1115 | 29.3k | U* Alloc(size_type n) { | 1116 | 29.3k | using alloc_type = typename Allocator::template rebind<U>::other; | 1117 | 29.3k | return alloc_type(alloc_).allocate(n); | 1118 | 29.3k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node* google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Alloc<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node>(unsigned long) Line | Count | Source | 1115 | 55.5k | U* Alloc(size_type n) { | 1116 | 55.5k | using alloc_type = typename Allocator::template rebind<U>::other; | 1117 | 55.5k | return alloc_type(alloc_).allocate(n); | 1118 | 55.5k | } |
void** google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Alloc<void*>(unsigned long) Line | Count | Source | 1115 | 18.7k | U* Alloc(size_type n) { | 1116 | 18.7k | using alloc_type = typename Allocator::template rebind<U>::other; | 1117 | 18.7k | return alloc_type(alloc_).allocate(n); | 1118 | 18.7k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node* google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Alloc<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node>(unsigned long) Line | Count | Source | 1115 | 41.0k | U* Alloc(size_type n) { | 1116 | 41.0k | using alloc_type = typename Allocator::template rebind<U>::other; | 1117 | 41.0k | return alloc_type(alloc_).allocate(n); | 1118 | 41.0k | } |
|
1119 | | |
1120 | | // Use alloc_ to deallocate an array of n objects of type U. |
1121 | | template <typename U> |
1122 | 58.7k | void Dealloc(U* t, size_type n) { |
1123 | 58.7k | using alloc_type = typename Allocator::template rebind<U>::other; |
1124 | 58.7k | alloc_type(alloc_).deallocate(t, n); |
1125 | 58.7k | } void google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Dealloc<void*>(void**, unsigned long) Line | Count | Source | 1122 | 10.6k | void Dealloc(U* t, size_type n) { | 1123 | 10.6k | using alloc_type = typename Allocator::template rebind<U>::other; | 1124 | 10.6k | alloc_type(alloc_).deallocate(t, n); | 1125 | 10.6k | } |
void google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Dealloc<void*>(void**, unsigned long) Line | Count | Source | 1122 | 29.3k | void Dealloc(U* t, size_type n) { | 1123 | 29.3k | using alloc_type = typename Allocator::template rebind<U>::other; | 1124 | 29.3k | alloc_type(alloc_).deallocate(t, n); | 1125 | 29.3k | } |
void google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Dealloc<void*>(void**, unsigned long) Line | Count | Source | 1122 | 18.7k | void Dealloc(U* t, size_type n) { | 1123 | 18.7k | using alloc_type = typename Allocator::template rebind<U>::other; | 1124 | 18.7k | alloc_type(alloc_).deallocate(t, n); | 1125 | 18.7k | } |
|
1126 | | |
1127 | 133k | void DestroyNode(Node* node) { |
1128 | 133k | if (alloc_.arena() == nullptr) { |
1129 | 133k | delete node; |
1130 | 133k | } |
1131 | 133k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::DestroyNode(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node*) Line | Count | Source | 1127 | 36.9k | void DestroyNode(Node* node) { | 1128 | 36.9k | if (alloc_.arena() == nullptr) { | 1129 | 36.9k | delete node; | 1130 | 36.9k | } | 1131 | 36.9k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::DestroyNode(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node*) Line | Count | Source | 1127 | 55.5k | void DestroyNode(Node* node) { | 1128 | 55.5k | if (alloc_.arena() == nullptr) { | 1129 | 55.5k | delete node; | 1130 | 55.5k | } | 1131 | 55.5k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::DestroyNode(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node*) Line | Count | Source | 1127 | 41.0k | void DestroyNode(Node* node) { | 1128 | 41.0k | if (alloc_.arena() == nullptr) { | 1129 | 41.0k | delete node; | 1130 | 41.0k | } | 1131 | 41.0k | } |
|
1132 | | |
1133 | 0 | void DestroyTree(Tree* tree) { |
1134 | 0 | if (alloc_.arena() == nullptr) { |
1135 | 0 | delete tree; |
1136 | 0 | } |
1137 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::DestroyTree(std::__1::map<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*, google::protobuf::internal::TransparentSupport<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::less, google::protobuf::internal::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> > >*) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::DestroyTree(std::__1::map<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*, google::protobuf::internal::TransparentSupport<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::less, google::protobuf::internal::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> > >*) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::DestroyTree(std::__1::map<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*, google::protobuf::internal::TransparentSupport<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::less, google::protobuf::internal::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> > >*) |
1138 | | |
1139 | 58.7k | void** CreateEmptyTable(size_type n) { |
1140 | 58.7k | GOOGLE_DCHECK(n >= kMinTableSize); |
1141 | 58.7k | GOOGLE_DCHECK_EQ(n & (n - 1), 0u); |
1142 | 58.7k | void** result = Alloc<void*>(n); |
1143 | 58.7k | memset(result, 0, n * sizeof(result[0])); |
1144 | 58.7k | return result; |
1145 | 58.7k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::CreateEmptyTable(unsigned long) Line | Count | Source | 1139 | 10.6k | void** CreateEmptyTable(size_type n) { | 1140 | 10.6k | GOOGLE_DCHECK(n >= kMinTableSize); | 1141 | 10.6k | GOOGLE_DCHECK_EQ(n & (n - 1), 0u); | 1142 | 10.6k | void** result = Alloc<void*>(n); | 1143 | 10.6k | memset(result, 0, n * sizeof(result[0])); | 1144 | 10.6k | return result; | 1145 | 10.6k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::CreateEmptyTable(unsigned long) Line | Count | Source | 1139 | 29.3k | void** CreateEmptyTable(size_type n) { | 1140 | 29.3k | GOOGLE_DCHECK(n >= kMinTableSize); | 1141 | 29.3k | GOOGLE_DCHECK_EQ(n & (n - 1), 0u); | 1142 | 29.3k | void** result = Alloc<void*>(n); | 1143 | 29.3k | memset(result, 0, n * sizeof(result[0])); | 1144 | 29.3k | return result; | 1145 | 29.3k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::CreateEmptyTable(unsigned long) Line | Count | Source | 1139 | 18.7k | void** CreateEmptyTable(size_type n) { | 1140 | 18.7k | GOOGLE_DCHECK(n >= kMinTableSize); | 1141 | 18.7k | GOOGLE_DCHECK_EQ(n & (n - 1), 0u); | 1142 | 18.7k | void** result = Alloc<void*>(n); | 1143 | 18.7k | memset(result, 0, n * sizeof(result[0])); | 1144 | 18.7k | return result; | 1145 | 18.7k | } |
|
1146 | | |
1147 | | // Return a randomish value. |
1148 | 53.6k | size_type Seed() const { |
1149 | | // We get a little bit of randomness from the address of the map. The |
1150 | | // lower bits are not very random, due to alignment, so we discard them |
1151 | | // and shift the higher bits into their place. |
1152 | 53.6k | size_type s = reinterpret_cast<uintptr_t>(this) >> 4; |
1153 | 53.6k | #if !defined(GOOGLE_PROTOBUF_NO_RDTSC) |
1154 | | #if defined(__APPLE__) |
1155 | | // Use a commpage-based fast time function on Apple environments (MacOS, |
1156 | | // iOS, tvOS, watchOS, etc). |
1157 | | s += mach_absolute_time(); |
1158 | | #elif defined(__x86_64__) && defined(__GNUC__) |
1159 | | uint32_t hi, lo; |
1160 | 53.6k | asm volatile("rdtsc" : "=a"(lo), "=d"(hi)); |
1161 | 53.6k | s += ((static_cast<uint64_t>(hi) << 32) | lo); |
1162 | | #elif defined(__aarch64__) && defined(__GNUC__) |
1163 | | // There is no rdtsc on ARMv8. CNTVCT_EL0 is the virtual counter of the |
1164 | | // system timer. It runs at a different frequency than the CPU's, but is |
1165 | | // the best source of time-based entropy we get. |
1166 | | uint64_t virtual_timer_value; |
1167 | | asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value)); |
1168 | | s += virtual_timer_value; |
1169 | | #endif |
1170 | 53.6k | #endif // !defined(GOOGLE_PROTOBUF_NO_RDTSC) |
1171 | 53.6k | return s; |
1172 | 53.6k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Seed() const Line | Count | Source | 1148 | 9.39k | size_type Seed() const { | 1149 | | // We get a little bit of randomness from the address of the map. The | 1150 | | // lower bits are not very random, due to alignment, so we discard them | 1151 | | // and shift the higher bits into their place. | 1152 | 9.39k | size_type s = reinterpret_cast<uintptr_t>(this) >> 4; | 1153 | 9.39k | #if !defined(GOOGLE_PROTOBUF_NO_RDTSC) | 1154 | | #if defined(__APPLE__) | 1155 | | // Use a commpage-based fast time function on Apple environments (MacOS, | 1156 | | // iOS, tvOS, watchOS, etc). | 1157 | | s += mach_absolute_time(); | 1158 | | #elif defined(__x86_64__) && defined(__GNUC__) | 1159 | | uint32_t hi, lo; | 1160 | 9.39k | asm volatile("rdtsc" : "=a"(lo), "=d"(hi)); | 1161 | 9.39k | s += ((static_cast<uint64_t>(hi) << 32) | lo); | 1162 | | #elif defined(__aarch64__) && defined(__GNUC__) | 1163 | | // There is no rdtsc on ARMv8. CNTVCT_EL0 is the virtual counter of the | 1164 | | // system timer. It runs at a different frequency than the CPU's, but is | 1165 | | // the best source of time-based entropy we get. | 1166 | | uint64_t virtual_timer_value; | 1167 | | asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value)); | 1168 | | s += virtual_timer_value; | 1169 | | #endif | 1170 | 9.39k | #endif // !defined(GOOGLE_PROTOBUF_NO_RDTSC) | 1171 | 9.39k | return s; | 1172 | 9.39k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Seed() const Line | Count | Source | 1148 | 27.6k | size_type Seed() const { | 1149 | | // We get a little bit of randomness from the address of the map. The | 1150 | | // lower bits are not very random, due to alignment, so we discard them | 1151 | | // and shift the higher bits into their place. | 1152 | 27.6k | size_type s = reinterpret_cast<uintptr_t>(this) >> 4; | 1153 | 27.6k | #if !defined(GOOGLE_PROTOBUF_NO_RDTSC) | 1154 | | #if defined(__APPLE__) | 1155 | | // Use a commpage-based fast time function on Apple environments (MacOS, | 1156 | | // iOS, tvOS, watchOS, etc). | 1157 | | s += mach_absolute_time(); | 1158 | | #elif defined(__x86_64__) && defined(__GNUC__) | 1159 | | uint32_t hi, lo; | 1160 | 27.6k | asm volatile("rdtsc" : "=a"(lo), "=d"(hi)); | 1161 | 27.6k | s += ((static_cast<uint64_t>(hi) << 32) | lo); | 1162 | | #elif defined(__aarch64__) && defined(__GNUC__) | 1163 | | // There is no rdtsc on ARMv8. CNTVCT_EL0 is the virtual counter of the | 1164 | | // system timer. It runs at a different frequency than the CPU's, but is | 1165 | | // the best source of time-based entropy we get. | 1166 | | uint64_t virtual_timer_value; | 1167 | | asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value)); | 1168 | | s += virtual_timer_value; | 1169 | | #endif | 1170 | 27.6k | #endif // !defined(GOOGLE_PROTOBUF_NO_RDTSC) | 1171 | 27.6k | return s; | 1172 | 27.6k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Seed() const Line | Count | Source | 1148 | 16.5k | size_type Seed() const { | 1149 | | // We get a little bit of randomness from the address of the map. The | 1150 | | // lower bits are not very random, due to alignment, so we discard them | 1151 | | // and shift the higher bits into their place. | 1152 | 16.5k | size_type s = reinterpret_cast<uintptr_t>(this) >> 4; | 1153 | 16.5k | #if !defined(GOOGLE_PROTOBUF_NO_RDTSC) | 1154 | | #if defined(__APPLE__) | 1155 | | // Use a commpage-based fast time function on Apple environments (MacOS, | 1156 | | // iOS, tvOS, watchOS, etc). | 1157 | | s += mach_absolute_time(); | 1158 | | #elif defined(__x86_64__) && defined(__GNUC__) | 1159 | | uint32_t hi, lo; | 1160 | 16.5k | asm volatile("rdtsc" : "=a"(lo), "=d"(hi)); | 1161 | 16.5k | s += ((static_cast<uint64_t>(hi) << 32) | lo); | 1162 | | #elif defined(__aarch64__) && defined(__GNUC__) | 1163 | | // There is no rdtsc on ARMv8. CNTVCT_EL0 is the virtual counter of the | 1164 | | // system timer. It runs at a different frequency than the CPU's, but is | 1165 | | // the best source of time-based entropy we get. | 1166 | | uint64_t virtual_timer_value; | 1167 | | asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value)); | 1168 | | s += virtual_timer_value; | 1169 | | #endif | 1170 | 16.5k | #endif // !defined(GOOGLE_PROTOBUF_NO_RDTSC) | 1171 | 16.5k | return s; | 1172 | 16.5k | } |
|
1173 | | |
1174 | | friend class Arena; |
1175 | | using InternalArenaConstructable_ = void; |
1176 | | using DestructorSkippable_ = void; |
1177 | | |
1178 | | size_type num_elements_; |
1179 | | size_type num_buckets_; |
1180 | | size_type seed_; |
1181 | | size_type index_of_first_non_null_; |
1182 | | void** table_; // an array with num_buckets_ entries |
1183 | | Allocator alloc_; |
1184 | | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(InnerMap); |
1185 | | }; // end of class InnerMap |
1186 | | |
1187 | | template <typename LookupKey> |
1188 | | using key_arg = typename internal::TransparentSupport< |
1189 | | key_type>::template key_arg<LookupKey>; |
1190 | | |
1191 | | public: |
1192 | | // Iterators |
1193 | | class const_iterator { |
1194 | | using InnerIt = typename InnerMap::const_iterator; |
1195 | | |
1196 | | public: |
1197 | | using iterator_category = std::forward_iterator_tag; |
1198 | | using value_type = typename Map::value_type; |
1199 | | using difference_type = ptrdiff_t; |
1200 | | using pointer = const value_type*; |
1201 | | using reference = const value_type&; |
1202 | | |
1203 | 43.8k | const_iterator() {}Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator::const_iterator() google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator::const_iterator() Line | Count | Source | 1203 | 28.9k | const_iterator() {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator::const_iterator() Line | Count | Source | 1203 | 14.9k | const_iterator() {} |
|
1204 | 405k | explicit const_iterator(const InnerIt& it) : it_(it) {}google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator::const_iterator(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const> const&) Line | Count | Source | 1204 | 122k | explicit const_iterator(const InnerIt& it) : it_(it) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator::const_iterator(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const> const&) Line | Count | Source | 1204 | 161k | explicit const_iterator(const InnerIt& it) : it_(it) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator::const_iterator(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const> const&) Line | Count | Source | 1204 | 121k | explicit const_iterator(const InnerIt& it) : it_(it) {} |
|
1205 | | |
1206 | 136k | const_reference operator*() const { return *it_; }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator::operator*() const Line | Count | Source | 1206 | 60.8k | const_reference operator*() const { return *it_; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator::operator*() const Line | Count | Source | 1206 | 49.6k | const_reference operator*() const { return *it_; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator::operator*() const Line | Count | Source | 1206 | 26.4k | const_reference operator*() const { return *it_; } |
|
1207 | 112k | const_pointer operator->() const { return &(operator*()); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator::operator->() const Line | Count | Source | 1207 | 60.8k | const_pointer operator->() const { return &(operator*()); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator::operator->() const Line | Count | Source | 1207 | 33.4k | const_pointer operator->() const { return &(operator*()); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator::operator->() const Line | Count | Source | 1207 | 17.9k | const_pointer operator->() const { return &(operator*()); } |
|
1208 | | |
1209 | 55.7k | const_iterator& operator++() { |
1210 | 55.7k | ++it_; |
1211 | 55.7k | return *this; |
1212 | 55.7k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator::operator++() Line | Count | Source | 1209 | 8.86k | const_iterator& operator++() { | 1210 | 8.86k | ++it_; | 1211 | 8.86k | return *this; | 1212 | 8.86k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator::operator++() Line | Count | Source | 1209 | 30.8k | const_iterator& operator++() { | 1210 | 30.8k | ++it_; | 1211 | 30.8k | return *this; | 1212 | 30.8k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator::operator++() Line | Count | Source | 1209 | 16.0k | const_iterator& operator++() { | 1210 | 16.0k | ++it_; | 1211 | 16.0k | return *this; | 1212 | 16.0k | } |
|
1213 | | const_iterator operator++(int) { return const_iterator(it_++); } |
1214 | | |
1215 | 257k | friend bool operator==(const const_iterator& a, const const_iterator& b) { |
1216 | 257k | return a.it_ == b.it_; |
1217 | 257k | } google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator const&) Line | Count | Source | 1215 | 63.9k | friend bool operator==(const const_iterator& a, const const_iterator& b) { | 1216 | 63.9k | return a.it_ == b.it_; | 1217 | 63.9k | } |
google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator const&) Line | Count | Source | 1215 | 114k | friend bool operator==(const const_iterator& a, const const_iterator& b) { | 1216 | 114k | return a.it_ == b.it_; | 1217 | 114k | } |
google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator const&) Line | Count | Source | 1215 | 78.2k | friend bool operator==(const const_iterator& a, const const_iterator& b) { | 1216 | 78.2k | return a.it_ == b.it_; | 1217 | 78.2k | } |
|
1218 | 119k | friend bool operator!=(const const_iterator& a, const const_iterator& b) { |
1219 | 119k | return !(a == b); |
1220 | 119k | } google::protobuf::operator!=(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator const&) Line | Count | Source | 1218 | 14.2k | friend bool operator!=(const const_iterator& a, const const_iterator& b) { | 1219 | 14.2k | return !(a == b); | 1220 | 14.2k | } |
google::protobuf::operator!=(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator const&) Line | Count | Source | 1218 | 56.4k | friend bool operator!=(const const_iterator& a, const const_iterator& b) { | 1219 | 56.4k | return !(a == b); | 1220 | 56.4k | } |
google::protobuf::operator!=(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator const&) Line | Count | Source | 1218 | 49.1k | friend bool operator!=(const const_iterator& a, const const_iterator& b) { | 1219 | 49.1k | return !(a == b); | 1220 | 49.1k | } |
|
1221 | | |
1222 | | private: |
1223 | | InnerIt it_; |
1224 | | }; |
1225 | | |
1226 | | class iterator { |
1227 | | using InnerIt = typename InnerMap::iterator; |
1228 | | |
1229 | | public: |
1230 | | using iterator_category = std::forward_iterator_tag; |
1231 | | using value_type = typename Map::value_type; |
1232 | | using difference_type = ptrdiff_t; |
1233 | | using pointer = value_type*; |
1234 | | using reference = value_type&; |
1235 | | |
1236 | | iterator() {} |
1237 | 101k | explicit iterator(const InnerIt& it) : it_(it) {}google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::iterator::iterator(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> > const&) Line | Count | Source | 1237 | 43.2k | explicit iterator(const InnerIt& it) : it_(it) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::iterator::iterator(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> > const&) Line | Count | Source | 1237 | 30.1k | explicit iterator(const InnerIt& it) : it_(it) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::iterator::iterator(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> > const&) Line | Count | Source | 1237 | 27.6k | explicit iterator(const InnerIt& it) : it_(it) {} |
|
1238 | | |
1239 | 3.10k | reference operator*() const { return *it_; }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::iterator::operator*() const Line | Count | Source | 1239 | 3.10k | reference operator*() const { return *it_; } |
Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::iterator::operator*() const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::iterator::operator*() const |
1240 | 3.10k | pointer operator->() const { return &(operator*()); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::iterator::operator->() const Line | Count | Source | 1240 | 3.10k | pointer operator->() const { return &(operator*()); } |
Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::iterator::operator->() const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::iterator::operator->() const |
1241 | | |
1242 | | iterator& operator++() { |
1243 | | ++it_; |
1244 | | return *this; |
1245 | | } |
1246 | 30.0k | iterator operator++(int) { return iterator(it_++); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::iterator::operator++(int) Line | Count | Source | 1246 | 10.8k | iterator operator++(int) { return iterator(it_++); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::iterator::operator++(int) Line | Count | Source | 1246 | 10.0k | iterator operator++(int) { return iterator(it_++); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::iterator::operator++(int) Line | Count | Source | 1246 | 9.21k | iterator operator++(int) { return iterator(it_++); } |
|
1247 | | |
1248 | | // Allow implicit conversion to const_iterator. |
1249 | | operator const_iterator() const { // NOLINT(runtime/explicit) |
1250 | | return const_iterator(typename InnerMap::const_iterator(it_)); |
1251 | | } |
1252 | | |
1253 | 35.5k | friend bool operator==(const iterator& a, const iterator& b) { |
1254 | 35.5k | return a.it_ == b.it_; |
1255 | 35.5k | } google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::iterator const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::iterator const&) Line | Count | Source | 1253 | 16.2k | friend bool operator==(const iterator& a, const iterator& b) { | 1254 | 16.2k | return a.it_ == b.it_; | 1255 | 16.2k | } |
google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::iterator const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::iterator const&) Line | Count | Source | 1253 | 10.0k | friend bool operator==(const iterator& a, const iterator& b) { | 1254 | 10.0k | return a.it_ == b.it_; | 1255 | 10.0k | } |
google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::iterator const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::iterator const&) Line | Count | Source | 1253 | 9.21k | friend bool operator==(const iterator& a, const iterator& b) { | 1254 | 9.21k | return a.it_ == b.it_; | 1255 | 9.21k | } |
|
1256 | | friend bool operator!=(const iterator& a, const iterator& b) { |
1257 | | return !(a == b); |
1258 | | } |
1259 | | |
1260 | | private: |
1261 | | friend class Map; |
1262 | | |
1263 | | InnerIt it_; |
1264 | | }; |
1265 | | |
1266 | | iterator begin() { return iterator(elements_.begin()); } |
1267 | 35.5k | iterator end() { return iterator(elements_.end()); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::end() Line | Count | Source | 1267 | 16.2k | iterator end() { return iterator(elements_.end()); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::end() Line | Count | Source | 1267 | 10.0k | iterator end() { return iterator(elements_.end()); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::end() Line | Count | Source | 1267 | 9.21k | iterator end() { return iterator(elements_.end()); } |
|
1268 | 98.7k | const_iterator begin() const { return const_iterator(elements_.begin()); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::begin() const Line | Count | Source | 1268 | 8.53k | const_iterator begin() const { return const_iterator(elements_.begin()); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::begin() const Line | Count | Source | 1268 | 46.7k | const_iterator begin() const { return const_iterator(elements_.begin()); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::begin() const Line | Count | Source | 1268 | 43.4k | const_iterator begin() const { return const_iterator(elements_.begin()); } |
|
1269 | 232k | const_iterator end() const { return const_iterator(elements_.end()); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::end() const Line | Count | Source | 1269 | 63.9k | const_iterator end() const { return const_iterator(elements_.end()); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::end() const Line | Count | Source | 1269 | 98.7k | const_iterator end() const { return const_iterator(elements_.end()); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::end() const Line | Count | Source | 1269 | 69.9k | const_iterator end() const { return const_iterator(elements_.end()); } |
|
1270 | | const_iterator cbegin() const { return begin(); } |
1271 | | const_iterator cend() const { return end(); } |
1272 | | |
1273 | | // Capacity |
1274 | 400k | size_type size() const { return elements_.size(); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::size() const Line | Count | Source | 1274 | 57.9k | size_type size() const { return elements_.size(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::size() const Line | Count | Source | 1274 | 173k | size_type size() const { return elements_.size(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::size() const Line | Count | Source | 1274 | 169k | size_type size() const { return elements_.size(); } |
|
1275 | 286k | bool empty() const { return size() == 0; }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::empty() const Line | Count | Source | 1275 | 31.7k | bool empty() const { return size() == 0; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::empty() const Line | Count | Source | 1275 | 127k | bool empty() const { return size() == 0; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::empty() const Line | Count | Source | 1275 | 127k | bool empty() const { return size() == 0; } |
|
1276 | | |
1277 | | // Element access |
1278 | | template <typename K = key_type> |
1279 | 12.1k | T& operator[](const key_arg<K>& key) { |
1280 | 12.1k | return elements_[key].second; |
1281 | 12.1k | } safepower_agent_proto::NodeState& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 1279 | 8.86k | T& operator[](const key_arg<K>& key) { | 1280 | 8.86k | return elements_[key].second; | 1281 | 8.86k | } |
safepower_agent_proto::DaemonState& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 1279 | 1.33k | T& operator[](const key_arg<K>& key) { | 1280 | 1.33k | return elements_[key].second; | 1281 | 1.33k | } |
safepower_agent_proto::SystemdUnitState& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 1279 | 1.98k | T& operator[](const key_arg<K>& key) { | 1280 | 1.98k | return elements_[key].second; | 1281 | 1.98k | } |
|
1282 | | template < |
1283 | | typename K = key_type, |
1284 | | // Disable for integral types to reduce code bloat. |
1285 | | typename = typename std::enable_if<!std::is_integral<K>::value>::type> |
1286 | 222k | T& operator[](key_arg<K>&& key) { |
1287 | 222k | return elements_[std::forward<K>(key)].second; |
1288 | 222k | } safepower_agent_proto::NodeState& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, void>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 1286 | 68.4k | T& operator[](key_arg<K>&& key) { | 1287 | 68.4k | return elements_[std::forward<K>(key)].second; | 1288 | 68.4k | } |
safepower_agent_proto::DaemonState& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, void>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 1286 | 89.6k | T& operator[](key_arg<K>&& key) { | 1287 | 89.6k | return elements_[std::forward<K>(key)].second; | 1288 | 89.6k | } |
safepower_agent_proto::SystemdUnitState& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, void>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 1286 | 64.7k | T& operator[](key_arg<K>&& key) { | 1287 | 64.7k | return elements_[std::forward<K>(key)].second; | 1288 | 64.7k | } |
|
1289 | | |
1290 | | template <typename K = key_type> |
1291 | | const T& at(const key_arg<K>& key) const { |
1292 | | const_iterator it = find(key); |
1293 | | GOOGLE_CHECK(it != end()) << "key not found: " << static_cast<Key>(key); |
1294 | | return it->second; |
1295 | | } |
1296 | | |
1297 | | template <typename K = key_type> |
1298 | | T& at(const key_arg<K>& key) { |
1299 | | iterator it = find(key); |
1300 | | GOOGLE_CHECK(it != end()) << "key not found: " << static_cast<Key>(key); |
1301 | | return it->second; |
1302 | | } |
1303 | | |
1304 | | // Lookup |
1305 | | template <typename K = key_type> |
1306 | | size_type count(const key_arg<K>& key) const { |
1307 | | return find(key) == end() ? 0 : 1; |
1308 | | } |
1309 | | |
1310 | | template <typename K = key_type> |
1311 | 74.3k | const_iterator find(const key_arg<K>& key) const { |
1312 | 74.3k | return const_iterator(elements_.find(key)); |
1313 | 74.3k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 1311 | 49.6k | const_iterator find(const key_arg<K>& key) const { | 1312 | 49.6k | return const_iterator(elements_.find(key)); | 1313 | 49.6k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 1311 | 16.2k | const_iterator find(const key_arg<K>& key) const { | 1312 | 16.2k | return const_iterator(elements_.find(key)); | 1313 | 16.2k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 1311 | 8.44k | const_iterator find(const key_arg<K>& key) const { | 1312 | 8.44k | return const_iterator(elements_.find(key)); | 1313 | 8.44k | } |
|
1314 | | template <typename K = key_type> |
1315 | 35.5k | iterator find(const key_arg<K>& key) { |
1316 | 35.5k | return iterator(elements_.find(key)); |
1317 | 35.5k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::iterator google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 1315 | 16.2k | iterator find(const key_arg<K>& key) { | 1316 | 16.2k | return iterator(elements_.find(key)); | 1317 | 16.2k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::iterator google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 1315 | 10.0k | iterator find(const key_arg<K>& key) { | 1316 | 10.0k | return iterator(elements_.find(key)); | 1317 | 10.0k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::iterator google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 1315 | 9.21k | iterator find(const key_arg<K>& key) { | 1316 | 9.21k | return iterator(elements_.find(key)); | 1317 | 9.21k | } |
|
1318 | | |
1319 | | template <typename K = key_type> |
1320 | | bool contains(const key_arg<K>& key) const { |
1321 | | return find(key) != end(); |
1322 | | } |
1323 | | |
1324 | | template <typename K = key_type> |
1325 | | std::pair<const_iterator, const_iterator> equal_range( |
1326 | | const key_arg<K>& key) const { |
1327 | | const_iterator it = find(key); |
1328 | | if (it == end()) { |
1329 | | return std::pair<const_iterator, const_iterator>(it, it); |
1330 | | } else { |
1331 | | const_iterator begin = it++; |
1332 | | return std::pair<const_iterator, const_iterator>(begin, it); |
1333 | | } |
1334 | | } |
1335 | | |
1336 | | template <typename K = key_type> |
1337 | | std::pair<iterator, iterator> equal_range(const key_arg<K>& key) { |
1338 | | iterator it = find(key); |
1339 | | if (it == end()) { |
1340 | | return std::pair<iterator, iterator>(it, it); |
1341 | | } else { |
1342 | | iterator begin = it++; |
1343 | | return std::pair<iterator, iterator>(begin, it); |
1344 | | } |
1345 | | } |
1346 | | |
1347 | | // insert |
1348 | | template <typename K, typename... Args> |
1349 | 0 | std::pair<iterator, bool> try_emplace(K&& k, Args&&... args) { |
1350 | 0 | auto p = |
1351 | 0 | elements_.try_emplace(std::forward<K>(k), std::forward<Args>(args)...); |
1352 | 0 | return std::pair<iterator, bool>(iterator(p.first), p.second); |
1353 | 0 | } Unexecuted instantiation: std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::iterator, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::NodeState const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::NodeState const&) Unexecuted instantiation: std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::iterator, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::DaemonState const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::DaemonState const&) Unexecuted instantiation: std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::iterator, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::SystemdUnitState const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::SystemdUnitState const&) |
1354 | | std::pair<iterator, bool> insert(const value_type& value) { |
1355 | | return try_emplace(value.first, value.second); |
1356 | | } |
1357 | | std::pair<iterator, bool> insert(value_type&& value) { |
1358 | | return try_emplace(value.first, std::move(value.second)); |
1359 | | } |
1360 | | template <typename... Args> |
1361 | | std::pair<iterator, bool> emplace(Args&&... args) { |
1362 | | return insert(value_type(std::forward<Args>(args)...)); |
1363 | | } |
1364 | | template <class InputIt> |
1365 | 0 | void insert(InputIt first, InputIt last) { |
1366 | 0 | for (; first != last; ++first) { |
1367 | 0 | try_emplace(first->first, first->second); |
1368 | 0 | } |
1369 | 0 | } Unexecuted instantiation: void google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::insert<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator) Unexecuted instantiation: void google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::insert<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator) Unexecuted instantiation: void google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::insert<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator) |
1370 | | void insert(std::initializer_list<value_type> values) { |
1371 | | insert(values.begin(), values.end()); |
1372 | | } |
1373 | | |
1374 | | // Erase and clear |
1375 | | template <typename K = key_type> |
1376 | 30.0k | size_type erase(const key_arg<K>& key) { |
1377 | 30.0k | iterator it = find(key); |
1378 | 30.0k | if (it == end()) { |
1379 | 0 | return 0; |
1380 | 30.0k | } else { |
1381 | 30.0k | erase(it); |
1382 | 30.0k | return 1; |
1383 | 30.0k | } |
1384 | 30.0k | } unsigned long google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::erase<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 1376 | 10.8k | size_type erase(const key_arg<K>& key) { | 1377 | 10.8k | iterator it = find(key); | 1378 | 10.8k | if (it == end()) { | 1379 | 0 | return 0; | 1380 | 10.8k | } else { | 1381 | 10.8k | erase(it); | 1382 | 10.8k | return 1; | 1383 | 10.8k | } | 1384 | 10.8k | } |
unsigned long google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::erase<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 1376 | 10.0k | size_type erase(const key_arg<K>& key) { | 1377 | 10.0k | iterator it = find(key); | 1378 | 10.0k | if (it == end()) { | 1379 | 0 | return 0; | 1380 | 10.0k | } else { | 1381 | 10.0k | erase(it); | 1382 | 10.0k | return 1; | 1383 | 10.0k | } | 1384 | 10.0k | } |
unsigned long google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::erase<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 1376 | 9.21k | size_type erase(const key_arg<K>& key) { | 1377 | 9.21k | iterator it = find(key); | 1378 | 9.21k | if (it == end()) { | 1379 | 0 | return 0; | 1380 | 9.21k | } else { | 1381 | 9.21k | erase(it); | 1382 | 9.21k | return 1; | 1383 | 9.21k | } | 1384 | 9.21k | } |
|
1385 | 30.0k | iterator erase(iterator pos) { |
1386 | 30.0k | iterator i = pos++; |
1387 | 30.0k | elements_.erase(i.it_); |
1388 | 30.0k | return pos; |
1389 | 30.0k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::erase(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::iterator) Line | Count | Source | 1385 | 10.8k | iterator erase(iterator pos) { | 1386 | 10.8k | iterator i = pos++; | 1387 | 10.8k | elements_.erase(i.it_); | 1388 | 10.8k | return pos; | 1389 | 10.8k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::erase(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::iterator) Line | Count | Source | 1385 | 10.0k | iterator erase(iterator pos) { | 1386 | 10.0k | iterator i = pos++; | 1387 | 10.0k | elements_.erase(i.it_); | 1388 | 10.0k | return pos; | 1389 | 10.0k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::erase(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::iterator) Line | Count | Source | 1385 | 9.21k | iterator erase(iterator pos) { | 1386 | 9.21k | iterator i = pos++; | 1387 | 9.21k | elements_.erase(i.it_); | 1388 | 9.21k | return pos; | 1389 | 9.21k | } |
|
1390 | | void erase(iterator first, iterator last) { |
1391 | | while (first != last) { |
1392 | | first = erase(first); |
1393 | | } |
1394 | | } |
1395 | 37.8k | void clear() { elements_.clear(); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::clear() Line | Count | Source | 1395 | 20.0k | void clear() { elements_.clear(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::clear() Line | Count | Source | 1395 | 8.86k | void clear() { elements_.clear(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::clear() Line | Count | Source | 1395 | 8.86k | void clear() { elements_.clear(); } |
|
1396 | | |
1397 | | // Assign |
1398 | 0 | Map& operator=(const Map& other) { |
1399 | 0 | if (this != &other) { |
1400 | 0 | clear(); |
1401 | 0 | insert(other.begin(), other.end()); |
1402 | 0 | } |
1403 | 0 | return *this; |
1404 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::operator=(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const&) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::operator=(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const&) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::operator=(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const&) |
1405 | | |
1406 | 0 | void swap(Map& other) { |
1407 | 0 | if (arena() == other.arena()) { |
1408 | 0 | InternalSwap(other); |
1409 | 0 | } else { |
1410 | | // TODO(zuguang): optimize this. The temporary copy can be allocated |
1411 | | // in the same arena as the other message, and the "other = copy" can |
1412 | | // be replaced with the fast-path swap above. |
1413 | 0 | Map copy = *this; |
1414 | 0 | *this = other; |
1415 | 0 | other = copy; |
1416 | 0 | } |
1417 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::swap(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>&) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::swap(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>&) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::swap(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>&) |
1418 | | |
1419 | 413k | void InternalSwap(Map& other) { elements_.Swap(&other.elements_); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InternalSwap(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>&) Line | Count | Source | 1419 | 26.2k | void InternalSwap(Map& other) { elements_.Swap(&other.elements_); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InternalSwap(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>&) Line | Count | Source | 1419 | 193k | void InternalSwap(Map& other) { elements_.Swap(&other.elements_); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InternalSwap(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>&) Line | Count | Source | 1419 | 193k | void InternalSwap(Map& other) { elements_.Swap(&other.elements_); } |
|
1420 | | |
1421 | | // Access to hasher. Currently this returns a copy, but it may |
1422 | | // be modified to return a const reference in the future. |
1423 | | hasher hash_function() const { return elements_.hash_function(); } |
1424 | | |
1425 | 0 | size_t SpaceUsedExcludingSelfLong() const { |
1426 | 0 | if (empty()) return 0; |
1427 | 0 | return elements_.SpaceUsedInternal() + internal::SpaceUsedInValues(this); |
1428 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::SpaceUsedExcludingSelfLong() const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::SpaceUsedExcludingSelfLong() const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::SpaceUsedExcludingSelfLong() const |
1429 | | |
1430 | | private: |
1431 | 759k | Arena* arena() const { return elements_.arena(); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::arena() const Line | Count | Source | 1431 | 334k | Arena* arena() const { return elements_.arena(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::arena() const Line | Count | Source | 1431 | 115k | Arena* arena() const { return elements_.arena(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::arena() const Line | Count | Source | 1431 | 309k | Arena* arena() const { return elements_.arena(); } |
|
1432 | | InnerMap elements_; |
1433 | | |
1434 | | friend class Arena; |
1435 | | using InternalArenaConstructable_ = void; |
1436 | | using DestructorSkippable_ = void; |
1437 | | template <typename Derived, typename K, typename V, |
1438 | | internal::WireFormatLite::FieldType key_wire_type, |
1439 | | internal::WireFormatLite::FieldType value_wire_type> |
1440 | | friend class internal::MapFieldLite; |
1441 | | }; |
1442 | | |
1443 | | } // namespace protobuf |
1444 | | } // namespace google |
1445 | | |
1446 | | #include <google/protobuf/port_undef.inc> |
1447 | | |
1448 | | #endif // GOOGLE_PROTOBUF_MAP_H__ |