cpp-stat-bench 0.24.0
Benchmark library with statistics for C++.
Loading...
Searching...
No Matches
composed_filter.h
Go to the documentation of this file.
1/*
2 * Copyright 2023 MusicScience37 (Kenta Kabashima)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
20#pragma once
21
22#include <memory>
23#include <string>
24#include <vector>
25
28
29namespace stat_bench {
30namespace filters {
31
36public:
40 ComposedFilter() = default;
41
47 void include_with_glob(const std::string& pattern);
48
54 void exclude_with_glob(const std::string& pattern);
55
62 void include_with_regex(const std::string& regex);
63
70 void exclude_with_regex(const std::string& regex);
71
79 [[nodiscard]] auto check(const BenchmarkFullName& name) const -> bool;
80
81private:
83 std::vector<std::shared_ptr<INameFilter>> included_filter_{};
84
86 std::vector<std::shared_ptr<INameFilter>> excluded_filter_{};
87};
88
89} // namespace filters
90} // namespace stat_bench
Definition of BenchmarkFullName class.
Class of information of cases in benchmarks.
void include_with_regex(const std::string &regex)
Add a filter of benchmark names to include using regular expressions.
void include_with_glob(const std::string &pattern)
Add a filter of benchmark names to include using glob patterns.
void exclude_with_regex(const std::string &regex)
Add a filter of benchmark names to exclude using regular expressions.
void exclude_with_glob(const std::string &pattern)
Add a filter of benchmark names to exclude using glob patterns.
ComposedFilter()=default
Constructor.
auto check(const BenchmarkFullName &name) const -> bool
Check whether a name matches to this filter.
Definition of INameFilter class.
Namespace of filters of benchmarks.
Namespace of stat_bench source codes.