Horizon
entity.hpp
1 #pragma once
2 #include "gate.hpp"
3 #include "nlohmann/json_fwd.hpp"
4 #include "unit.hpp"
5 #include "util/uuid.hpp"
6 #include <fstream>
7 #include <map>
8 #include <vector>
9 #include "util/file_version.hpp"
10 
11 namespace horizon {
12 using json = nlohmann::json;
13 
14 class Entity {
15 private:
16  Entity(const UUID &uu, const json &, class IPool &pool);
17 
18 public:
19  Entity(const UUID &uu);
20 
21  static Entity new_from_file(const std::string &filename, IPool &pool);
22  UUID uuid;
23  std::string name;
24  std::string manufacturer;
25  std::string prefix;
26  std::set<std::string> tags;
27  std::map<UUID, Gate> gates;
28 
29  FileVersion version;
30  json serialize() const;
31  void update_refs(IPool &pool);
32  UUID get_uuid() const;
33 };
34 } // namespace horizon
nlohmann::basic_json
a class to store JSON values
Definition: json.hpp:166
nlohmann::json
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61