2
* Copyright © 2013 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 3,
6
* as published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Alan Griffiths <alan@octopull.co.uk>
19
#ifndef MIR_DEFAULT_CONFIGURATION_OPTIONS_H_
20
#define MIR_DEFAULT_CONFIGURATION_OPTIONS_H_
22
#include "mir/options/program_option.h"
28
class ConfigurationOptions
31
static char const* const server_socket_opt;
32
static char const* const no_server_socket_opt;
33
static char const* const session_mediator_report_opt;
34
static char const* const msg_processor_report_opt;
35
static char const* const display_report_opt;
36
static char const* const legacy_input_report_opt;
37
static char const* const connector_report_opt;
38
static char const* const input_report_opt;
39
static char const* const host_socket_opt;
40
static char const* const standalone_opt;
41
static char const* const frontend_threads;
43
static char const* const glog;
44
static char const* const glog_stderrthreshold;
45
static char const* const glog_minloglevel;
46
static char const* const glog_log_dir;
47
static char const* const glog_log_dir_default;
48
static int const glog_stderrthreshold_default;
49
static int const glog_minloglevel_default;
51
static bool const enable_input_default;
53
static char const* const off_opt_value;
54
static char const* const log_opt_value;
55
static char const* const lttng_opt_value;
57
static char const* const platform_graphics_lib;
58
static char const* const default_platform_graphics_lib;
60
virtual std::shared_ptr<options::Option> the_options() const = 0;
64
int default_ipc_threads = 10;
66
ConfigurationOptions() = default;
67
virtual ~ConfigurationOptions() = default;
68
ConfigurationOptions(ConfigurationOptions const&) = delete;
69
ConfigurationOptions& operator=(ConfigurationOptions const&) = delete;
72
class DefaultConfigurationOptions : public ConfigurationOptions
75
DefaultConfigurationOptions(int argc, char const* argv[]);
76
virtual ~DefaultConfigurationOptions() = default;
79
// add_options() allows configuration specializations to add their
80
// own options. This MUST be called before the first invocation of
81
// the_options() - typically during construction.
82
boost::program_options::options_description_easy_init add_options();
83
virtual void parse_options(boost::program_options::options_description& options_description, options::ProgramOption& options) const;
84
virtual std::shared_ptr<options::Option> the_options() const;
88
char const** const argv;
89
std::shared_ptr<boost::program_options::options_description> const program_options;
90
std::shared_ptr<options::Option> mutable options;
95
#endif /* MIR_DEFAULT_CONFIGURATION_OPTIONS_H_ */