#include "ArrayType.h" #include "Range.h" namespace Databoard { namespace Type { ArrayType::ArrayType() { this->componentType = NULL; this->length = NULL; } ArrayType::ArrayType(DataType* componentType) { this->componentType = componentType; this->length = NULL; } ArrayType::ArrayType(DataType* componentType, Range* length) { this->componentType = componentType; this->length = length; } ArrayType::~ArrayType() { if(componentType != NULL) { delete componentType; } if(length != NULL) { delete length; } } DataType* ArrayType::getComponentType() { return componentType; } void ArrayType::setComponentType(DataType* componentType) { this->componentType = componentType; if(componentType->getNotBuiltIn() == true) { notBuiltIn = true; } } int ArrayType::minLength() { if(length == NULL) return 0; return 0;//length->getLower(); } int ArrayType::maxLength() { if(length == NULL) return INT_MAX; return 0;//length->Upper(); } Range* ArrayType::getLength() { return length; } void ArrayType::setLength(Range* length) { this->length = length; } std::string ArrayType::writeOut(int /*indent*/) { std::string s; s += componentType->writeOut(); if(length != NULL) { s += length->writeOut(); } return s; } } }