OpenLexocad  27.1
PropertyLogical.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #include "Core/Property.h"
6 #include "Core/Variant.h"
7 
8 
9 namespace Core
10 {
11 /* @brief A defined type of simple type logical.
12  * Logical datatype can have values TRUE, FALSE or UNKNOWN.
13  */
14 
15 // TODO: add 'UNKNOWN' value
16 class LX_CORE_EXPORT PropertyLogical : public Core::Property
17 {
19 
20 public:
21  PropertyLogical(void);
22  virtual ~PropertyLogical(void);
23 
24  inline void setValue(bool b);
25  bool setValueFromVariant(const Core::Variant& value);
26  void copyValue(Core::Property* p);
27 
28  bool getValue() const;
29  Core::Variant getVariant(void) const;
30 
31  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
32  inline virtual void restore(Base::AbstractXMLReader& reader, Base::PersistenceVersion& version);
33  virtual bool isEqual(const Property*) const;
34  virtual Core::Property* copy(void) const override;
35  virtual void paste(const Core::Property& from) override;
36 
37 protected:
38  bool _nValue;
39 };
40 
41 DECLARE_PROPERTY_FACTORY(PropertyLogical_Factory, Core::PropertyLogical);
42 
43 } // namespace Core
Definition: Persistence.h:14
Definition: PropertyLogical.h:16
LX_CORE_EXPORT Version & version
Definition: Variant.h:87
Definition: AbstractXMLReader.h:7
bool _nValue
Definition: PropertyLogical.h:38
Definition: Base.h:12
Definition: Writer.h:16
Definition: Property.h:77
TYPESYSTEM_HEADER()
DECLARE_PROPERTY_FACTORY(PropertyAxis1_Factory, Core::PropertyAxis1)