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

Class of dictionaries of parameters. More...

#include <stat_bench/param/parameter_dict.h>

+ Collaboration diagram for stat_bench::param::ParameterDict:

Public Member Functions

 ParameterDict (util::OrderedMap< ParameterName, ParameterValue > data)
 Constructor.
 
auto as_string_dict () const -> std::unordered_map< util::Utf8String, util::Utf8String >
 Get as a dictionary of string values.
 
auto calculate_hash () const -> std::size_t
 Calculate hash value.
 
auto clone_without (const ParameterName &param_name) const -> ParameterDict
 Create a new dictionary without a parameter.
 
auto empty () const noexcept -> bool
 Check whether this is empty.
 
auto format_to (fmt::format_context::iterator out) const -> fmt::format_context::iterator
 Format to string.
 
template<typename T>
auto get (const ParameterName &param_name) const -> const T &
 Get a parameter value.
 
auto get_as_double (const ParameterName &param_name) const -> double
 Get a parameter value as double.
 
auto get_as_variant (const ParameterName &param_name) const -> ParameterValueVariant
 Get a parameter value as a variant object.
 
auto has (const ParameterName &param_name) const -> bool
 Check whether this has a parameter with a name.
 
auto operator!= (const ParameterDict &rhs) const -> bool
 Check whether this is not equal to another dictionary.
 
auto operator== (const ParameterDict &rhs) const -> bool
 Check whether this is equal to another dictionary.
 

Detailed Description

Class of dictionaries of parameters.

Definition at line 44 of file parameter_dict.h.

Constructor & Destructor Documentation

◆ ParameterDict()

stat_bench::param::ParameterDict::ParameterDict ( util::OrderedMap< ParameterName, ParameterValue > data)
explicit

Constructor.

Parameters
[in]dataData.

Definition at line 31 of file parameter_dict.cpp.

Member Function Documentation

◆ as_string_dict()

auto stat_bench::param::ParameterDict::as_string_dict ( ) const -> std::unordered_map<util::Utf8String, util::Utf8String>
nodiscard

Get as a dictionary of string values.

Returns
Dictionary.

Definition at line 79 of file parameter_dict.cpp.

◆ calculate_hash()

auto stat_bench::param::ParameterDict::calculate_hash ( ) const -> std::size_t
nodiscard

Calculate hash value.

Returns
Hash value.

Definition at line 105 of file parameter_dict.cpp.

◆ clone_without()

auto stat_bench::param::ParameterDict::clone_without ( const ParameterName & param_name) const -> ParameterDict
nodiscard

Create a new dictionary without a parameter.

Parameters
[in]param_nameParameter name to remove.
Returns
New dictionary.

Definition at line 89 of file parameter_dict.cpp.

◆ empty()

auto stat_bench::param::ParameterDict::empty ( ) const -> bool
nodiscardnoexcept

Check whether this is empty.

Return values
trueThis has no parameter.
falseThis has one or more parameters.

Definition at line 35 of file parameter_dict.cpp.

◆ format_to()

auto stat_bench::param::ParameterDict::format_to ( fmt::format_context::iterator out) const -> fmt::format_context::iterator
nodiscard

Format to string.

Parameters
[in]outOutput iterator to write the formatted string.
Returns
Output iterator after formatting.

Definition at line 61 of file parameter_dict.cpp.

◆ get()

template<typename T>
auto stat_bench::param::ParameterDict::get ( const ParameterName & param_name) const -> const T&
inlinenodiscard

Get a parameter value.

Template Parameters
TType of the value.
Parameters
[in]param_nameParameter name.
Returns
Value.

Definition at line 79 of file parameter_dict.h.

◆ get_as_double()

auto stat_bench::param::ParameterDict::get_as_double ( const ParameterName & param_name) const -> double
nodiscard

Get a parameter value as double.

Parameters
[in]param_nameParameter name.
Returns
Value.

Definition at line 41 of file parameter_dict.cpp.

◆ get_as_variant()

auto stat_bench::param::ParameterDict::get_as_variant ( const ParameterName & param_name) const -> ParameterValueVariant
nodiscard

Get a parameter value as a variant object.

Parameters
[in]param_nameParameter name.
Returns
Value.

Definition at line 51 of file parameter_dict.cpp.

◆ has()

auto stat_bench::param::ParameterDict::has ( const ParameterName & param_name) const -> bool
nodiscard

Check whether this has a parameter with a name.

Parameters
[in]param_nameParameter name to check.
Return values
trueThis has a parameter with the given name.
falseThis doesn't have a parameter with the given name.

Definition at line 37 of file parameter_dict.cpp.

◆ operator!=()

auto stat_bench::param::ParameterDict::operator!= ( const ParameterDict & rhs) const -> bool
nodiscard

Check whether this is not equal to another dictionary.

Parameters
[in]rhsRight-hand-side dictionary.
Return values
trueThis is not equal to the right-hand-side dictionary.
falseThis is equal to the right-hand-side dictionary.

Definition at line 119 of file parameter_dict.cpp.

◆ operator==()

auto stat_bench::param::ParameterDict::operator== ( const ParameterDict & rhs) const -> bool
nodiscard

Check whether this is equal to another dictionary.

Parameters
[in]rhsRight-hand-side dictionary.
Return values
trueThis is equal to the right-hand-side dictionary.
falseThis is not equal to the right-hand-side dictionary.

Definition at line 115 of file parameter_dict.cpp.


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