aboutsummaryrefslogtreecommitdiff
path: root/core/src/Model/Workflow/ValueInternals.hpp
blob: 49981f0e5b8036fd32b6c2c1493f2c9f7bfbd8cc (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 "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;                                \
	}