OpenLexocad  27.0
PropertyInteger.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
4 
5 #include "Core/Property.h"
6 #include "Core/Variant.h"
7 
8 namespace Core
9 {
11 {
13 
14 public:
15  PropertyInteger(void);
16  virtual ~PropertyInteger(void);
17 
18  inline virtual void setValue(int i);
19  bool setValueFromVariant(const Core::Variant& value);
20  virtual void copyValue(Core::Property* p);
21 
22  int getValue() const;
23  Core::Variant getVariant(void) const;
24 
25  virtual void save(Base::AbstractWriter& writer, Base::PersistanceVersion& save_version);
26  inline virtual void restore(Base::AbstractXMLReader& reader, Base::PersistanceVersion& version);
27  virtual bool isEqual(const Property*) const;
28  virtual bool createSQL(Base::AbstractWriter& writer, Base::PersistanceVersion& save_version, bool data) override;
29 
30 protected:
31  int _nValue;
32 };
33 
35 {
37 
38 public:
39  PropertyLong(void);
40  virtual ~PropertyLong(void);
41 
42  inline virtual void setValue(long i);
43  bool setValueFromVariant(const Core::Variant& value);
44  virtual void copyValue(Core::Property* p);
45 
46  long getValue() const;
47  Core::Variant getVariant(void) const;
48 
49  virtual void save(Base::AbstractWriter& writer, Base::PersistanceVersion& save_version);
50  inline virtual void restore(Base::AbstractXMLReader& reader, Base::PersistanceVersion& version);
51  virtual bool isEqual(const Property*) const;
52 
53 protected:
54  long _nValue;
55 };
56 
58 {
60 
61 public:
62  PropertyUInt64(void);
63  virtual ~PropertyUInt64(void);
64 
65  inline virtual void setValue(uint64_t i);
66  bool setValueFromVariant(const Core::Variant& value);
67  virtual void copyValue(Core::Property* p);
68 
69  uint64_t getValue() const;
70  Core::Variant getVariant(void) const;
71 
72  virtual void save(Base::AbstractWriter& writer, Base::PersistanceVersion& save_version);
73  inline virtual void restore(Base::AbstractXMLReader& reader, Base::PersistanceVersion& version);
74  virtual bool isEqual(const Property*) const;
75 
76 protected:
77  uint64_t _nValue;
78 };
79 
81 {
83 
84 public:
85  PropertyUInt32(void);
86  virtual ~PropertyUInt32(void);
87 
88  inline virtual void setValue(uint32_t i);
89  bool setValueFromVariant(const Core::Variant& value);
90  virtual void copyValue(Core::Property* p);
91 
92  uint32_t getValue() const;
93  Core::Variant getVariant(void) const;
94 
95  virtual void save(Base::AbstractWriter& writer, Base::PersistanceVersion& save_version);
96  inline virtual void restore(Base::AbstractXMLReader& reader, Base::PersistanceVersion& version);
97  virtual bool isEqual(const Property*) const;
98 
99 
100 
101 protected:
102  uint32_t _nValue;
103 };
104 
106 {
108 
109 public:
110  PropertyUInt8(void);
111  virtual ~PropertyUInt8(void);
112 
113  inline virtual void setValue(uint8_t i);
114  bool setValueFromVariant(const Core::Variant& value);
115  virtual void copyValue(Core::Property* p);
116 
117  uint8_t getValue() const;
118  Core::Variant getVariant(void) const;
119 
120  virtual void save(Base::AbstractWriter& writer, Base::PersistanceVersion& save_version);
121  inline virtual void restore(Base::AbstractXMLReader& reader, Base::PersistanceVersion& version);
122  virtual bool isEqual(const Property*) const;
123 
124 protected:
125  uint8_t _nValue;
126 };
127 
128 
129 
131 {
133 
134 public:
136  virtual ~PropertyNumberOfDecimals(void);
137 };
138 
139 
141 {
143 
144 public:
145  PropertyIndex(void);
146  virtual ~PropertyIndex(void);
147 };
148 
150 {
152 
153 public:
154  PropertyCountMeasure(void);
155  virtual ~PropertyCountMeasure(void);
156 };
157 
158 
160 {
162 
163 public:
165  virtual ~PropertyIndexList();
166 
167  void setValue(const std::vector<int>& list);
168  bool setValueFromVariant(const Core::Variant& value);
169  void copyValue(Core::Property* p);
170 
171  bool hasIndex(int i) const;
172  bool hasIndex(int i, int& order) const;
173  void addIndex(int i);
174  void removeIndex(int i);
175 
176  void setEmpty();
177  bool isEmpty() const;
178  size_t getSize() const;
179 
180  const std::vector<int>& getValue() const;
181 
182  Core::Variant getVariant(void) const { return Core::Variant(_indexList); }
183 
184  virtual void save(Base::AbstractWriter& writer, Base::PersistanceVersion& save_version);
185  inline virtual void restore(Base::AbstractXMLReader& reader, Base::PersistanceVersion& version);
186  virtual bool isEqual(const Property*) const;
187 
188 protected:
189  std::vector<int> _indexList;
190 };
191 
193 {
195 
196 public:
197  PropertyEnum();
198  virtual ~PropertyEnum();
199 
201 
202 
208  void setEnums(const char** plEnums);
212  void setValue(const char* value);
218  void setValue(int);
220  const char* getValueAsString(void) const;
222  std::vector<std::string> getEnumVector(void) const;
224  const char** getEnums(void) const;
225  virtual void copyValue(Core::Property* p);
226  virtual bool isEqual(const Property*) const;
227 
229 protected:
230  const char** _enumArray;
231 };
232 
233 
235 {
237 
238 public:
240  virtual ~PropertyUInt8List();
241 
242  void setValue(const std::vector<uint8_t>& list);
243  bool setValueFromVariant(const Core::Variant& value);
244  void copyValue(Core::Property* p);
245 
246  void setEmpty();
247  bool isEmpty() const;
248 
249  const std::vector<uint8_t>& getValue() const;
250 
251  Core::Variant getVariant(void) const { return Core::Variant(_indexList); }
252 
253  virtual void save(Base::AbstractWriter& writer, Base::PersistanceVersion& save_version);
254  inline virtual void restore(Base::AbstractXMLReader& reader, Base::PersistanceVersion& version);
255  virtual bool isEqual(const Property*) const;
256 
257 protected:
258  std::vector<uint8_t> _indexList;
259 };
260 
261 DECLARE_PROPERTY_FACTORY(PropertyInteger_Factory, Core::PropertyInteger);
262 DECLARE_PROPERTY_FACTORY(PropertyNumberOfDecimals_Factory, Core::PropertyNumberOfDecimals);
263 DECLARE_PROPERTY_FACTORY(PropertyIndex_Factory, Core::PropertyIndex);
264 DECLARE_PROPERTY_FACTORY(PropertyIndexList_Factory, Core::PropertyIndexList);
265 DECLARE_PROPERTY_FACTORY(PropertyEnum_Factory, Core::PropertyEnum);
266 DECLARE_PROPERTY_FACTORY(PropertyCountMeasure_Factory, Core::PropertyCountMeasure);
267 
270 
271 
272 } // namespace Core
DECLARE_OPTIONAL_PROPERTY_HEADER(PropertyColorOpt, Core::PropertyColor)
Definition: PropertyInteger.h:130
#define CORE_EXPORT
Definition: core_defines2.h:10
Definition: PropertyInteger.h:105
Definition: PropertyInteger.h:159
Definition: PropertyInteger.h:34
Definition: PropertyInteger.h:192
Definition: PropertyInteger.h:80
std::vector< int > _indexList
Definition: PropertyInteger.h:189
const char ** _enumArray
Definition: PropertyInteger.h:230
long _nValue
Definition: PropertyInteger.h:54
Definition: Persistance.h:20
LX_CORE_EXPORT Version & version
Definition: Variant.h:90
Core::Variant getVariant(void) const
Definition: PropertyInteger.h:182
Definition: PropertyInteger.h:10
Definition: AbstractXMLReader.h:10
Definition: Base.h:19
int _nValue
Definition: PropertyInteger.h:31
Definition: PropertyInteger.h:57
Definition: Writer.h:27
Core::Variant getVariant(void) const
Definition: PropertyInteger.h:251
uint32_t _nValue
Definition: PropertyInteger.h:102
uint8_t _nValue
Definition: PropertyInteger.h:125
Definition: Property.h:81
Definition: PropertyInteger.h:234
Definition: PropertyInteger.h:140
std::vector< uint8_t > _indexList
Definition: PropertyInteger.h:258
TYPESYSTEM_HEADER()
DECLARE_PROPERTY_FACTORY(PropertyAxis1_Factory, Core::PropertyAxis1)
uint64_t _nValue
Definition: PropertyInteger.h:77
Definition: PropertyInteger.h:149