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

Classes

struct  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 &)>
 

Public Member Functions

 config_option (const char *category, const char *name, const char *explanation)
 
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 line, config_value &x, const char *expected)
 

Static Protected Member Functions

template<class T >
static std::enable_if< sizeof(T)==sizeof(uint32_t), bool >::type unsigned_assign_in_range (T &, int64_t &x)
 
template<class T >
static std::enable_if< sizeof(T)==sizeof(uint64_t), bool >::type unsigned_assign_in_range (T &, int64_t &)
 
template<class T , class U >
static bool assign_config_value (T &x, U &y)
 
static bool assign_config_value (size_t &x, int64_t &y)
 
static bool assign_config_value (uint16_t &x, int64_t &y)
 

Detailed Description

Helper class to generate config readers for different input types.


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