-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
good first issueGood for newcomersGood for newcomersrefactorCode that needs refactoringCode that needs refactoring
Milestone
Description
Currently the module config object and plant config object are not instanced anywhere, as only their static methods and members are accessed.
Lines 52 to 75 in 881d03b
| class ModuleConfig { | |
| public: | |
| static void ReadConfigFromFile(); | |
| static void WriteConfigToFile(); | |
| static void AddNetwork(const char *ssid, const char *password); | |
| static std::vector<Network> GetNetworks() { return networks; } | |
| static const char *GetName() { return name; } | |
| static int32_t GetTimezoneOffset() { return timezone_offset; } | |
| static void SetupModule(const char *raw_config); | |
| private: | |
| static char name[100]; | |
| static int32_t timezone_offset; | |
| static std::vector<Network> networks; | |
| }; | |
| class PlantConfig { | |
| public: | |
| static const char *GetName() { return name; } | |
| static void SetupPlant(const char *raw_config); | |
| private: | |
| static char name[100]; | |
| }; |
This should be changed so each object that requires them has them injected in their constructor, and a single instance of each is created in the root file, or with the dependency injection framework used in #3.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomersrefactorCode that needs refactoringCode that needs refactoring