Public Member Functions | List of all members
rapidsmpf::config::OptionValue Class Reference

Configuration option value. More...

#include <config.hpp>

Public Member Functions

 OptionValue ()=default
 Default constructor. More...
 
 OptionValue (std::string value_as_string)
 Constructs OptionValue from a string representation. More...
 
std::any const & get_value () const
 Retrieves the stored value. More...
 
std::string const & get_value_as_string () const
 Retrieves the string representation of the value. More...
 
void set_value (std::any value)
 Sets the value if it has not been set already. More...
 

Detailed Description

Configuration option value.

The OptionValue class encapsulates a value (of any type using std::any) and a string representation of the value.

Definition at line 40 of file config.hpp.

Constructor & Destructor Documentation

◆ OptionValue() [1/2]

rapidsmpf::config::OptionValue::OptionValue ( )
default

Default constructor.

Constructs an empty OptionValue.

◆ OptionValue() [2/2]

rapidsmpf::config::OptionValue::OptionValue ( std::string  value_as_string)
inline

Constructs OptionValue from a string representation.

Parameters
value_as_stringA string representation of the value.

Definition at line 54 of file config.hpp.

Member Function Documentation

◆ get_value()

std::any const& rapidsmpf::config::OptionValue::get_value ( ) const
inline

Retrieves the stored value.

Returns
A const reference to the std::any value.

Definition at line 62 of file config.hpp.

◆ get_value_as_string()

std::string const& rapidsmpf::config::OptionValue::get_value_as_string ( ) const
inline

Retrieves the string representation of the value.

Is the empty string, if not string representation exist.

Returns
A const reference to the string representation.

Definition at line 73 of file config.hpp.

◆ set_value()

void rapidsmpf::config::OptionValue::set_value ( std::any  value)
inline

Sets the value if it has not been set already.

Parameters
valueThe new value to store.
Exceptions
std::invalid_argumentif the value is already set.

Definition at line 84 of file config.hpp.


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