Go to the documentation of this file. 1 #ifndef UTILS_TREE_NODE_H
2 #define UTILS_TREE_NODE_H
48 template<
class ...UniquePtrs>
52 m_input.reserve(
sizeof...(UniquePtrs));
54 std::forward<UniquePtrs>(input)...);
80 return static_cast<Node*
>(
m_input[i].get());
103 int indent)
const = 0;
109 std::vector<std::unique_ptr<TreeNode>>
m_input;
117 #endif // UTILS_TREE_NODE_H
TreeNode is the base class of all tree structures in TDB (e.g., parsing tree, logical plan,...
Definition: TreeNode.h:45
virtual ~TreeNode()
Definition: TreeNode.h:57
TreeNode(NodeTag tag, UniquePtrs &&...input)
Definition: TreeNode.h:49
const char * node_tag_name(NodeTag tag)
Returns the class name of the tag's class.
Definition: NodeTag.cpp:78
void node_to_string(std::string &buf, int indent) const
Prints the node contents to a string buffer.
Definition: TreeNode.cpp:10
const char * node_name() const
Definition: TreeNode.h:98
Node * get_input_as(size_t i) const
Definition: TreeNode.h:78
constexpr NodeTag get_tag() const
Definition: TreeNode.h:65
TreeNode * get_input(size_t i) const
Definition: TreeNode.h:70
const NodeTag m_tag
Definition: TreeNode.h:107
std::string to_string() const
Definition: TreeNode.h:85
virtual void node_properties_to_string(std::string &buf, int indent) const =0
TreeNode & operator=(TreeNode &&)=default
std::vector< std::unique_ptr< TreeNode > > m_input
Definition: TreeNode.h:109
static void append_indent(std::string &buf, int indent)
Definition: TreeNode.cpp:25
void emplace_back_parameter_pack(Container &c, Arg0 &&arg0, Args &&...args)
Definition: misc.h:99
NodeTag
Definition: NodeTag.h:12
static constexpr const int TO_STRING_INDENT_SIZE
Definition: TreeNode.h:112