cpp-stat-bench 0.24.0
Benchmark library with statistics for C++.
Loading...
Searching...
No Matches
stat_bench::FixtureBase Class Referenceabstract

Base class of fixtures. More...

#include <stat_bench/fixture_base.h>

+ Inheritance diagram for stat_bench::FixtureBase:
+ Collaboration diagram for stat_bench::FixtureBase:

Public Member Functions

 FixtureBase (const FixtureBase &)=delete
 
 FixtureBase (FixtureBase &&)=delete
 
 ~FixtureBase () override=default
 Destructor.
 
auto operator= (const FixtureBase &) -> FixtureBase &=delete
 
auto operator= (FixtureBase &&) -> FixtureBase &=delete
 
virtual void run ()=0
 Run actual process in each case.
 
Virtual functions implemented in fixture classes.
virtual void setup (InvocationContext &context)
 Setup before running actual process.
 
virtual void tear_down (InvocationContext &context)
 Tear down after running actual process.
 
Functions to set parameters.
template<typename T>
auto add_param (const param::ParameterName &param_name) -> std::shared_ptr< param::ParameterValueVector< T > >
 Add a parameter.
 
template<typename T>
auto add_param (std::string param_name) -> std::shared_ptr< param::ParameterValueVector< T > >
 Add a parameter.
 
auto add_threads_param () -> std::shared_ptr< param::ParameterValueVector< std::size_t > >
 Add a parameter of the number of threads.
 
- Public Member Functions inherited from stat_bench::bench_impl::IBenchmarkCase
 IBenchmarkCase (const IBenchmarkCase &)=delete
 
 IBenchmarkCase (IBenchmarkCase &&)=delete
 
virtual ~IBenchmarkCase ()=default
 Destructor.
 
virtual auto info () const noexcept -> const BenchmarkFullName &=0
 Get information of this case.
 
auto operator= (const IBenchmarkCase &) -> IBenchmarkCase &=delete
 
auto operator= (IBenchmarkCase &&) -> IBenchmarkCase &=delete
 

Protected Member Functions

 FixtureBase ()=default
 Constructor.
 
- Protected Member Functions inherited from stat_bench::bench_impl::IBenchmarkCase
 IBenchmarkCase ()=default
 Constructor.
 

Detailed Description

Member Function Documentation

◆ add_param() [1/2]

template<typename T>
auto stat_bench::FixtureBase::add_param ( const param::ParameterName & param_name) -> std::shared_ptr<param::ParameterValueVector<T>>
inlinenodiscard

Add a parameter.

Template Parameters
TType of parameter values.
Parameters
[in]param_nameParameter name.
Returns
Vector of parameter values.
Examples
configure_plotting.cpp, custom_output_with_stat.cpp, custom_output_without_stat.cpp, and parameterized_benchmark.cpp.

Definition at line 89 of file fixture_base.h.

◆ add_param() [2/2]

template<typename T>
auto stat_bench::FixtureBase::add_param ( std::string param_name) -> std::shared_ptr<param::ParameterValueVector<T>>
inlinenodiscard

Add a parameter.

Template Parameters
TType of parameter values.
Parameters
[in]param_nameParameter name.
Returns
Vector of parameter values.

Definition at line 102 of file fixture_base.h.

◆ add_threads_param()

auto stat_bench::FixtureBase::add_threads_param ( ) -> std::shared_ptr<param::ParameterValueVector<std::size_t>>
inline

Add a parameter of the number of threads.

Returns
Vector of parameter values.

Definition at line 112 of file fixture_base.h.

◆ run()

virtual void stat_bench::FixtureBase::run ( )
pure virtual

Run actual process in each case.

Note
This will be implemented in each case, so don't implement in fixtures.

◆ setup()

virtual void stat_bench::FixtureBase::setup ( InvocationContext & context)
inlinevirtual

Setup before running actual process.

Note
This can be implemented in fixtures to perform common initialization process.
Parameters
[in]contextContext.

Definition at line 55 of file fixture_base.h.

◆ tear_down()

virtual void stat_bench::FixtureBase::tear_down ( InvocationContext & context)
inlinevirtual

Tear down after running actual process.

Note
This can be implemented in fixtures to perform common finalization process.
This will be called even when errors occurred in run function.
Parameters
[in]contextContext.

Definition at line 69 of file fixture_base.h.


The documentation for this class was generated from the following file: