1 #include "UnionValue.h"
9 UnionValue::UnionValue(Databoard::Type::DataType* dataBoard) : Value(dataBoard)
15 UnionValue::~UnionValue()
24 int UnionValue::getTag()
29 Value* UnionValue::getValue()
34 void UnionValue::setValue(int tag, Value* value)
40 std::string UnionValue::writeOut(int /*indent*/)
44 Databoard::Type::UnionType* unionType = (Databoard::Type::UnionType*)dataBoard;
46 Databoard::Type::Component* component = unionType->getComponent(tag);
50 s += component->getName();
56 s += value->writeOut();
61 //if(unit.size() != 0)
63 // s += "(Unit=\"" + unit + "\")";
69 bool UnionValue::equals(const Value* other)
71 UnionValue* o = (UnionValue*)other;
75 return (tag < o->tag);
78 return (value->equals(o->value));
81 std::string UnionValue::isValid()
85 return "LongValue: There is no datatype.";
93 return value->isValid();