aboutsummaryrefslogtreecommitdiff
path: root/core/src/Model/Workflow/Value_RTTI.cpp
blob: f2c8f92ec7619c8ff1c05d931198ca64f3c43b17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "Value.hpp"

#include "Model/Workflow/Values/BasicValues.hpp"
#include "Utils/Macros.hpp"

const char* BaseValue::FormatKind(Kind kind) {
	switch (kind) {
		case KD_Numeric: return "Numeric";
		case KD_Text: return "Text";
		case KD_DateTime: return "Date/time";
		case InvalidKind: UNREACHABLE;
	}
}

std::unique_ptr<BaseValue> BaseValue::CreateByKind(BaseValue::Kind kind) {
	switch (kind) {
		case KD_Numeric: return std::make_unique<NumericValue>();
		case KD_Text: return std::make_unique<TextValue>();
		case KD_DateTime: return std::make_unique<DateTimeValue>();
		case InvalidKind: return nullptr;
	}
}