libcaf  0.15.5
Classes | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
caf::config_option Class Referenceabstract

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 >.


class  type_name_visitor
 Returns a human-readable type name for the visited type. More...

Public Types

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 >

Public Member Functions

 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.

Protected Member Functions

void report_type_error (size_t ln, config_value &x, const char *expected, optional< std::ostream & > out)

Static Protected Member Functions

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)

Protected Attributes

 x = static_cast<T>(y)
return true

Detailed Description

Helper class to generate config readers for different input types.

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