X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.databoard%2Fcpp%2FDataBoardTest%2FDataBoard%2FByteType.cpp;fp=bundles%2Forg.simantics.databoard%2Fcpp%2FDataBoardTest%2FDataBoard%2FByteType.cpp;h=e7b154d65dcfea2e63962fcae51e227243233a86;hp=a1f189627b52c2bfa6145cbb455ffbbb50eb7f61;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/ByteType.cpp b/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/ByteType.cpp index a1f189627..e7b154d65 100644 --- a/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/ByteType.cpp +++ b/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/ByteType.cpp @@ -1,63 +1,63 @@ -#include "ByteType.h" - -#include "Range.h" -#include "Limit.h" - -namespace Databoard { - namespace Type { - - ByteType::ByteType() : NumberType() - { - this->range = NULL; - } - - ByteType::ByteType(std::string unit) : NumberType(unit) - { - this->unit = unit; - this->range = NULL; - } - - ByteType::ByteType(std::string unit, Range* range) : NumberType(unit, range) - { - this->unit = unit; - this->range = range; - } - - ByteType::~ByteType() - { - } - - char ByteType::minValue() - { - if(range == NULL) return SCHAR_MIN; - - Limit* l = range->getLower(); - - char value = l->getByte(SCHAR_MIN); - - return value; - } - - char ByteType::maxValue() - { - if(range == NULL) return SCHAR_MAX; - - Limit* l = range->getUpper(); - - char value = l->getByte(SCHAR_MAX); - - return value; - } - - std::string ByteType::writeOut(int indent) - { - std::string s; - - s.append("Byte"); - - s += NumberType::writeOut(indent + 1); - - return s; - } - } -} +#include "ByteType.h" + +#include "Range.h" +#include "Limit.h" + +namespace Databoard { + namespace Type { + + ByteType::ByteType() : NumberType() + { + this->range = NULL; + } + + ByteType::ByteType(std::string unit) : NumberType(unit) + { + this->unit = unit; + this->range = NULL; + } + + ByteType::ByteType(std::string unit, Range* range) : NumberType(unit, range) + { + this->unit = unit; + this->range = range; + } + + ByteType::~ByteType() + { + } + + char ByteType::minValue() + { + if(range == NULL) return SCHAR_MIN; + + Limit* l = range->getLower(); + + char value = l->getByte(SCHAR_MIN); + + return value; + } + + char ByteType::maxValue() + { + if(range == NULL) return SCHAR_MAX; + + Limit* l = range->getUpper(); + + char value = l->getByte(SCHAR_MAX); + + return value; + } + + std::string ByteType::writeOut(int indent) + { + std::string s; + + s.append("Byte"); + + s += NumberType::writeOut(indent + 1); + + return s; + } + } +}