OpenBMC:BmcWeb添加路由5 设置handler函数
对路由对象完成了权限和method的设置后,最重要的就是设置路由的处理函数:
//http\routing\taggedrule.hpp
template <typename... Args>
class TaggedRule :
public BaseRule,
public RuleParameterTraits<TaggedRule<Args...>>
{
...
template <typename Func>
void operator()(Func&& f)
{
static_assert(
std::is_invocable_v<Func, crow::Request,
std::shared_ptr<bmcweb::AsyncResp>&, Args...>,
"Handler type is mismatched with URL parameters");
static_assert(
std::is_same_v<
void, std::invoke_result_t<Func, crow::Request,
std::shared_ptr<bmcweb::AsyncResp&g