-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommon.hpp
60 lines (49 loc) · 2.25 KB
/
Common.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
///
/// Langulus::Flow
/// Copyright (c) 2017 Dimo Markov <[email protected]>
/// Part of the Langulus framework, see https://langulus.com
///
/// SPDX-License-Identifier: GPL-3.0-or-later
///
#pragma once
#include <RTTI/Meta.hpp>
#if defined(LANGULUS_EXPORT_ALL) || defined(LANGULUS_EXPORT_FLOW)
#define LANGULUS_API_FLOW() LANGULUS_EXPORT()
#else
#define LANGULUS_API_FLOW() LANGULUS_IMPORT()
#endif
LANGULUS_EXCEPTION(Flow);
LANGULUS_EXCEPTION(Link);
/// Make the rest of the code aware, that Langulus::Flow has been included
#define LANGULUS_LIBRARY_FLOW() 1
namespace Langulus::Flow
{
using namespace Anyness;
using RTTI::VMeta;
using RTTI::TMeta;
using RTTI::DMeta;
using RTTI::CMeta;
using RTTI::AMeta;
///
/// Bits for seek functions
///
enum class Seek : uint8_t {
// Seek entities that are children of the context
Below = 1,
// Seek entities that are parents of the context
Above = 2,
// Seek objects in both directions - in parents and children
Duplex = Below | Above,
// Include the current entity in the seek operation
Here = 4,
// Seek everywhere
Everywhere = Duplex | Here,
// Seek parents and this context included
HereAndAbove = Above | Here,
// Seek children and this context included
HereAndBelow = Below | Here
};
constexpr bool operator & (const Seek& lhs, const Seek& rhs) {
return (static_cast<int>(lhs) & static_cast<int>(rhs)) != 0;
}
} // namespace Langulus::Flow