#include #include #include //struct test_visitor : pw::node::visitor { // virtual void enter(pw::node *n) override; // virtual void leave(pw::node *n) override; //}; //void test_visitor::enter(pw::node *n) //{ // std::cout << n->name() << " " << n->is_leaf() << std::endl; //} //void test_visitor::leave(pw::node *n) //{ //} #include int main(int argc,char **argv) { using namespace pw; // node::ref root(std::make_shared()); // root->set_name("root"); // root->add_child()->set_name("sub-1"); // node::ref sub_2_1 = std::make_shared("sub-2-1"); // root->add_child(std::make_shared("sub-3"))->add_child(sub_2_1); // root->add_child(std::make_shared("sub-2"))->add_child(std::make_shared("sub-2-2")); // std::cout << "sub-2-1 parent count: " << sub_2_1->parents().size() << std::endl; // traverser tv; // tv.bfs(root); // print_node_path(sub_2_1); // print_node_path(root->children()[2]->children().front()); return 0; }