aboutsummaryrefslogtreecommitdiff
path: root/core/src/Model/Workflow/Value_RTTI.cpp
blob: a0c32138e5509e11186cffe43687212435a1eb07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#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: return "<invalid kind>";
	}
}

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;
	}
}