cpp-stat-bench 0.24.0
Benchmark library with statistics for C++.
Loading...
Searching...
No Matches
benchmark_case_registry.h
Go to the documentation of this file.
1/*
2 * Copyright 2021 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
29
30namespace stat_bench {
31namespace bench_impl {
32
37public:
42
48 void add(std::shared_ptr<IBenchmarkCase> bench_case);
49
57
63 void filter_by(const filters::ComposedFilter& filter);
64
70 [[nodiscard]] auto benchmarks() const noexcept
71 -> const util::OrderedMap<BenchmarkGroupName, BenchmarkGroup>&;
72
78 [[nodiscard]] static auto instance() -> BenchmarkCaseRegistry&;
79
80private:
82 util::OrderedMap<BenchmarkGroupName, BenchmarkGroup> groups_{};
83};
84
85} // namespace bench_impl
86} // namespace stat_bench
Definition of BenchmarkGroup class.
Definition of BenchmarkGroupName class.
Class of names of groups of benchmarks.
void filter_by(const filters::ComposedFilter &filter)
Filter.
void add(std::shared_ptr< IBenchmarkCase > bench_case)
Add a case.
static auto instance() -> BenchmarkCaseRegistry &
Get an instance of the registry.
auto benchmarks() const noexcept -> const util::OrderedMap< BenchmarkGroupName, BenchmarkGroup > &
Get benchmarks.
auto add_or_get_group(const BenchmarkGroupName &name) -> BenchmarkGroup &
Add a group if not exists, and return it.
Class of groups of cases in benchmarks.
Class of composed filters of benchmarks.
Definition of ComposedFilter class.
Definition of IBenchmarkCase class.
Namespace of internal implementation.
Namespace of utility functions and classes.
Namespace of stat_bench source codes.
Definition of OrderedMap class.