#include "IntegerType.h" #include "Range.h" #include "Limit.h" namespace Databoard { namespace Type { IntegerType::IntegerType() : NumberType() { this->unit = unit; this->range = NULL; } IntegerType::IntegerType(std::string unit) : NumberType(unit) { this->unit = unit; this->range = NULL; } IntegerType::IntegerType(std::string unit, Range* range) : NumberType(unit, range) { this->unit = unit; this->range = range; } IntegerType::~IntegerType() { } int IntegerType::minValue() { if(range == NULL) return INT_MIN; Limit* l = range->getLower(); int value = l->getInteger(INT_MIN); return value; } int IntegerType::maxValue() { if(range == NULL) return INT_MAX; Limit* l = range->getUpper(); int value = l->getInteger(INT_MAX); return value; } std::string IntegerType::writeOut(int indent) { std::string s; s.append("Integer"); s += NumberType::writeOut(indent + 1); return s; } } }