X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.databoard%2Fcpp%2FDataBoardTest%2FDataBoard%2FArrayType.cpp;fp=bundles%2Forg.simantics.databoard%2Fcpp%2FDataBoardTest%2FDataBoard%2FArrayType.cpp;h=552dc453b22bd14e43c09d04320e95d694db5a8f;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hp=0209ce4e3c1e031a041bdd15d635e10b907c5828;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/ArrayType.cpp b/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/ArrayType.cpp index 0209ce4e3..552dc453b 100644 --- a/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/ArrayType.cpp +++ b/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/ArrayType.cpp @@ -1,92 +1,92 @@ -#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; - } - } -} +#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; + } + } +}