dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
dfx::Utils::SystemConfig::Value Struct Reference

Variant type used to represent configuration values. More...

#include <dfx-utilities/SystemConfig.hpp>

Inheritance diagram for dfx::Utils::SystemConfig::Value:
[legend]
Collaboration diagram for dfx::Utils::SystemConfig::Value:
[legend]

Public Member Functions

bool is_bool () const noexcept
bool is_integer () const noexcept
bool is_double () const noexcept
bool is_string () const noexcept
bool to_bool () const
 Get the value as bool.
int64_t to_integer () const
 Get the value as int64_t.
double to_double () const
 Get the value as double.
std::string to_string () const
 Get the value as std::string.
std::string convert_to_string () const
 Convert the held value to a string representation.

Detailed Description

Variant type used to represent configuration values.

Supported types:

  • bool
  • int64_t
  • double
  • std::string

This type is a thin wrapper over std::variant that adds helpers and a string conversion utility.

Member Function Documentation

◆ convert_to_string()

std::string dfx::Utils::SystemConfig::Value::convert_to_string ( ) const

Convert the held value to a string representation.

This is meant for logging/diagnostics/UI and for formatting via std::format.

Returns
A string representation of the held value.

◆ is_bool()

bool dfx::Utils::SystemConfig::Value::is_bool ( ) const
inlinenoexcept
Returns
true if the held type is bool.

◆ is_double()

bool dfx::Utils::SystemConfig::Value::is_double ( ) const
inlinenoexcept
Returns
true if the held type is double.

◆ is_integer()

bool dfx::Utils::SystemConfig::Value::is_integer ( ) const
inlinenoexcept
Returns
true if the held type is int64_t.

◆ is_string()

bool dfx::Utils::SystemConfig::Value::is_string ( ) const
inlinenoexcept
Returns
true if the held type is std::string.

◆ to_bool()

bool dfx::Utils::SystemConfig::Value::to_bool ( ) const
inline

Get the value as bool.

Exceptions
std::bad_variant_accessif the value is not a bool.

◆ to_double()

double dfx::Utils::SystemConfig::Value::to_double ( ) const
inline

Get the value as double.

Exceptions
std::bad_variant_accessif the value is not a double.

◆ to_integer()

int64_t dfx::Utils::SystemConfig::Value::to_integer ( ) const
inline

Get the value as int64_t.

Exceptions
std::bad_variant_accessif the value is not an int64_t.

◆ to_string()

std::string dfx::Utils::SystemConfig::Value::to_string ( ) const
inline

Get the value as std::string.

Exceptions
std::bad_variant_accessif the value is not a std::string.

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