HEBench
hebench::cpp::WorkloadParams::Common Class Reference

Base wrapper around the flexible workload parameters. More...

#include <workload_params.hpp>

Inheritance diagram for hebench::cpp::WorkloadParams::Common:
Collaboration diagram for hebench::cpp::WorkloadParams::Common:

Public Member Functions

 Common (std::size_t num_params=0)
 
 Common (const std::vector< hebench::APIBridge::WorkloadParam > &w_params)
 
 Common (const hebench::APIBridge::WorkloadParams &w_params)
 
virtual ~Common ()=default
 
template<typename T >
void add (const T &value, const std::string &name=std::string())
 Adds a new workload parameter to the list. More...
 
template<typename T >
void set (std::size_t index, const T &value, const std::string &name)
 Sets a new value for an existing workload parameter. More...
 
template<typename T >
void set (std::size_t index, const T &value)
 Sets a new value for an existing workload parameter. More...
 
template<typename T >
const T & get (std::size_t index) const
 Retrieves the value for an existing workload parameter. More...
 
const char * getName (std::size_t index) const
 
const std::vector< hebench::APIBridge::WorkloadParam > & getParams () const
 
template<>
void add (const double &value, const std::string &name)
 
template<>
void set (std::size_t index, const double &value, const std::string &name)
 
template<>
void set (std::size_t index, const double &value)
 
template<>
const double & get (std::size_t index) const
 

Protected Attributes

std::vector< hebench::APIBridge::WorkloadParamm_w_params
 

Detailed Description

Base wrapper around the flexible workload parameters.

This class helps to hide nuisances with workload parameters values and types using templated methods. The templates are defined only for the types supported by the flexible workload parameters.

This class also serves as base class for wrappers for specific workloads. Clients can use this class as is, or use one of the specializations. Note that some specializations may handle nuisances of the workload parameters definition for the workload they represent, so, it is recommended to use the specializations when possible.

Definition at line 31 of file workload_params.hpp.

Constructor & Destructor Documentation

◆ Common() [1/3]

hebench::cpp::WorkloadParams::Common::Common ( std::size_t  num_params = 0)
inline

Definition at line 34 of file workload_params.hpp.

◆ Common() [2/3]

hebench::cpp::WorkloadParams::Common::Common ( const std::vector< hebench::APIBridge::WorkloadParam > &  w_params)
inline

Definition at line 38 of file workload_params.hpp.

◆ Common() [3/3]

hebench::cpp::WorkloadParams::Common::Common ( const hebench::APIBridge::WorkloadParams w_params)
inline

Definition at line 42 of file workload_params.hpp.

◆ ~Common()

virtual hebench::cpp::WorkloadParams::Common::~Common ( )
virtualdefault

Member Function Documentation

◆ add() [1/2]

template<>
void hebench::cpp::WorkloadParams::Common::add ( const double &  value,
const std::string &  name 
)
inline

Definition at line 172 of file workload_params.hpp.

◆ add() [2/2]

template<typename T >
void hebench::cpp::WorkloadParams::Common::add ( const T &  value,
const std::string &  name = std::string() 
)

Adds a new workload parameter to the list.

Parameters
[in]valueValue for the parameter.
[in]nameName for the parameter.

◆ get() [1/2]

template<typename T >
const T& hebench::cpp::WorkloadParams::Common::get ( std::size_t  index) const

Retrieves the value for an existing workload parameter.

Parameters
[in]indexIndex for the parameter to retrieve.
Returns
The value contained in the specified workload parameter of the specified type.
Exceptions
std::out_of_rangeif index is out of range.

◆ get() [2/2]

template<>
const double& hebench::cpp::WorkloadParams::Common::get ( std::size_t  index) const
inline

Definition at line 202 of file workload_params.hpp.

◆ getName()

const char* hebench::cpp::WorkloadParams::Common::getName ( std::size_t  index) const
inline

Definition at line 81 of file workload_params.hpp.

◆ getParams()

const std::vector<hebench::APIBridge::WorkloadParam>& hebench::cpp::WorkloadParams::Common::getParams ( ) const
inline

Definition at line 83 of file workload_params.hpp.

◆ set() [1/4]

template<>
void hebench::cpp::WorkloadParams::Common::set ( std::size_t  index,
const double &  value 
)
inline

Definition at line 193 of file workload_params.hpp.

◆ set() [2/4]

template<>
void hebench::cpp::WorkloadParams::Common::set ( std::size_t  index,
const double &  value,
const std::string &  name 
)
inline

Definition at line 183 of file workload_params.hpp.

◆ set() [3/4]

template<typename T >
void hebench::cpp::WorkloadParams::Common::set ( std::size_t  index,
const T &  value 
)

Sets a new value for an existing workload parameter.

Parameters
[in]indexIndex for the parameter to set.
[in]valueNew value for the parameter.
Exceptions
std::out_of_rangeif index is out of range.

◆ set() [4/4]

template<typename T >
void hebench::cpp::WorkloadParams::Common::set ( std::size_t  index,
const T &  value,
const std::string &  name 
)

Sets a new value for an existing workload parameter.

Parameters
[in]indexIndex for the parameter to set.
[in]valueNew value for the parameter.
[in]nameNew name for the parameter.
Exceptions
std::out_of_rangeif index is out of range.

Member Data Documentation

◆ m_w_params

std::vector<hebench::APIBridge::WorkloadParam> hebench::cpp::WorkloadParams::Common::m_w_params
protected

Definition at line 86 of file workload_params.hpp.


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