taco-db  0.1.0
NodeTag.h
Go to the documentation of this file.
1 #ifndef UTILS_TREE_NODETAG_H
2 #define UTILS_TREE_NODETAG_H
3 
4 #include "tdb.h"
5 
6 #include "utils/misc.h"
7 
8 namespace taco {
9 
10 #define NODE_TAG(clsname, ...) \
11  CONCAT(T_, clsname) IF_NONEMPTY(CADR(__VA_ARGS__), = CADR(__VA_ARGS__)),
12 enum class NodeTag: uint16_t {
13  T_TreeNode = 0,
14 # include "utils/tree/node_tags.inc"
15 
16  T_InvalidTag = 0xFFFF
17 };
18 #undef NODE_TAG
19 
20 extern const char *node_tag_name(NodeTag tag);
21 
22 extern NodeTag node_tag_base(NodeTag tag);
23 
24 extern bool node_tag_is_a(NodeTag tag1, NodeTag tag2);
25 
26 #define TAG(nodeclsname) CONCAT(NodeTag::T_, nodeclsname)
27 
28 } // namespace taco
29 
30 #endif // UTILS_TREE_TREENODETAG_H
Definition: datum.h:28
bool node_tag_is_a(NodeTag tag1, NodeTag tag2)
Returns whether tag1'' is a class derived fromtag2''.
Definition: NodeTag.cpp:94
NodeTag node_tag_base(NodeTag tag)
Returns the immediate base class of `‘tag’'.
Definition: NodeTag.cpp:86
NodeTag
Definition: NodeTag.h:12
const char * node_tag_name(NodeTag tag)
Returns the class name of the tag's class.
Definition: NodeTag.cpp:78