• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2020 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7#     https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15load(
16    "//pw_build:pigweed.bzl",
17    "pw_cc_test",
18)
19
20package(default_visibility = ["//visibility:public"])
21
22licenses(["notice"])
23
24cc_library(
25    name = "pw_containers",
26    deps = [
27        ":algorithm",
28        ":flat_map",
29        ":inline_deque",
30        ":inline_queue",
31        ":intrusive_list",
32        ":vector",
33    ],
34)
35
36cc_library(
37    name = "algorithm",
38    hdrs = [
39        "public/pw_containers/algorithm.h",
40        "public/pw_containers/internal/algorithm_internal.h",
41    ],
42    includes = ["public"],
43)
44
45cc_library(
46    name = "intrusive_list",
47    srcs = [
48        "intrusive_list.cc",
49        "public/pw_containers/internal/intrusive_list_impl.h",
50    ],
51    hdrs = [
52        "public/pw_containers/intrusive_list.h",
53    ],
54    includes = ["public"],
55    deps = [
56        "//pw_assert",
57        "//pw_compilation_testing:negative_compilation_testing",
58    ],
59)
60
61cc_library(
62    name = "iterator",
63    hdrs = ["public/pw_containers/iterator.h"],
64    includes = ["public"],
65)
66
67cc_library(
68    name = "inline_deque",
69    hdrs = [
70        "public/pw_containers/inline_deque.h",
71    ],
72    includes = ["public"],
73    deps = [
74        ":raw_storage",
75        "//pw_assert",
76        "//pw_preprocessor",
77        "//pw_span",
78    ],
79)
80
81cc_library(
82    name = "inline_queue",
83    hdrs = [
84        "public/pw_containers/inline_queue.h",
85    ],
86    includes = ["public"],
87    deps = [
88        ":inline_deque",
89    ],
90)
91
92cc_library(
93    name = "inline_var_len_entry_queue",
94    srcs = ["inline_var_len_entry_queue.c"],
95    hdrs = ["public/pw_containers/inline_var_len_entry_queue.h"],
96    includes = ["public"],
97    deps = [
98        ":raw_storage",
99        "//pw_assert",
100        "//pw_varint",
101    ],
102)
103
104cc_library(
105    name = "vector",
106    hdrs = [
107        "public/pw_containers/vector.h",
108    ],
109    includes = ["public"],
110    deps = [
111        "//pw_assert",
112        "//pw_preprocessor",
113    ],
114)
115
116cc_library(
117    name = "filtered_view",
118    hdrs = ["public/pw_containers/filtered_view.h"],
119    includes = ["public"],
120    deps = [
121        "//pw_assert",
122        "//pw_containers",
123    ],
124)
125
126cc_library(
127    name = "flat_map",
128    hdrs = ["public/pw_containers/flat_map.h"],
129    includes = ["public"],
130    deps = ["//pw_assert"],
131)
132
133cc_library(
134    name = "raw_storage",
135    hdrs = [
136        "public/pw_containers/internal/raw_storage.h",
137    ],
138    includes = ["public"],
139    visibility = [":__subpackages__"],
140)
141
142cc_library(
143    name = "test_helpers",
144    srcs = ["test_helpers.cc"],
145    hdrs = ["pw_containers_private/test_helpers.h"],
146    visibility = [":__subpackages__"],
147)
148
149cc_library(
150    name = "to_array",
151    hdrs = ["public/pw_containers/to_array.h"],
152    includes = ["public"],
153)
154
155cc_library(
156    name = "wrapped_iterator",
157    hdrs = ["public/pw_containers/wrapped_iterator.h"],
158    includes = ["public"],
159)
160
161pw_cc_test(
162    name = "algorithm_test",
163    srcs = ["algorithm_test.cc"],
164    deps = [
165        ":algorithm",
166        ":flat_map",
167        ":intrusive_list",
168        ":vector",
169        "//pw_span",
170    ],
171)
172
173pw_cc_test(
174    name = "filtered_view_test",
175    srcs = ["filtered_view_test.cc"],
176    deps = [
177        ":algorithm",
178        ":filtered_view",
179        ":flat_map",
180        ":intrusive_list",
181    ],
182)
183
184pw_cc_test(
185    name = "flat_map_test",
186    srcs = [
187        "flat_map_test.cc",
188    ],
189    deps = [
190        ":pw_containers",
191        "//pw_polyfill",
192        "//pw_unit_test",
193    ],
194)
195
196pw_cc_test(
197    name = "inline_var_len_entry_queue_test",
198    srcs = [
199        "inline_var_len_entry_queue_test.cc",
200        "pw_containers_private/inline_var_len_entry_queue_test_oracle.h",
201    ],
202    deps = [
203        ":inline_var_len_entry_queue",
204        "//pw_bytes",
205    ],
206)
207
208pw_cc_test(
209    name = "vector_test",
210    srcs = [
211        "vector_test.cc",
212    ],
213    deps = [
214        ":pw_containers",
215        ":test_helpers",
216        "//pw_compilation_testing:negative_compilation_testing",
217        "//pw_unit_test",
218    ],
219)
220
221pw_cc_test(
222    name = "inline_deque_test",
223    srcs = [
224        "inline_deque_test.cc",
225    ],
226    deps = [
227        ":algorithm",
228        ":inline_deque",
229        ":test_helpers",
230        "//pw_compilation_testing:negative_compilation_testing",
231        "//pw_unit_test",
232    ],
233)
234
235pw_cc_test(
236    name = "inline_queue_test",
237    srcs = [
238        "inline_queue_test.cc",
239    ],
240    deps = [
241        ":algorithm",
242        ":inline_queue",
243        ":test_helpers",
244        "//pw_compilation_testing:negative_compilation_testing",
245        "//pw_unit_test",
246    ],
247)
248
249pw_cc_test(
250    name = "raw_storage_test",
251    srcs = [
252        "raw_storage_test.cc",
253    ],
254    deps = [
255        ":raw_storage",
256        ":test_helpers",
257        "//pw_unit_test",
258    ],
259)
260
261pw_cc_test(
262    name = "to_array_test",
263    srcs = ["to_array_test.cc"],
264    deps = [":to_array"],
265)
266
267pw_cc_test(
268    name = "wrapped_iterator_test",
269    srcs = ["wrapped_iterator_test.cc"],
270    deps = [":wrapped_iterator"],
271)
272
273pw_cc_test(
274    name = "intrusive_list_test",
275    srcs = [
276        "intrusive_list_test.cc",
277    ],
278    deps = [
279        ":intrusive_list",
280        ":vector",
281        "//pw_unit_test",
282    ],
283)
284