Add deserialization logic
This commit is contained in:
@@ -7,6 +7,10 @@
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include <fan/Fan.h>
|
||||
#include <sensor/Sensor.h>
|
||||
|
||||
#define SERIALIZATION_DIR "/etc/fantasize"
|
||||
#define FANS_JSON_FILENAME "fans.json"
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
@@ -14,9 +18,12 @@ class Serializer {
|
||||
public:
|
||||
Serializer();
|
||||
void Serialize(std::vector<std::shared_ptr<Fan>> fans);
|
||||
std::vector<std::shared_ptr<Fan>>
|
||||
Deserialize(std::vector<std::shared_ptr<Sensor>> availableSensors);
|
||||
|
||||
private:
|
||||
void WriteJson(json o);
|
||||
json ReadJson();
|
||||
};
|
||||
|
||||
#endif // SERIALIZER_H_
|
||||
|
||||
Reference in New Issue
Block a user