test_xif.cc

来自「BCAST Implementation for NS2」· CC 代码 · 共 183 行

CC
183
字号
/* * Copyright (c) 2001-2003 International Computer Science Institute * See LICENSE file for licensing, conditions, and warranties on use. * * DO NOT EDIT THIS FILE - IT IS PROGRAMMATICALLY GENERATED * * Generated by 'clnt-gen'. */#ident "$XORP: xorp/xrl/interfaces/test_xif.cc,v 1.7 2003/08/07 04:52:28 hodson Exp $"#include "test_xif.hh"boolXrlTestV1p0Client::send_print_hello_world(	const char*	the_tgt, 	const PrintHelloWorldCB&	cb){    Xrl x(the_tgt, "test/1.0/print_hello_world");    return _sender->send(x, callback(this, &XrlTestV1p0Client::unmarshall_print_hello_world, cb));}/* Unmarshall print_hello_world */voidXrlTestV1p0Client::unmarshall_print_hello_world(	const XrlError&	e, 	XrlArgs*	a, 	PrintHelloWorldCB		cb){    if (e != XrlError::OKAY()) {	cb->dispatch(e);	return;    } else if (a && a->size() != 0) {	XLOG_ERROR("Wrong number of arguments (%u != 0)", (uint32_t)a->size());	cb->dispatch(XrlError::BAD_ARGS());	return;    }    cb->dispatch(e);}boolXrlTestV1p0Client::send_print_hello_world_and_message(	const char*	the_tgt, 	const string&	msg, 	const PrintHelloWorldAndMessageCB&	cb){    Xrl x(the_tgt, "test/1.0/print_hello_world_and_message");    x.args().add("msg", msg);    return _sender->send(x, callback(this, &XrlTestV1p0Client::unmarshall_print_hello_world_and_message, cb));}/* Unmarshall print_hello_world_and_message */voidXrlTestV1p0Client::unmarshall_print_hello_world_and_message(	const XrlError&	e, 	XrlArgs*	a, 	PrintHelloWorldAndMessageCB		cb){    if (e != XrlError::OKAY()) {	cb->dispatch(e);	return;    } else if (a && a->size() != 0) {	XLOG_ERROR("Wrong number of arguments (%u != 0)", (uint32_t)a->size());	cb->dispatch(XrlError::BAD_ARGS());	return;    }    cb->dispatch(e);}boolXrlTestV1p0Client::send_get_greeting_count(	const char*	the_tgt, 	const GetGreetingCountCB&	cb){    Xrl x(the_tgt, "test/1.0/get_greeting_count");    return _sender->send(x, callback(this, &XrlTestV1p0Client::unmarshall_get_greeting_count, cb));}/* Unmarshall get_greeting_count */voidXrlTestV1p0Client::unmarshall_get_greeting_count(	const XrlError&	e, 	XrlArgs*	a, 	GetGreetingCountCB		cb){    if (e != XrlError::OKAY()) {	cb->dispatch(e, 0);	return;    } else if (a && a->size() != 1) {	XLOG_ERROR("Wrong number of arguments (%u != 1)", (uint32_t)a->size());	cb->dispatch(XrlError::BAD_ARGS(), 0);	return;    }    int32_t num_msgs;    try {	a->get("num_msgs", num_msgs);    } catch (const XrlArgs::XrlAtomNotFound&) {	XLOG_ERROR("Atom not found");	cb->dispatch(XrlError::BAD_ARGS(), 0);	return;    }    cb->dispatch(e, &num_msgs);}boolXrlTestV1p0Client::send_get_greeting(	const char*	the_tgt, 	const int32_t&	greeting_num, 	const GetGreetingCB&	cb){    Xrl x(the_tgt, "test/1.0/get_greeting");    x.args().add("greeting_num", greeting_num);    return _sender->send(x, callback(this, &XrlTestV1p0Client::unmarshall_get_greeting, cb));}/* Unmarshall get_greeting */voidXrlTestV1p0Client::unmarshall_get_greeting(	const XrlError&	e, 	XrlArgs*	a, 	GetGreetingCB		cb){    if (e != XrlError::OKAY()) {	cb->dispatch(e, 0);	return;    } else if (a && a->size() != 1) {	XLOG_ERROR("Wrong number of arguments (%u != 1)", (uint32_t)a->size());	cb->dispatch(XrlError::BAD_ARGS(), 0);	return;    }    string greeting;    try {	a->get("greeting", greeting);    } catch (const XrlArgs::XrlAtomNotFound&) {	XLOG_ERROR("Atom not found");	cb->dispatch(XrlError::BAD_ARGS(), 0);	return;    }    cb->dispatch(e, &greeting);}boolXrlTestV1p0Client::send_shoot_foot(	const char*	the_tgt, 	const ShootFootCB&	cb){    Xrl x(the_tgt, "test/1.0/shoot_foot");    return _sender->send(x, callback(this, &XrlTestV1p0Client::unmarshall_shoot_foot, cb));}/* Unmarshall shoot_foot */voidXrlTestV1p0Client::unmarshall_shoot_foot(	const XrlError&	e, 	XrlArgs*	a, 	ShootFootCB		cb){    if (e != XrlError::OKAY()) {	cb->dispatch(e);	return;    } else if (a && a->size() != 0) {	XLOG_ERROR("Wrong number of arguments (%u != 0)", (uint32_t)a->size());	cb->dispatch(XrlError::BAD_ARGS());	return;    }    cb->dispatch(e);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?