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 };
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  PropertyValueBool(bool v = false) : value(v)
41  {
42  }
43  Type get_type() const override
44  {
45  return Type::BOOL;
46  };
47 
48  bool value;
49 };
50 
52 public:
53  PropertyValueString(const std::string &v = "") : value(v)
54  {
55  }
56  Type get_type() const override
57  {
58  return Type::STRING;
59  };
60 
61  std::string value;
62 };
63 
65 public:
66  PropertyValueUUID(const UUID &v = UUID()) : value(v)
67  {
68  }
69  Type get_type() const override
70  {
71  return Type::UUID;
72  };
73 
74  UUID value;
75 };
76 
77 class PropertyMeta {
78 public:
79  PropertyMeta()
80  {
81  }
82  bool is_settable = true;
83  bool is_visible = true;
84  virtual ~PropertyMeta()
85  {
86  }
87 };
88 
90 public:
91  using PropertyMeta::PropertyMeta;
92  std::map<UUID, std::string> net_classes;
93 };
94 
96 public:
97  using PropertyMeta::PropertyMeta;
98  std::map<int, Layer> layers;
99 };
100 } // namespace horizon
horizon::PropertyValueString
Definition: core_properties.hpp:51
horizon::PropertyValueBool
Definition: core_properties.hpp:38
horizon::PropertyMetaNetClasses
Definition: core_properties.hpp:89
horizon::PropertyMetaLayers
Definition: core_properties.hpp:95
horizon::PropertyValueInt
Definition: core_properties.hpp:25
horizon::PropertyMeta
Definition: core_properties.hpp:77
horizon::UUID
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
libzip::int64_t
zip_int64_t int64_t
zip_int64_t typedef.
Definition: zip.hpp:103
horizon::PropertyValueUUID
Definition: core_properties.hpp:64
horizon::PropertyValue
Definition: core_properties.hpp:7