• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1.. _module-pw_containers:
2
3=============
4pw_containers
5=============
6.. pigweed-module::
7   :name: pw_containers
8
9- **Familiar**: Pigweed containers resemble standard library containers.
10- **Comprehensive**: You can pick containers for speed, size, or in-between.
11- **Embedded-friendly**: No dynamic allocation needed!
12
13.. literalinclude:: examples/vector.cc
14   :language: cpp
15   :linenos:
16   :start-after: [pw_containers-vector]
17   :end-before: [pw_containers-vector]
18
19Much like the standard containers library, the ``pw_containers`` module provides
20embedded-friendly container class templates and algorithms. These allow
21developers to implement data structures for embedded devices that are more
22resource-constrained than conventional applications. These containers include:
23
24.. grid:: 2
25
26   .. grid-item-card:: :octicon:`list-ordered` Lists
27      :link: module-pw_containers-lists
28      :link-type: ref
29      :class-item: sales-pitch-cta-primary
30
31      Intrusive singly and doubly linked lists.
32
33   .. grid-item-card:: :octicon:`database` Maps
34      :link: module-pw_containers-maps
35      :link-type: ref
36      :class-item: sales-pitch-cta-secondary
37
38      Key-value stores with constant or logarithmic performance.
39
40.. grid:: 2
41
42   .. grid-item-card:: :octicon:`iterations` Queues
43      :link: module-pw_containers-queues
44      :link-type: ref
45      :class-item: sales-pitch-cta-secondary
46
47      Uni- and bidirectional FIFOs.
48
49   .. grid-item-card:: :octicon:`list-unordered` Sets
50      :link: module-pw_containers-sets
51      :link-type: ref
52      :class-item: sales-pitch-cta-primary
53
54      Unordered collections with fast lookup, insertion, and deletion.
55
56.. grid:: 2
57
58   .. grid-item-card:: :octicon:`tools` Utilities
59      :link: module-pw_containers-utilities
60      :link-type: ref
61      :class-item: sales-pitch-cta-primary
62
63      Algorithms and iterators for Pigweed containers.
64
65   .. grid-item-card:: :octicon:`code` Vector
66      :link: module-pw_containers-vectors
67      :link-type: ref
68      :class-item: sales-pitch-cta-secondary
69
70      Variable length array with fixed storage.
71
72------
73Zephyr
74------
75To enable ``pw_containers`` for Zephyr add ``CONFIG_PIGWEED_CONTAINERS=y`` to
76the project's configuration.
77
78.. toctree::
79   :hidden:
80   :maxdepth: 1
81
82   lists
83   maps
84   queues
85   sets
86   vectors
87   utilities
88   multiple_containers
89