libcaf  0.15.3
Classes | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | 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 >.

Classes

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 bool assign_config_value (T &x, int64_t &y)
 
static bool assign_config_value (uint64_t &x, int64_t &y)
 
static bool assign_config_value (float &x, double &y)
 

Detailed Description

Helper class to generate config readers for different input types.


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