Lines Matching +full:container +full:- +full:based
1 .. _module-pw_containers:
6 The ``pw_containers`` module provides embedded-friendly container classes.
8 ----------
10 ----------
12 fixed-size buffer. Vectors must be declared with an explicit maximum size
22 ---------------
24 ---------------
27 ---------------
29 ---------------
32 --------------------------
34 --------------------------
40 .. tab-set::
42 .. tab-item:: C++
49 .. code-block:: c++
51 // Declare a queue with capacity sufficient for one 10-byte entry or
68 .. code-block:: c++
80 .. tab-item:: C
86 .. code-block:: c
88 // Declare a queue with capacity sufficient for one 10-byte entry or
105 .. code-block:: c
128 not the previous, as in a single-linked list. Given that these operations would
135 ---
137 :content-only:
141 -
143 :content-only:
146 ------
150 .. _module-pw_containers-intrusive_list:
152 -----------------
154 -----------------
155 ``pw::IntrusiveList`` provides an embedded-friendly, double-linked, intrusive
176 Originally, ``pw::IntrusiveList<T>`` was implemented as a singly-linked list.
181 .. _module-pw_containers-intrusive_list-example:
188 :start-after: [pw_containers-intrusive_list]
189 :end-before: [pw_containers-intrusive_list]
191 ------------------------
193 ------------------------
194 ``pw::IntrusiveForwardList`` provides an embedded-friendly, singly-linked,
196 :ref:`module-pw_containers-intrusive_list`, except that is singly rather than
212 :start-after: [pw_containers-intrusive_forward_list]
213 :end-before: [pw_containers-intrusive_forward_list]
222 - Removing an item from a list using
224 - Getting the list size using ``pw::IntrusiveForwardList<T>::size()``.
234 .. _module-pw_containers-intrusivelist-size-report:
240 .. _module-pw_containers-intrusive_set:
242 ----------------
244 ----------------
245 ``pw::IntrusiveSet`` provides an embedded-friendly, tree-based, intrusive
247 :ref:`module-pw_containers-intrusive_list`.
262 :start-after: [pw_containers-intrusive_set]
263 :end-before: [pw_containers-intrusive_set]
265 ---------------------
267 ---------------------
268 ``pw::IntrusiveMultiSet`` provides an embedded-friendly, tree-based, intrusive
270 :ref:`module-pw_containers-intrusive_set`, except that the tree may contain
286 :start-after: [pw_containers-intrusive_multiset]
287 :end-before: [pw_containers-intrusive_multiset]
289 .. _module-pw_containers-intrusive_map:
291 ----------------
293 ----------------
294 ``pw::IntrusiveMap`` provides an embedded-friendly, tree-based, intrusive
296 :ref:`module-pw_containers-intrusive_list`.
311 :start-after: [pw_containers-intrusive_map]
312 :end-before: [pw_containers-intrusive_map]
314 ---------------------
316 ---------------------
317 ``pw::IntrusiveMultiMap`` provides an embedded-friendly, tree-based, intrusive
319 :ref:`module-pw_containers-intrusive_map`, except that the tree may contain
335 :start-after: [pw_containers-intrusive_multimap]
336 :end-before: [pw_containers-intrusive_multimap]
338 ------------------------------------
340 ------------------------------------
348 :start-after: [pw_containers-multiple_containers]
349 :end-before: [pw_containers-multiple_containers]
354 -----------------------
356 -----------------------
357 ``FlatMap`` provides a simple, fixed-size associative array with `O`\ (log `n`)
377 :start-after: [pw_containers-flat_map]
378 :end-before: [pw_containers-flat_map]
380 ----------------------------
382 ----------------------------
385 -------------------------------
387 -------------------------------
390 ``operator--``, ``operator==``, ``operator!=``, and the standard iterator
395 ``operator*()`` and ``operator->()`` as appropriate. The new iterator might
403 :start-after: [pw_containers-wrapped_iterator]
404 :end-before: [pw_containers-wrapped_iterator]
407 view that iterates over a matching values in a container and applies a
414 `generator expressions <https://www.python.org/dev/peps/pep-0289/>`_ (or `filter
419 into a new container.
421 ------------------------
423 ------------------------
424 ``pw::containers::to_array`` is a C++14-compatible implementation of C++20's
425 `std::to_array <https://en.cppreference.com/w/cpp/container/array/to_array>`_.
429 -------------------------
431 -------------------------
432 Pigweed provides a set of Container-based versions of algorithmic functions
433 within the C++ standard library, based on a subset of
434 ``absl/algorithm/container.h``.
438 Container-based version of the <algorithm> ``std::all_of()`` function to
439 test if all elements within a container satisfy a condition.
443 Container-based version of the <algorithm> ``std::any_of()`` function to
444 test if any element in a container fulfills a condition.
448 Container-based version of the <algorithm> ``std::none_of()`` function to
449 test if no elements in a container fulfill a condition.
453 Container-based version of the <algorithm> ``std::for_each()`` function to
454 apply a function to a container's elements.
458 Container-based version of the <algorithm> ``std::find()`` function to find
459 the first element containing the passed value within a container value.
463 Container-based version of the <algorithm> ``std::find_if()`` function to find
464 the first element in a container matching the given condition.
468 Container-based version of the <algorithm> ``std::find_if_not()`` function to
469 find the first element in a container not matching the given condition.
473 Container-based version of the <algorithm> ``std::find_end()`` function to
474 find the last subsequence within a container.
478 Container-based version of the <algorithm> ``std::find_first_of()`` function
479 to find the first element within the container that is also within the options
480 container.
484 Container-based version of the <algorithm> ``std::adjacent_find()`` function
485 to find equal adjacent elements within a container.
489 Container-based version of the <algorithm> ``std::count()`` function to count
490 values that match within a container.
494 Container-based version of the <algorithm> ``std::count_if()`` function to
495 count values matching a condition within a container.
499 Container-based version of the <algorithm> ``std::mismatch()`` function to
508 Container-based version of the <algorithm> ``std::equal()`` function to
514 ``std::equal()``: while the latter iterates over the second container only
515 up to the size of the first container, ``Equal()`` also checks whether the
516 container sizes are equal. This better matches expectations about
517 ``Equal()`` based on its signature.
521 Container-based version of the <algorithm> ``std::is_permutation()`` function
522 to test whether a container is a permutation of another.
526 Container-based version of the <algorithm> ``std::search()`` function to
527 search a container for a subsequence.
531 Container-based version of the <algorithm> ``std::search_n()`` function to
532 search a container for the first sequence of N elements.
534 -------------
536 -------------
537 - C++17
539 ------
541 ------