1 #ifndef UTILS_TREE_NODE_H
2 #define UTILS_TREE_NODE_H
43 template<
class ...UniquePtrs>
47 m_input.reserve(
sizeof...(UniquePtrs));
49 std::forward<UniquePtrs>(input)...);
75 return static_cast<Node*
>(
m_input[i].get());
98 int indent)
const = 0;
104 std::vector<std::unique_ptr<TreeNode>>
m_input;
TreeNode is the base class of all tree structures in TDB (e.g., parsing tree, logical plan,...
Definition: TreeNode.h:40
TreeNode(NodeTag tag, UniquePtrs &&...input)
Definition: TreeNode.h:44
virtual ~TreeNode()
Definition: TreeNode.h:52
TreeNode & operator=(const TreeNode &)=delete
static void append_indent(std::string &buf, int indent)
Definition: TreeNode.cpp:25
std::vector< std::unique_ptr< TreeNode > > m_input
Definition: TreeNode.h:104
std::string to_string() const
Definition: TreeNode.h:80
TreeNode & operator=(TreeNode &&)=default
NodeTag m_tag
Definition: TreeNode.h:102
static constexpr const int TO_STRING_INDENT_SIZE
Definition: TreeNode.h:106
Node * get_input_as(size_t i) const
Definition: TreeNode.h:73
virtual void node_properties_to_string(std::string &buf, int indent) const =0
TreeNode(const TreeNode &)=delete
constexpr NodeTag get_tag() const
Definition: TreeNode.h:60
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:93
TreeNode(TreeNode &&)=default
TreeNode * get_input(size_t i) const
Definition: TreeNode.h:65
void emplace_back_parameter_pack(Container &c, Arg0 &&arg0, Args &&...args)
Definition: misc.h:102
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