cpp-stat-bench 0.24.0
Benchmark library with statistics for C++.
Loading...
Searching...
No Matches
measurement_config.h
Go to the documentation of this file.
1/*
2 * Copyright 2025 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 <cstddef>
23#include <optional>
24#include <string>
25
27
28namespace stat_bench {
29
34public:
39
46 auto type(std::string value) -> MeasurementConfig&;
47
54 auto samples(std::size_t value) -> MeasurementConfig&;
55
62 auto warming_up_samples(std::size_t value) -> MeasurementConfig&;
63
70 auto iterations(std::size_t value) -> MeasurementConfig&;
71
77 [[nodiscard]] auto type() const noexcept
79
85 [[nodiscard]] auto samples() const noexcept -> std::optional<std::size_t>;
86
92 [[nodiscard]] auto warming_up_samples() const noexcept
93 -> std::optional<std::size_t>;
94
100 [[nodiscard]] auto iterations() const noexcept
101 -> std::optional<std::size_t>;
102
103private:
106
108 std::optional<std::size_t> samples_;
109
111 std::optional<std::size_t> warming_up_samples_;
112
114 std::optional<std::size_t> iterations_;
115};
116
117} // namespace stat_bench
auto warming_up_samples() const noexcept -> std::optional< std::size_t >
Get the number of samples for warming up.
auto iterations() const noexcept -> std::optional< std::size_t >
Get the number of iterations.
auto type() const noexcept -> const measurer::MeasurementType &
Get the measurement type.
auto samples() const noexcept -> std::optional< std::size_t >
Get the number of samples (except for warming up).
Class of names of measurement types.
Definition of MeasurementType class.
Namespace of stat_bench source codes.