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