YggdrasilWM  0.1.1
A tiny window manager coded in C++
ConfigDataGroups.hpp
Go to the documentation of this file.
1 
28 #ifndef YGGDRASILWM_CONFIGDATAGROUPS_HPP
29 #define YGGDRASILWM_CONFIGDATAGROUPS_HPP
30 #include "ConfigDataBase.hpp"
31 #include "json/json.h"
32 #include <string>
33 #include <unordered_map>
34 #include <vector>
40 class ConfigDataGroup;
42 public:
44  ~ConfigDataGroups() override;
51  void configInit(const Json::Value& root) override;
52  Json::Value configSave() override;
53  void addGroup(std::shared_ptr<ConfigDataGroup> group);
54  void removeGroup(ConfigDataGroup * group);
55  std::shared_ptr<ConfigDataGroup> getGroup(int index);
56  [[nodiscard]] const std::vector<std::shared_ptr<ConfigDataGroup>> & getGroups() const;
57 
58 private:
59  std::vector<std::shared_ptr<ConfigDataGroup> > groups_;
60 };
61 #endif //YGGDRASILWM_CONFIGDATAGROUPS_HPP
ConfigDataBase class header. This class is an interface for the ConfigData classes.
ConfigDataBase class This class is an interface for the ConfigData classes This is a pure virtual cla...
Definition: ConfigDataBase.hpp:38
ConfigDataGroup class Store the configuration for a group from the config file. the logic of groups i...
Definition: ConfigDataGroup.hpp:40
ConfigDataGroups class. stores an array of ConfigDataGroup created from the config file.
Definition: ConfigDataGroups.hpp:41
~ConfigDataGroups() override
Definition: ConfigDataGroups.cpp:59
void removeGroup(ConfigDataGroup *group)
Definition: ConfigDataGroups.cpp:50
void addGroup(std::shared_ptr< ConfigDataGroup > group)
Definition: ConfigDataGroups.cpp:49
const std::vector< std::shared_ptr< ConfigDataGroup > > & getGroups() const
Definition: ConfigDataGroups.cpp:58
ConfigDataGroups()
Definition: ConfigDataGroups.cpp:32
Json::Value configSave() override
Build a Json::Value object with the configuration.
Definition: ConfigDataGroups.cpp:45
void configInit(const Json::Value &root) override
Must be called after instanciation to load the config file. Parses the json root and creates ConfigDa...
Definition: ConfigDataGroups.cpp:33
std::vector< std::shared_ptr< ConfigDataGroup > > groups_
Definition: ConfigDataGroups.hpp:59
std::shared_ptr< ConfigDataGroup > getGroup(int index)
Definition: ConfigDataGroups.cpp:48