Helper class to generate config readers for different input types.
More...
#include <config_option.hpp>
Inherited by caf::config_option_impl< T, IsInsertable >, and caf::config_option_impl< T, true >.
|
using | config_reader_sink = std::function< void(size_t, config_value &, optional< std::ostream & >)> |
|
using | legal_types = detail::type_list< bool, float, double, std::string, atom_value, int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t > |
|
|
| config_option (const char *cat, const char *nm, const char *expl) |
|
const char * | name () const |
|
char | short_name () const |
|
const char * | category () const |
|
const char * | explanation () const |
|
std::string | full_name () const |
| Returns the full name for this config option as "<category>.<long name>".
|
|
virtual std::string | to_string () const =0 |
| Returns the held value as string.
|
|
virtual config_reader_sink | to_sink ()=0 |
| Returns a sink function for config readers.
|
|
virtual message::cli_arg | to_cli_arg (bool use_caf_prefix=false)=0 |
| Returns a CLI argument parser.
|
|
|
template<class T , class U > |
static bool | assign_config_value (T &x, U &y) |
|
template<class T > |
static std::enable_if< sizeof(T)< sizeof(int64_t), bool >::type assign_config_value(T &x, int64_t &y) { if(y< static_cast< int64_t >std::numeric_limits< T >::lowest())||y > | static_cast (std::numeric_limits< T >::max())) return false |
|
template<class T > |
static std::enable_if< std::is_unsigned< T >::value &&sizeof(T)==sizeof(int64_t), bool >::type | assign_config_value (T &x, int64_t &y) |
|
static bool | assign_config_value (float &x, double &y) |
|
|
| x = static_cast<T>(y) |
|
return | true |
|
Helper class to generate config readers for different input types.
The documentation for this class was generated from the following file:
- libcaf_core/caf/config_option.hpp