Horizon
core_properties.hpp
1 #pragma once
2 #include "common/layer.hpp"
3 #include "util/uuid.hpp"
4 #include <stdint.h>
5 
6 namespace horizon {
7 class PropertyValue {
8 public:
9  enum class Type { INVALID, INT, BOOL, STRING, UUID, DOUBLE };
10  PropertyValue()
11  {
12  }
13 
14  virtual Type get_type() const
15  {
16  return Type::INVALID;
17  };
18  virtual ~PropertyValue()
19  {
20  }
21 
22 protected:
23 };
24 
25 class PropertyValueInt : public PropertyValue {
26 public:
27  PropertyValueInt(const int64_t &v = 0) : value(v)
28  {
29  }
30  Type get_type() const override
31  {
32  return Type::INT;
33  };
34 
35  int64_t value;
36 };
37 
38 class PropertyValueDouble : public PropertyValue {
39 public:
40  PropertyValueDouble(const double &v = 0) : value(v)
41  {
42  }
43  Type get_type() const override
44  {
45  return Type::DOUBLE;
46  };
47 
48  double value;
49 };
50 
51 class PropertyValueBool : public PropertyValue {
52 public:
53  PropertyValueBool(bool v = false) : value(v)
54  {
55  }
56  Type get_type() const override
57  {
58  return Type::BOOL;
59  };
60 
61  bool value;
62 };
63 
64 class PropertyValueString : public PropertyValue {
65 public:
66  PropertyValueString(const std::string &v = "") : value(v)
67  {
68  }
69  Type get_type() const override
70  {
71  return Type::STRING;
72  };
73 
74  std::string value;
75 };
76 
77 class PropertyValueUUID : public PropertyValue {
78 public:
79  PropertyValueUUID(const UUID &v = UUID()) : value(v)
80  {
81  }
82  Type get_type() const override
83  {
84  return Type::UUID;
85  };
86 
87  UUID value;
88 };
89 
90 class PropertyMeta {
91 public:
92  PropertyMeta()
93  {
94  }
95  bool is_settable = true;
96  bool is_visible = true;
97  virtual ~PropertyMeta()
98  {
99  }
100 };
101 
102 class PropertyMetaNetClasses : public PropertyMeta {
103 public:
104  using PropertyMeta::PropertyMeta;
105  std::map<UUID, std::string> net_classes;
106 };
107 
108 class PropertyMetaLayers : public PropertyMeta {
109 public:
110  using PropertyMeta::PropertyMeta;
111  std::map<int, Layer> layers;
112 };
113 } // namespace horizon
libzip::int64_t
zip_int64_t int64_t
zip_int64_t typedef.
Definition: zip.hpp:103