X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.databoard%2Fcpp%2FDataBoardTest%2FDataBoard%2FRange.cpp;fp=bundles%2Forg.simantics.databoard%2Fcpp%2FDataBoardTest%2FDataBoard%2FRange.cpp;h=fbb37ae2bac86ee42e69dfcbc0929e1d21e907e7;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/Range.cpp b/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/Range.cpp new file mode 100644 index 000000000..fbb37ae2b --- /dev/null +++ b/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/Range.cpp @@ -0,0 +1,64 @@ +#include "Range.h" + +#include "Limit.h" + +#include "Constants.h" + +namespace Databoard { + + Range::Range() + { + lower = new Limit(true); + upper = new Limit(false); + } + + Range::~Range() + { + if(lower != NULL) + { + delete lower; + lower = NULL; + } + + if(upper != NULL) + { + delete upper; + upper = NULL; + } + } + + Limit* Range::getLower() + { + return lower; + } + + Limit* Range::getUpper() + { + return upper; + } + + void Range::setLower(std::string value) + { + lower->setValue(value); + } + + void Range::setUpper(std::string value) + { + upper->setValue(value); + } + + std::string Range::writeOut() + { + std::string s; + + s += lower->writeOut(); + + s += " "; + s += STR_RANGESPLIT; + s += " "; + + s += upper->writeOut(); + + return s; + } +}