ReturnType operator()(A1... a1) const { typename FuncMap::const_iterator it = m_funcs.find(typeid(ReturnType(A1...))); if (it != m_funcs.end()) { ReturnType(*f)(A1...) = (ReturnType(*)(A1...))(it->second); (*f)(a1...); } }
Node * create_node(std::string line){ std::vector<std::string> string_vec = split_str(line); if(string_vec.size() == 0){ return new Node(CONTROL_GRP); } std::string name = string_vec[0]; FuncMap::iterator it = node_creators.find(name); Node * nnode = NULL; if(it == node_creators.end()){ return new Node(CONTROL_GRP); }else{ nnode = it->second(); } string_vec.erase(string_vec.begin()); nnode->handle_args(string_vec); return nnode; }