Horizon
core_properties.hpp
1#pragma once
2#include "common/layer.hpp"
3#include "util/uuid.hpp"
4#include <stdint.h>
5
6namespace horizon {
8public:
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
22protected:
23};
24
26public:
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
39public:
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
52public:
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
65public:
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
78public:
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
91public:
93 {
94 }
95 bool is_settable = true;
96 bool is_visible = true;
97 virtual ~PropertyMeta()
98 {
99 }
100};
101
103public:
104 using PropertyMeta::PropertyMeta;
105 std::map<UUID, std::string> net_classes;
106};
107
109public:
110 using PropertyMeta::PropertyMeta;
111 std::map<int, Layer> layers;
112};
113} // namespace horizon
Definition: core_properties.hpp:108
Definition: core_properties.hpp:102
Definition: core_properties.hpp:90
Definition: core_properties.hpp:51
Definition: core_properties.hpp:38
Definition: core_properties.hpp:25
Definition: core_properties.hpp:64
Definition: core_properties.hpp:77
Definition: core_properties.hpp:7
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16