aboutsummaryrefslogtreecommitdiff
path: root/app/source/Cplt/Model/Workflow/ValueInternals.hpp
blob: 45842dbde64684ec4244d95100050d90d87064df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// This file contains utility classes and macros for implementing values
// As consumers, you should not include this header as it contains unnecessary symbols and can pollute your files
// for this reason, classes here aren't forward-declared in fwd.hpp either.

#pragma once

#include <Cplt/Utils/RTTI.hpp>

#include <utility>

#define CHECK_VALUE_TYPE(Type, value) \
	if (!is_a<Type>(value)) {         \
		return false;                 \
	}

#define CHECK_VALUE_TYPE_AND_MOVE(Type, dest, value) \
	if (auto ptr = dyn_cast<Type>(value)) {          \
		dest = std::move(*ptr);                      \
	} else {                                         \
		return false;                                \
	}