|
xorp
|
00001 /* 00002 * obj/i686-pc-linux-gnu/xrl/targets/test_fea_ifmgr_mirror_base.hh 00003 * vim:set sts=4 ts=8 ft=cpp: 00004 * 00005 * Copyright (c) 2001-2011 XORP, Inc and Others 00006 * See the XORP LICENSE.lgpl file for licensing, conditions, and warranties 00007 * on use. 00008 * 00009 * DO NOT EDIT THIS FILE - IT IS PROGRAMMATICALLY GENERATED 00010 * 00011 * Generated by 'tgt-gen'. 00012 */ 00013 00014 00015 #ifndef __XRL_TARGETS_TEST_FEA_IFMGR_MIRROR_BASE_HH__ 00016 #define __XRL_TARGETS_TEST_FEA_IFMGR_MIRROR_BASE_HH__ 00017 00018 #undef XORP_LIBRARY_NAME 00019 #define XORP_LIBRARY_NAME "XrlTestFeaIfmgrMirrorTarget" 00020 00021 #include "libxorp/xlog.h" 00022 #include "libxipc/xrl_cmd_map.hh" 00023 00024 class XrlTestFeaIfmgrMirrorTargetBase { 00025 protected: 00026 XrlCmdMap* _cmds; 00027 00028 public: 00036 XrlTestFeaIfmgrMirrorTargetBase(XrlCmdMap* cmds = 0); 00037 00043 virtual ~XrlTestFeaIfmgrMirrorTargetBase(); 00044 00055 bool set_command_map(XrlCmdMap* cmds); 00056 00060 const string& get_name() const { return _cmds->name(); } 00061 00065 const char* version() const { return "test_fea_ifmgr_mirror/0.0"; } 00066 00067 protected: 00068 00074 virtual XrlCmdError ifmgr_replicator_0_1_register_ifmgr_mirror( 00075 // Input values, 00076 const string& clientname) = 0; 00077 #ifdef XORP_ENABLE_ASYNC_SERVER 00078 typedef 00079 XorpCallback1<void, const XrlCmdError &>::RefPtr 00080 IfmgrReplicator01RegisterIfmgrMirrorRF; 00081 00082 class IfmgrReplicator01RegisterIfmgrMirrorCB { 00083 IfmgrReplicator01RegisterIfmgrMirrorRF cb; 00084 00085 public: 00086 operator const IfmgrReplicator01RegisterIfmgrMirrorRF& () const { return cb; } 00087 const IfmgrReplicator01RegisterIfmgrMirrorRF& operator ->() const { return cb; } 00088 IfmgrReplicator01RegisterIfmgrMirrorCB(const IfmgrReplicator01RegisterIfmgrMirrorRF& cb) 00089 : cb(cb) { } 00090 00091 void fail(const XrlCmdError &e) const { cb->dispatch(e); } 00092 00093 void respond() const { 00094 cb->dispatch(XrlCmdError::OKAY()); 00095 } 00096 }; 00097 00098 struct IfmgrReplicator01RegisterIfmgrMirrorRsp : 00099 public IfmgrReplicator01RegisterIfmgrMirrorCB { 00100 IfmgrReplicator01RegisterIfmgrMirrorRsp(const IfmgrReplicator01RegisterIfmgrMirrorRF& cb) 00101 : IfmgrReplicator01RegisterIfmgrMirrorCB(cb) { } 00102 00103 }; 00104 00105 virtual void async_ifmgr_replicator_0_1_register_ifmgr_mirror 00106 ( 00107 const string& clientname, 00108 IfmgrReplicator01RegisterIfmgrMirrorCB); 00109 #endif 00110 00116 virtual XrlCmdError ifmgr_replicator_0_1_unregister_ifmgr_mirror( 00117 // Input values, 00118 const string& clientname) = 0; 00119 #ifdef XORP_ENABLE_ASYNC_SERVER 00120 typedef 00121 XorpCallback1<void, const XrlCmdError &>::RefPtr 00122 IfmgrReplicator01UnregisterIfmgrMirrorRF; 00123 00124 class IfmgrReplicator01UnregisterIfmgrMirrorCB { 00125 IfmgrReplicator01UnregisterIfmgrMirrorRF cb; 00126 00127 public: 00128 operator const IfmgrReplicator01UnregisterIfmgrMirrorRF& () const { return cb; } 00129 const IfmgrReplicator01UnregisterIfmgrMirrorRF& operator ->() const { return cb; } 00130 IfmgrReplicator01UnregisterIfmgrMirrorCB(const IfmgrReplicator01UnregisterIfmgrMirrorRF& cb) 00131 : cb(cb) { } 00132 00133 void fail(const XrlCmdError &e) const { cb->dispatch(e); } 00134 00135 void respond() const { 00136 cb->dispatch(XrlCmdError::OKAY()); 00137 } 00138 }; 00139 00140 struct IfmgrReplicator01UnregisterIfmgrMirrorRsp : 00141 public IfmgrReplicator01UnregisterIfmgrMirrorCB { 00142 IfmgrReplicator01UnregisterIfmgrMirrorRsp(const IfmgrReplicator01UnregisterIfmgrMirrorRF& cb) 00143 : IfmgrReplicator01UnregisterIfmgrMirrorCB(cb) { } 00144 00145 }; 00146 00147 virtual void async_ifmgr_replicator_0_1_unregister_ifmgr_mirror 00148 ( 00149 const string& clientname, 00150 IfmgrReplicator01UnregisterIfmgrMirrorCB); 00151 #endif 00152 00153 private: 00154 XrlCmdRT handle_ifmgr_replicator_0_1_register_ifmgr_mirror(const XrlArgs& in, XrlCmdOT out); 00155 #ifdef XORP_ENABLE_ASYNC_SERVER 00156 void callback_ifmgr_replicator_0_1_register_ifmgr_mirror 00157 (const XrlCmdError &e, 00158 XrlRespCallback); 00159 #endif 00160 00161 XrlCmdRT handle_ifmgr_replicator_0_1_unregister_ifmgr_mirror(const XrlArgs& in, XrlCmdOT out); 00162 #ifdef XORP_ENABLE_ASYNC_SERVER 00163 void callback_ifmgr_replicator_0_1_unregister_ifmgr_mirror 00164 (const XrlCmdError &e, 00165 XrlRespCallback); 00166 #endif 00167 00168 void add_handlers(); 00169 void remove_handlers(); 00170 00171 struct handler_table { 00172 const char *name; 00173 XrlCmdRT (XrlTestFeaIfmgrMirrorTargetBase::*method)(const XrlArgs&, XrlCmdOT); 00174 }; 00175 00176 static const struct handler_table handlers[]; 00177 static const size_t num_handlers; 00178 }; 00179 00180 #endif // __XRL_TARGETS_TEST_FEA_IFMGR_MIRROR_BASE_HH__