X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.databoard%2Fcpp%2FDataBoardTest%2FDataBoard%2FBooleanValue.cpp;fp=bundles%2Forg.simantics.databoard%2Fcpp%2FDataBoardTest%2FDataBoard%2FBooleanValue.cpp;h=f03d9d79cb5f92f9cacdc14892a58c733736248c;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/BooleanValue.cpp b/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/BooleanValue.cpp new file mode 100644 index 000000000..f03d9d79c --- /dev/null +++ b/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/BooleanValue.cpp @@ -0,0 +1,47 @@ +#include "BooleanValue.h" + +namespace Databoard { + namespace Value { + BooleanValue::BooleanValue(Databoard::Type::DataType* dataBoard) : Value(dataBoard) + { + } + + BooleanValue::~BooleanValue() + { + } + + void BooleanValue::setValue(bool value) + { + this->value = value; + } + + bool BooleanValue::getValue() + { + return value; + } + + std::string BooleanValue::writeOut(int /*indent*/) + { + std::string s; + + if(value == true) + { + s += "true"; + } + else + { + s += "false"; + } + + return s; + } + + bool BooleanValue::equals(const Value* other) + { + BooleanValue* o = (BooleanValue*)other; + + return (this->value < o->value); + + } + } +}