]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/BooleanValue.cpp
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.databoard / cpp / DataBoardTest / DataBoard / BooleanValue.cpp
1 #include "BooleanValue.h"
2
3 namespace Databoard {
4         namespace Value {
5                 BooleanValue::BooleanValue(Databoard::Type::DataType* dataBoard) : Value(dataBoard)
6                 {
7                 }
8
9                 BooleanValue::~BooleanValue()
10                 {
11                 }
12
13                 void BooleanValue::setValue(bool value)
14                 {
15                         this->value = value;
16                 }
17
18                 bool BooleanValue::getValue()
19                 {
20                         return value;
21                 }
22
23                 std::string BooleanValue::writeOut(int /*indent*/)
24                 {
25                         std::string s;
26
27                         if(value == true)
28                         {
29                                 s += "true";
30                         }
31                         else
32                         {
33                                 s += "false";
34                         }
35
36                         return s;
37                 }
38
39                 bool BooleanValue::equals(const Value* other)
40                 {
41                         BooleanValue* o = (BooleanValue*)other;
42
43                         return (this->value < o->value);
44
45                 }
46         }
47 }