?? bcast_base.hh
字號(hào):
/* * 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 'tgt-gen'. * * $XORP$ */#ifndef __XRL_INTERFACES_BCAST_BASE_HH__#define __XRL_INTERFACES_BCAST_BASE_HH__#undef XORP_LIBRARY_NAME#define XORP_LIBRARY_NAME "XrlBcastTarget"#include "libxorp/xlog.h"#include "libxipc/xrl_cmd_map.hh"class XrlBcastTargetBase {protected: XrlCmdMap* _cmds;public: XrlBcastTargetBase(XrlCmdMap* cmds) : _cmds(cmds) { add_handlers(); } virtual ~XrlBcastTargetBase() { remove_handlers(); } inline const string& name() const { return _cmds->name(); } inline const char* version() const { return "bcast/0.0"; }protected: /** * Pure-virtual function that needs to be implemented to: * * Get name of Xrl Target */ virtual XrlCmdError common_0_1_get_target_name( // Output values, string& name) = 0; /** * Pure-virtual function that needs to be implemented to: * * Get version string from Xrl Target */ virtual XrlCmdError common_0_1_get_version( // Output values, string& version) = 0; /** * Pure-virtual function that needs to be implemented to: * * Get status of Xrl Target */ virtual XrlCmdError common_0_1_get_status( // Output values, uint32_t& status, string& reason) = 0; /** * Pure-virtual function that needs to be implemented to: * * Request clean shutdown of Xrl Target */ virtual XrlCmdError common_0_1_shutdown() = 0; /** * Pure-virtual function that needs to be implemented to: * * Set HELLO interval (in seconds) * * @param new_int new HELLO interval */ virtual XrlCmdError bcast_1_0_set_hello_interval( // Input values, const int32_t& new_int) = 0; /** * Pure-virtual function that needs to be implemented to: * * Get HELLO interval * * @param old_int current HELLO interval */ virtual XrlCmdError bcast_1_0_get_hello_interval( // Output values, int32_t& old_int) = 0; /** * Pure-virtual function that needs to be implemented to: * * Set buffer size * * @param new_buf size of packet buffer */ virtual XrlCmdError bcast_1_0_set_buffer_size( // Input values, const int32_t& new_buf) = 0; /** * Pure-virtual function that needs to be implemented to: * * Get buffer size * * @param old_buf current packet buffer size */ virtual XrlCmdError bcast_1_0_get_buffer_size( // Output values, int32_t& old_buf) = 0; /** * Pure-virtual function that needs to be implemented to: * * Set RELIABILITY (TRUE or FALSE) * * @param reliability set reliablity level for BCAST */ virtual XrlCmdError bcast_1_0_set_reliability( // Input values, const bool& reliability) = 0; /** * Pure-virtual function that needs to be implemented to: * * Get RELIABILITY setting (TRUE or FALSE) * * @param reliability get reliability level for BCAST */ virtual XrlCmdError bcast_1_0_get_reliability( // Output values, bool& reliability) = 0; /** * Pure-virtual function that needs to be implemented to: * * Set interface over which BCAST operates * * @param intf set interface over which BCAST operates */ virtual XrlCmdError bcast_1_0_set_interface( // Input values, const string& intf) = 0; /** * Pure-virtual function that needs to be implemented to: * * Get interface over which BCAST operates * * @param intf get interface over wich BCAST operates */ virtual XrlCmdError bcast_1_0_get_interface( // Output values, string& intf) = 0; /** * Pure-virtual function that needs to be implemented to: * * Activate the protocol */ virtual XrlCmdError bcast_1_0_activate_bcast() = 0;private: const XrlCmdError handle_common_0_1_get_target_name(const XrlArgs& in, XrlArgs* out); const XrlCmdError handle_common_0_1_get_version(const XrlArgs& in, XrlArgs* out); const XrlCmdError handle_common_0_1_get_status(const XrlArgs& in, XrlArgs* out); const XrlCmdError handle_common_0_1_shutdown(const XrlArgs& in, XrlArgs* out); const XrlCmdError handle_bcast_1_0_set_hello_interval(const XrlArgs& in, XrlArgs* out); const XrlCmdError handle_bcast_1_0_get_hello_interval(const XrlArgs& in, XrlArgs* out); const XrlCmdError handle_bcast_1_0_set_buffer_size(const XrlArgs& in, XrlArgs* out); const XrlCmdError handle_bcast_1_0_get_buffer_size(const XrlArgs& in, XrlArgs* out); const XrlCmdError handle_bcast_1_0_set_reliability(const XrlArgs& in, XrlArgs* out); const XrlCmdError handle_bcast_1_0_get_reliability(const XrlArgs& in, XrlArgs* out); const XrlCmdError handle_bcast_1_0_set_interface(const XrlArgs& in, XrlArgs* out); const XrlCmdError handle_bcast_1_0_get_interface(const XrlArgs& in, XrlArgs* out); const XrlCmdError handle_bcast_1_0_activate_bcast(const XrlArgs& in, XrlArgs* out); void add_handlers() { if (_cmds->add_handler("common/0.1/get_target_name", callback(this, &XrlBcastTargetBase::handle_common_0_1_get_target_name)) == false) { XLOG_ERROR("Failed to xrl handler finder://bcast/common/0.1/get_target_name"); } if (_cmds->add_handler("common/0.1/get_version", callback(this, &XrlBcastTargetBase::handle_common_0_1_get_version)) == false) { XLOG_ERROR("Failed to xrl handler finder://bcast/common/0.1/get_version"); } if (_cmds->add_handler("common/0.1/get_status", callback(this, &XrlBcastTargetBase::handle_common_0_1_get_status)) == false) { XLOG_ERROR("Failed to xrl handler finder://bcast/common/0.1/get_status"); } if (_cmds->add_handler("common/0.1/shutdown", callback(this, &XrlBcastTargetBase::handle_common_0_1_shutdown)) == false) { XLOG_ERROR("Failed to xrl handler finder://bcast/common/0.1/shutdown"); } if (_cmds->add_handler("bcast/1.0/set_hello_interval", callback(this, &XrlBcastTargetBase::handle_bcast_1_0_set_hello_interval)) == false) { XLOG_ERROR("Failed to xrl handler finder://bcast/bcast/1.0/set_hello_interval"); } if (_cmds->add_handler("bcast/1.0/get_hello_interval", callback(this, &XrlBcastTargetBase::handle_bcast_1_0_get_hello_interval)) == false) { XLOG_ERROR("Failed to xrl handler finder://bcast/bcast/1.0/get_hello_interval"); } if (_cmds->add_handler("bcast/1.0/set_buffer_size", callback(this, &XrlBcastTargetBase::handle_bcast_1_0_set_buffer_size)) == false) { XLOG_ERROR("Failed to xrl handler finder://bcast/bcast/1.0/set_buffer_size"); } if (_cmds->add_handler("bcast/1.0/get_buffer_size", callback(this, &XrlBcastTargetBase::handle_bcast_1_0_get_buffer_size)) == false) { XLOG_ERROR("Failed to xrl handler finder://bcast/bcast/1.0/get_buffer_size"); } if (_cmds->add_handler("bcast/1.0/set_reliability", callback(this, &XrlBcastTargetBase::handle_bcast_1_0_set_reliability)) == false) { XLOG_ERROR("Failed to xrl handler finder://bcast/bcast/1.0/set_reliability"); } if (_cmds->add_handler("bcast/1.0/get_reliability", callback(this, &XrlBcastTargetBase::handle_bcast_1_0_get_reliability)) == false) { XLOG_ERROR("Failed to xrl handler finder://bcast/bcast/1.0/get_reliability"); } if (_cmds->add_handler("bcast/1.0/set_interface", callback(this, &XrlBcastTargetBase::handle_bcast_1_0_set_interface)) == false) { XLOG_ERROR("Failed to xrl handler finder://bcast/bcast/1.0/set_interface"); } if (_cmds->add_handler("bcast/1.0/get_interface", callback(this, &XrlBcastTargetBase::handle_bcast_1_0_get_interface)) == false) { XLOG_ERROR("Failed to xrl handler finder://bcast/bcast/1.0/get_interface"); } if (_cmds->add_handler("bcast/1.0/activate_bcast", callback(this, &XrlBcastTargetBase::handle_bcast_1_0_activate_bcast)) == false) { XLOG_ERROR("Failed to xrl handler finder://bcast/bcast/1.0/activate_bcast"); } _cmds->finalize(); } void remove_handlers() { _cmds->remove_handler("common/0.1/get_target_name"); _cmds->remove_handler("common/0.1/get_version"); _cmds->remove_handler("common/0.1/get_status"); _cmds->remove_handler("common/0.1/shutdown"); _cmds->remove_handler("bcast/1.0/set_hello_interval"); _cmds->remove_handler("bcast/1.0/get_hello_interval"); _cmds->remove_handler("bcast/1.0/set_buffer_size"); _cmds->remove_handler("bcast/1.0/get_buffer_size"); _cmds->remove_handler("bcast/1.0/set_reliability"); _cmds->remove_handler("bcast/1.0/get_reliability"); _cmds->remove_handler("bcast/1.0/set_interface"); _cmds->remove_handler("bcast/1.0/get_interface"); _cmds->remove_handler("bcast/1.0/activate_bcast"); }};#endif /* __XRL_INTERFACES_BCAST_BASE_HH__ */
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -