| 1723 | } |
| 1724 | |
| 1725 | Status GetMclassInfo(ServerContext*, const GetMclassInfoRequest* request, |
| 1726 | GetMclassInfoResponse* response) override { |
| 1727 | std::lock_guard<std::recursive_mutex> lock(mutex_); |
| 1728 | |
| 1729 | VLOG(1) << "GetMclassInfo from client:" << std::endl |
| 1730 | << request->DebugString(); |
| 1731 | if (!request->name().length()) { |
| 1732 | return return_with_error(response, EINVAL, |
| 1733 | "Argument must be a name in str"); |
| 1734 | } |
| 1735 | |
| 1736 | const std::string& cls_name = request->name(); |
| 1737 | const auto& it = ModuleBuilder::all_module_builders().find(cls_name); |
| 1738 | if (it == ModuleBuilder::all_module_builders().end()) { |
| 1739 | return return_with_error(response, ENOENT, "No module class '%s' found", |
| 1740 | cls_name.c_str()); |
| 1741 | } |
| 1742 | const ModuleBuilder* cls = &it->second; |
| 1743 | |
| 1744 | response->set_name(cls->class_name()); |
| 1745 | response->set_help(cls->help_text()); |
| 1746 | for (const auto& cmd : cls->cmds()) { |
| 1747 | response->add_cmds(cmd.first); |
| 1748 | response->add_cmd_args(cmd.second); |
| 1749 | } |
| 1750 | return Status::OK; |
| 1751 | } |
| 1752 | |
| 1753 | Status ModuleCommand(ServerContext*, const CommandRequest* request, |
| 1754 | CommandResponse* response) override { |
nothing calls this directly
no test coverage detected