24#include "AstUtil/StringView.hpp"
25#include "AstUtil/ValueView.hpp"
26#include "CommandUtil.hpp"
90 for(
auto& child : children_)
92 if (key == child.key_)
100 for (
auto& child : children_)
102 if (key == child.key_)
105 children_.emplace_back(key);
106 auto& child = children_.back();
116 void addRule(
StringView tmpl, std::shared_ptr<CommandHandler> handler);
命令处理接口
定义 CommandRouting.hpp:50
virtual errc_t handle(const CommandParams ¶ms, CommandResult &result) const =0
命令参数
定义 CommandRouting.hpp:42
const Node * findChild(StringView key) const
查找子节点
定义 CommandRouting.hpp:88
std::vector< Node > children_
子节点
定义 CommandRouting.hpp:113
Node & ensureChild(StringView key)
确保子节点存在
定义 CommandRouting.hpp:98
std::string key_
键值
定义 CommandRouting.hpp:111
std::shared_ptr< CommandHandler > handler_
命令处理函数
定义 CommandRouting.hpp:112
路由树
定义 CommandRouting.hpp:78
路由结果
定义 CommandRouting.hpp:64