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 };
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 
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 
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 
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 
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 
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 
103 public:
104  using PropertyMeta::PropertyMeta;
105  std::map<UUID, std::string> net_classes;
106 };
107 
109 public:
110  using PropertyMeta::PropertyMeta;
111  std::map<int, Layer> layers;
112 };
113 } // namespace horizon
horizon::PropertyValueDouble
Definition: core_properties.hpp:38
horizon::PropertyValueString
Definition: core_properties.hpp:64
horizon::PropertyValueBool
Definition: core_properties.hpp:51
horizon::PropertyMetaNetClasses
Definition: core_properties.hpp:102
libzip::int64_t
zip_int64_t int64_t
zip_int64_t typedef.
Definition: zip.hpp:103
horizon::PropertyMetaLayers
Definition: core_properties.hpp:108
horizon::PropertyValueInt
Definition: core_properties.hpp:25
horizon::PropertyMeta
Definition: core_properties.hpp:90
horizon::UUID
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
horizon::PropertyValueUUID
Definition: core_properties.hpp:77
horizon::PropertyValue
Definition: core_properties.hpp:7