openMSX
UserSettings.hh
Go to the documentation of this file.
1 #ifndef USERSETTINGS_HH
2 #define USERSETTINGS_HH
3 
4 #include "noncopyable.hh"
5 #include "string_ref.hh"
6 #include <vector>
7 #include <memory>
8 
9 namespace openmsx {
10 
11 class CommandController;
12 class UserSettingCommand;
13 class Setting;
14 
15 class UserSettings : private noncopyable
16 {
17 public:
18  typedef std::vector<std::unique_ptr<Setting>> Settings;
19 
20  explicit UserSettings(CommandController& commandController);
21  ~UserSettings();
22 
23  void addSetting(std::unique_ptr<Setting> setting);
24  void deleteSetting(Setting& setting);
25  Setting* findSetting(string_ref name) const;
26  const Settings& getSettings() const;
27 
28 private:
29  const std::unique_ptr<UserSettingCommand> userSettingCommand;
30  Settings settings;
31 };
32 
33 } // namespace openmsx
34 
35 #endif
std::vector< std::unique_ptr< Setting > > Settings
Definition: UserSettings.hh:18
void addSetting(std::unique_ptr< Setting > setting)
Definition: UserSettings.cc:58
const Settings & getSettings() const
Definition: UserSettings.cc:80
This class implements a subset of the proposal for std::string_ref (proposed for the next c++ standar...
Definition: string_ref.hh:18
void deleteSetting(Setting &setting)
Definition: UserSettings.cc:64
UserSettings(CommandController &commandController)
Definition: UserSettings.cc:48
Based on boost::noncopyable, see boost documentation: http://www.boost.org/libs/utility.
Definition: noncopyable.hh:12
Setting * findSetting(string_ref name) const
Definition: UserSettings.cc:70