当前位置: 首页>>代码示例>>C++>>正文


C++ Request::command方法代码示例

本文整理汇总了C++中plugin::queryrequestmessage::Request::command方法的典型用法代码示例。如果您正苦于以下问题:C++ Request::command方法的具体用法?C++ Request::command怎么用?C++ Request::command使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在plugin::queryrequestmessage::Request的用法示例。


在下文中一共展示了Request::command方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: query_fallback

void LUAScript::query_fallback(const Plugin::QueryRequestMessage::Request &request, Plugin::QueryResponseMessage::Response *response, const Plugin::QueryRequestMessage &request_message) {
	std::string response_buffer;
	boost::optional<scripts::command_definition<lua::lua_traits> > cmd = scripts_->find_command(scripts::nscp::tags::query_tag, request.command());
	if (!cmd) {
		cmd = scripts_->find_command(scripts::nscp::tags::simple_query_tag, request.command());
		if (!cmd)
			return nscapi::protobuf::functions::set_response_bad(*response, "Failed to find command: " + request.command());
		return lua_runtime_->on_query(request.command(), cmd->information, cmd->function, true, request, response, request_message);
	}
	return lua_runtime_->on_query(request.command(), cmd->information, cmd->function, false, request, response, request_message);
}
开发者ID:0000-bigtree,项目名称:nscp,代码行数:11,代码来源:LUAScript.cpp

示例2: query_fallback

void NRPEClient::query_fallback(const Plugin::QueryRequestMessage::Request &request, Plugin::QueryResponseMessage::Response *response, const Plugin::QueryRequestMessage &request_message) {
	client::configuration config(nrpe_client::command_prefix, 
		boost::shared_ptr<nrpe_client::clp_handler_impl>(new nrpe_client::clp_handler_impl(boost::shared_ptr<socket_helpers::client::client_handler>(new client_handler()))), 
		boost::shared_ptr<nrpe_client::target_handler>(new nrpe_client::target_handler(targets)));
	nrpe_client::setup(config, request_message.header());
	commands.parse_query(nrpe_client::command_prefix, nrpe_client::default_command, request.command(), config, request, *response, request_message);
}
开发者ID:lazyfrosch,项目名称:nscp,代码行数:7,代码来源:NRPEClient.cpp

示例3: query_fallback

void CheckExternalScripts::query_fallback(const Plugin::QueryRequestMessage::Request &request, Plugin::QueryResponseMessage::Response *response, const Plugin::QueryRequestMessage &) {
		//nscapi::functions::decoded_simple_command_data data = nscapi::functions::parse_simple_query_request(char_command, request);

		commands::optional_command_object command_def = commands_.find_object(request.command());

		std::list<std::string> args;
		for (int i=0;i<request.arguments_size();++i) {
			args.push_back(request.arguments(i));
		}
		if (command_def) {
			handle_command(*command_def, args, response);
			return;
		}
		alias::optional_command_object alias_def = aliases_.find_object(request.command());
		if (alias_def) {
			handle_alias(*alias_def, args, response);
			return;
		}
		NSC_LOG_ERROR_STD("No command or alias found matching: " + request.command());
		nscapi::protobuf::functions::set_response_bad(*response, "No command or alias found matching: " + request.command());
	}
开发者ID:palli,项目名称:nscp,代码行数:21,代码来源:CheckExternalScripts.cpp

示例4: query_fallback

void CheckExternalScripts::query_fallback(const Plugin::QueryRequestMessage::Request &request, Plugin::QueryResponseMessage::Response *response, const Plugin::QueryRequestMessage &) {
	if (!provider_) {
		NSC_LOG_ERROR_STD("No provider found: " + request.command());
		nscapi::protobuf::functions::set_response_bad(*response, "No command or alias found matching: " + request.command());
		return;
	}
	commands::command_object_instance command_def = provider_->find_command(request.command());

	std::list<std::string> args;
	for (int i = 0; i < request.arguments_size(); ++i) {
		args.push_back(request.arguments(i));
	}
	if (command_def) {
		handle_command(*command_def, args, response);
		return;
	}
	alias::command_object_instance alias_def = aliases_.find_object(request.command());
	if (alias_def) {
		handle_alias(*alias_def, args, response);
		return;
	}
	NSC_LOG_ERROR_STD("No command or alias found matching: " + request.command());
	nscapi::protobuf::functions::set_response_bad(*response, "No command or alias found matching: " + request.command());
}
开发者ID:mickem,项目名称:nscp,代码行数:24,代码来源:CheckExternalScripts.cpp

示例5: query_fallback

void CheckMKClient::query_fallback(const Plugin::QueryRequestMessage::Request &request, Plugin::QueryResponseMessage::Response *response, const Plugin::QueryRequestMessage &request_message) {
	client::configuration config(command_prefix, boost::shared_ptr<clp_handler_impl>(new clp_handler_impl(this)), boost::shared_ptr<target_handler>(new target_handler(targets)));
	setup(config, request_message.header());
	commands.parse_query(command_prefix, default_command, request.command(), config, request, *response, request_message);
}
开发者ID:TaylorMonacelli,项目名称:nscp,代码行数:5,代码来源:CheckMKClient.cpp

示例6: data

		cli_helper(const Plugin::QueryRequestMessage::Request &request, Plugin::QueryResponseMessage::Response *response, data_container &data)
			: data(data)
			, desc("Allowed options for " + request.command())
			, request(request)
			, response(response)
			, show_all(false) {}
开发者ID:jonasoberschweiber,项目名称:nscp,代码行数:6,代码来源:cli_helper.hpp

示例7: query_fallback

void SMTPClient::query_fallback(const Plugin::QueryRequestMessage::Request &request, Plugin::QueryResponseMessage::Response *response, const Plugin::QueryRequestMessage &request_message) {
	client::configuration config(command_prefix);
	setup(config, request_message.header());
	commands.parse_query(command_prefix, default_command, request.command(), config, request, *response, request_message);
}
开发者ID:Vilse1202,项目名称:nscp,代码行数:5,代码来源:SMTPClient.cpp

示例8: sample_raw_command

void SamplePluginSimple::sample_raw_command(const Plugin::QueryRequestMessage::Request &request, Plugin::QueryResponseMessage::Response *response) {
	response->set_command(request.command());
	response->set_message("Yaaay it works");
	response->set_result(Plugin::Common_ResultCode_OK);
}
开发者ID:Vilse1202,项目名称:nscp,代码行数:5,代码来源:SamplePluginSimple.cpp


注:本文中的plugin::queryrequestmessage::Request::command方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。