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