Mir
Public Member Functions | Friends | List of all members
miral::CommandLineOption Class Reference

Add a user configuration option to Mir's option handling. By default the callback will be invoked following Mir initialisation but prior to the server starting. The value supplied to the callback will come from the command line, environment variable, config file or the default. More...

#include <command_line_option.h>

Public Member Functions

 CommandLineOption (std::function< void(int value)> callback, std::string const &option, std::string const &description, int default_value)
 
 CommandLineOption (std::function< void(double value)> callback, std::string const &option, std::string const &description, double default_value)
 
 CommandLineOption (std::function< void(std::string const &value)> callback, std::string const &option, std::string const &description, std::string const &default_value)
 
 CommandLineOption (std::function< void(std::string const &value)> callback, std::string const &option, std::string const &description, char const *default_value)
 
 CommandLineOption (std::function< void(bool value)> callback, std::string const &option, std::string const &description, bool default_value)
 
 CommandLineOption (std::function< void(mir::optional_value< int > const &value)> callback, std::string const &option, std::string const &description)
 
 CommandLineOption (std::function< void(mir::optional_value< std::string > const &value)> callback, std::string const &option, std::string const &description)
 
 CommandLineOption (std::function< void(mir::optional_value< bool > const &value)> callback, std::string const &option, std::string const &description)
 
 CommandLineOption (std::function< void(bool is_set)> callback, std::string const &option, std::string const &description)
 
template<typename Lambda >
 CommandLineOption (Lambda &&callback, std::string const &option, std::string const &description)
 
void operator() (mir::Server &server) const
 
 ~CommandLineOption ()
 
 CommandLineOption (CommandLineOption const &)
 
auto operator= (CommandLineOption const &) -> CommandLineOption &
 

Friends

auto pre_init (CommandLineOption const &clo) -> CommandLineOption
 Update the option to be called back before Mir initialization starts. More...
 

Detailed Description

Add a user configuration option to Mir's option handling. By default the callback will be invoked following Mir initialisation but prior to the server starting. The value supplied to the callback will come from the command line, environment variable, config file or the default.

Note
Except for re-ordering implied by "pre_init()" the callbacks will be invoked in the order supplied.

Constructor & Destructor Documentation

◆ CommandLineOption() [1/11]

miral::CommandLineOption::CommandLineOption ( std::function< void(int value)>  callback,
std::string const &  option,
std::string const &  description,
int  default_value 
)

◆ CommandLineOption() [2/11]

miral::CommandLineOption::CommandLineOption ( std::function< void(double value)>  callback,
std::string const &  option,
std::string const &  description,
double  default_value 
)

◆ CommandLineOption() [3/11]

miral::CommandLineOption::CommandLineOption ( std::function< void(std::string const &value)>  callback,
std::string const &  option,
std::string const &  description,
std::string const &  default_value 
)

◆ CommandLineOption() [4/11]

miral::CommandLineOption::CommandLineOption ( std::function< void(std::string const &value)>  callback,
std::string const &  option,
std::string const &  description,
char const *  default_value 
)

◆ CommandLineOption() [5/11]

miral::CommandLineOption::CommandLineOption ( std::function< void(bool value)>  callback,
std::string const &  option,
std::string const &  description,
bool  default_value 
)

◆ CommandLineOption() [6/11]

miral::CommandLineOption::CommandLineOption ( std::function< void(mir::optional_value< int > const &value)>  callback,
std::string const &  option,
std::string const &  description 
)

◆ CommandLineOption() [7/11]

miral::CommandLineOption::CommandLineOption ( std::function< void(mir::optional_value< std::string > const &value)>  callback,
std::string const &  option,
std::string const &  description 
)

◆ CommandLineOption() [8/11]

miral::CommandLineOption::CommandLineOption ( std::function< void(mir::optional_value< bool > const &value)>  callback,
std::string const &  option,
std::string const &  description 
)

◆ CommandLineOption() [9/11]

miral::CommandLineOption::CommandLineOption ( std::function< void(bool is_set)>  callback,
std::string const &  option,
std::string const &  description 
)

◆ CommandLineOption() [10/11]

template<typename Lambda >
miral::CommandLineOption::CommandLineOption ( Lambda &&  callback,
std::string const &  option,
std::string const &  description 
)
inline

◆ ~CommandLineOption()

miral::CommandLineOption::~CommandLineOption ( )

◆ CommandLineOption() [11/11]

miral::CommandLineOption::CommandLineOption ( CommandLineOption const &  )

Member Function Documentation

◆ operator()()

void miral::CommandLineOption::operator() ( mir::Server &  server) const

◆ operator=()

auto miral::CommandLineOption::operator= ( CommandLineOption const &  ) -> CommandLineOption &

Friends And Related Function Documentation

◆ pre_init

auto pre_init ( CommandLineOption const &  clo) -> CommandLineOption
friend

Update the option to be called back before Mir initialization starts.

Parameters
clothe option

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

Copyright © 2012-2018 Canonical Ltd.
Generated on Thu 12 Jul 10:49:10 UTC 2018