xorp

test_xrls_base.hh

00001 /*
00002  * obj/i386-pc-mingw32/xrl/targets/test_xrls_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_XRLS_BASE_HH__
00016 #define __XRL_TARGETS_TEST_XRLS_BASE_HH__
00017 
00018 #undef XORP_LIBRARY_NAME
00019 #define XORP_LIBRARY_NAME "XrlTestXrlsTarget"
00020 
00021 #include "libxorp/xlog.h"
00022 #include "libxipc/xrl_cmd_map.hh"
00023 
00024 class XrlTestXrlsTargetBase {
00025 protected:
00026     XrlCmdMap* _cmds;
00027 
00028 public:
00036     XrlTestXrlsTargetBase(XrlCmdMap* cmds = 0);
00037 
00043     virtual ~XrlTestXrlsTargetBase();
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_xrls/0.0"; }
00066 
00067 protected:
00068 
00074     virtual XrlCmdError common_0_1_get_target_name(
00075     // Output values,
00076     string& name) = 0;
00077 #ifdef XORP_ENABLE_ASYNC_SERVER
00078     typedef
00079     XorpCallback2<void, const XrlCmdError &,
00080     const string*>::RefPtr
00081     Common01GetTargetNameRF;
00082 
00083     class Common01GetTargetNameCB {
00084         Common01GetTargetNameRF cb;
00085 
00086     public:
00087         operator const Common01GetTargetNameRF& () const { return cb; }
00088         const Common01GetTargetNameRF& operator ->() const { return cb; }
00089         Common01GetTargetNameCB(const Common01GetTargetNameRF& cb)
00090           : cb(cb) { }
00091 
00092         void fail(const XrlCmdError &e) const { cb->dispatch(e, NULL); }
00093 
00094         void respond(const string& arg_name) const {
00095             cb->dispatch(XrlCmdError::OKAY(),
00096                          &arg_name);
00097         }
00098     };
00099 
00100     struct Common01GetTargetNameRsp :
00101       public Common01GetTargetNameCB {
00102         struct args_str {
00103             string name;
00104         };
00105 
00106     private:
00107         args_str args;
00108 
00109     public:
00110         Common01GetTargetNameRsp(const Common01GetTargetNameRF& cb)
00111           : Common01GetTargetNameCB(cb) { }
00112 
00113         void respond() const {
00114             Common01GetTargetNameCB::
00115             respond(args.name);
00116         }
00117 
00118         args_str* operator ->() {
00119             return &args;
00120         }
00121     };
00122 
00123     virtual void async_common_0_1_get_target_name
00124        (
00125     Common01GetTargetNameCB);
00126 #endif
00127 
00133     virtual XrlCmdError common_0_1_get_version(
00134     // Output values,
00135     string& version) = 0;
00136 #ifdef XORP_ENABLE_ASYNC_SERVER
00137     typedef
00138     XorpCallback2<void, const XrlCmdError &,
00139     const string*>::RefPtr
00140     Common01GetVersionRF;
00141 
00142     class Common01GetVersionCB {
00143         Common01GetVersionRF cb;
00144 
00145     public:
00146         operator const Common01GetVersionRF& () const { return cb; }
00147         const Common01GetVersionRF& operator ->() const { return cb; }
00148         Common01GetVersionCB(const Common01GetVersionRF& cb)
00149           : cb(cb) { }
00150 
00151         void fail(const XrlCmdError &e) const { cb->dispatch(e, NULL); }
00152 
00153         void respond(const string& arg_version) const {
00154             cb->dispatch(XrlCmdError::OKAY(),
00155                          &arg_version);
00156         }
00157     };
00158 
00159     struct Common01GetVersionRsp :
00160       public Common01GetVersionCB {
00161         struct args_str {
00162             string version;
00163         };
00164 
00165     private:
00166         args_str args;
00167 
00168     public:
00169         Common01GetVersionRsp(const Common01GetVersionRF& cb)
00170           : Common01GetVersionCB(cb) { }
00171 
00172         void respond() const {
00173             Common01GetVersionCB::
00174             respond(args.version);
00175         }
00176 
00177         args_str* operator ->() {
00178             return &args;
00179         }
00180     };
00181 
00182     virtual void async_common_0_1_get_version
00183        (
00184     Common01GetVersionCB);
00185 #endif
00186 
00192     virtual XrlCmdError common_0_1_get_status(
00193     // Output values,
00194     uint32_t&   status,
00195     string& reason) = 0;
00196 #ifdef XORP_ENABLE_ASYNC_SERVER
00197     typedef
00198     XorpCallback3<void, const XrlCmdError &,
00199     const uint32_t*,
00200     const string*>::RefPtr
00201     Common01GetStatusRF;
00202 
00203     class Common01GetStatusCB {
00204         Common01GetStatusRF cb;
00205 
00206     public:
00207         operator const Common01GetStatusRF& () const { return cb; }
00208         const Common01GetStatusRF& operator ->() const { return cb; }
00209         Common01GetStatusCB(const Common01GetStatusRF& cb)
00210           : cb(cb) { }
00211 
00212         void fail(const XrlCmdError &e) const { cb->dispatch(e, NULL, NULL); }
00213 
00214         void respond(const uint32_t& arg_status,
00215                      const string& arg_reason) const {
00216             cb->dispatch(XrlCmdError::OKAY(),
00217                          &arg_status,
00218                          &arg_reason);
00219         }
00220     };
00221 
00222     struct Common01GetStatusRsp :
00223       public Common01GetStatusCB {
00224         struct args_str {
00225             uint32_t status;
00226             string reason;
00227         };
00228 
00229     private:
00230         args_str args;
00231 
00232     public:
00233         Common01GetStatusRsp(const Common01GetStatusRF& cb)
00234           : Common01GetStatusCB(cb) { }
00235 
00236         void respond() const {
00237             Common01GetStatusCB::
00238             respond(args.status,
00239                         args.reason);
00240         }
00241 
00242         args_str* operator ->() {
00243             return &args;
00244         }
00245     };
00246 
00247     virtual void async_common_0_1_get_status
00248        (
00249     Common01GetStatusCB);
00250 #endif
00251 
00257     virtual XrlCmdError common_0_1_shutdown() = 0;
00258 #ifdef XORP_ENABLE_ASYNC_SERVER
00259     typedef
00260     XorpCallback1<void, const XrlCmdError &>::RefPtr
00261     Common01ShutdownRF;
00262 
00263     class Common01ShutdownCB {
00264         Common01ShutdownRF cb;
00265 
00266     public:
00267         operator const Common01ShutdownRF& () const { return cb; }
00268         const Common01ShutdownRF& operator ->() const { return cb; }
00269         Common01ShutdownCB(const Common01ShutdownRF& cb)
00270           : cb(cb) { }
00271 
00272         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00273 
00274         void respond() const {
00275             cb->dispatch(XrlCmdError::OKAY());
00276         }
00277     };
00278 
00279     struct Common01ShutdownRsp :
00280       public Common01ShutdownCB {
00281         Common01ShutdownRsp(const Common01ShutdownRF& cb)
00282           : Common01ShutdownCB(cb) { }
00283 
00284     };
00285 
00286     virtual void async_common_0_1_shutdown
00287        (
00288     Common01ShutdownCB);
00289 #endif
00290 
00296     virtual XrlCmdError common_0_1_startup() = 0;
00297 #ifdef XORP_ENABLE_ASYNC_SERVER
00298     typedef
00299     XorpCallback1<void, const XrlCmdError &>::RefPtr
00300     Common01StartupRF;
00301 
00302     class Common01StartupCB {
00303         Common01StartupRF cb;
00304 
00305     public:
00306         operator const Common01StartupRF& () const { return cb; }
00307         const Common01StartupRF& operator ->() const { return cb; }
00308         Common01StartupCB(const Common01StartupRF& cb)
00309           : cb(cb) { }
00310 
00311         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00312 
00313         void respond() const {
00314             cb->dispatch(XrlCmdError::OKAY());
00315         }
00316     };
00317 
00318     struct Common01StartupRsp :
00319       public Common01StartupCB {
00320         Common01StartupRsp(const Common01StartupRF& cb)
00321           : Common01StartupCB(cb) { }
00322 
00323     };
00324 
00325     virtual void async_common_0_1_startup
00326        (
00327     Common01StartupCB);
00328 #endif
00329 
00330     virtual XrlCmdError test_xrls_0_1_start_transmission() = 0;
00331 #ifdef XORP_ENABLE_ASYNC_SERVER
00332     typedef
00333     XorpCallback1<void, const XrlCmdError &>::RefPtr
00334     TestXrls01StartTransmissionRF;
00335 
00336     class TestXrls01StartTransmissionCB {
00337         TestXrls01StartTransmissionRF cb;
00338 
00339     public:
00340         operator const TestXrls01StartTransmissionRF& () const { return cb; }
00341         const TestXrls01StartTransmissionRF& operator ->() const { return cb; }
00342         TestXrls01StartTransmissionCB(const TestXrls01StartTransmissionRF& cb)
00343           : cb(cb) { }
00344 
00345         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00346 
00347         void respond() const {
00348             cb->dispatch(XrlCmdError::OKAY());
00349         }
00350     };
00351 
00352     struct TestXrls01StartTransmissionRsp :
00353       public TestXrls01StartTransmissionCB {
00354         TestXrls01StartTransmissionRsp(const TestXrls01StartTransmissionRF& cb)
00355           : TestXrls01StartTransmissionCB(cb) { }
00356 
00357     };
00358 
00359     virtual void async_test_xrls_0_1_start_transmission
00360        (
00361     TestXrls01StartTransmissionCB);
00362 #endif
00363 
00364     virtual XrlCmdError test_xrls_0_1_end_transmission() = 0;
00365 #ifdef XORP_ENABLE_ASYNC_SERVER
00366     typedef
00367     XorpCallback1<void, const XrlCmdError &>::RefPtr
00368     TestXrls01EndTransmissionRF;
00369 
00370     class TestXrls01EndTransmissionCB {
00371         TestXrls01EndTransmissionRF cb;
00372 
00373     public:
00374         operator const TestXrls01EndTransmissionRF& () const { return cb; }
00375         const TestXrls01EndTransmissionRF& operator ->() const { return cb; }
00376         TestXrls01EndTransmissionCB(const TestXrls01EndTransmissionRF& cb)
00377           : cb(cb) { }
00378 
00379         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00380 
00381         void respond() const {
00382             cb->dispatch(XrlCmdError::OKAY());
00383         }
00384     };
00385 
00386     struct TestXrls01EndTransmissionRsp :
00387       public TestXrls01EndTransmissionCB {
00388         TestXrls01EndTransmissionRsp(const TestXrls01EndTransmissionRF& cb)
00389           : TestXrls01EndTransmissionCB(cb) { }
00390 
00391     };
00392 
00393     virtual void async_test_xrls_0_1_end_transmission
00394        (
00395     TestXrls01EndTransmissionCB);
00396 #endif
00397 
00398     virtual XrlCmdError test_xrls_0_1_add_xrl0() = 0;
00399 #ifdef XORP_ENABLE_ASYNC_SERVER
00400     typedef
00401     XorpCallback1<void, const XrlCmdError &>::RefPtr
00402     TestXrls01AddXrl0RF;
00403 
00404     class TestXrls01AddXrl0CB {
00405         TestXrls01AddXrl0RF cb;
00406 
00407     public:
00408         operator const TestXrls01AddXrl0RF& () const { return cb; }
00409         const TestXrls01AddXrl0RF& operator ->() const { return cb; }
00410         TestXrls01AddXrl0CB(const TestXrls01AddXrl0RF& cb)
00411           : cb(cb) { }
00412 
00413         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00414 
00415         void respond() const {
00416             cb->dispatch(XrlCmdError::OKAY());
00417         }
00418     };
00419 
00420     struct TestXrls01AddXrl0Rsp :
00421       public TestXrls01AddXrl0CB {
00422         TestXrls01AddXrl0Rsp(const TestXrls01AddXrl0RF& cb)
00423           : TestXrls01AddXrl0CB(cb) { }
00424 
00425     };
00426 
00427     virtual void async_test_xrls_0_1_add_xrl0
00428        (
00429     TestXrls01AddXrl0CB);
00430 #endif
00431 
00432     virtual XrlCmdError test_xrls_0_1_add_xrl1(
00433     // Input values,
00434     const string&   data1) = 0;
00435 #ifdef XORP_ENABLE_ASYNC_SERVER
00436     typedef
00437     XorpCallback1<void, const XrlCmdError &>::RefPtr
00438     TestXrls01AddXrl1RF;
00439 
00440     class TestXrls01AddXrl1CB {
00441         TestXrls01AddXrl1RF cb;
00442 
00443     public:
00444         operator const TestXrls01AddXrl1RF& () const { return cb; }
00445         const TestXrls01AddXrl1RF& operator ->() const { return cb; }
00446         TestXrls01AddXrl1CB(const TestXrls01AddXrl1RF& cb)
00447           : cb(cb) { }
00448 
00449         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00450 
00451         void respond() const {
00452             cb->dispatch(XrlCmdError::OKAY());
00453         }
00454     };
00455 
00456     struct TestXrls01AddXrl1Rsp :
00457       public TestXrls01AddXrl1CB {
00458         TestXrls01AddXrl1Rsp(const TestXrls01AddXrl1RF& cb)
00459           : TestXrls01AddXrl1CB(cb) { }
00460 
00461     };
00462 
00463     virtual void async_test_xrls_0_1_add_xrl1
00464        (
00465     const string&   data1,
00466     TestXrls01AddXrl1CB);
00467 #endif
00468 
00469     virtual XrlCmdError test_xrls_0_1_add_xrl2(
00470     // Input values,
00471     const string&   data1,
00472     const string&   data2) = 0;
00473 #ifdef XORP_ENABLE_ASYNC_SERVER
00474     typedef
00475     XorpCallback1<void, const XrlCmdError &>::RefPtr
00476     TestXrls01AddXrl2RF;
00477 
00478     class TestXrls01AddXrl2CB {
00479         TestXrls01AddXrl2RF cb;
00480 
00481     public:
00482         operator const TestXrls01AddXrl2RF& () const { return cb; }
00483         const TestXrls01AddXrl2RF& operator ->() const { return cb; }
00484         TestXrls01AddXrl2CB(const TestXrls01AddXrl2RF& cb)
00485           : cb(cb) { }
00486 
00487         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00488 
00489         void respond() const {
00490             cb->dispatch(XrlCmdError::OKAY());
00491         }
00492     };
00493 
00494     struct TestXrls01AddXrl2Rsp :
00495       public TestXrls01AddXrl2CB {
00496         TestXrls01AddXrl2Rsp(const TestXrls01AddXrl2RF& cb)
00497           : TestXrls01AddXrl2CB(cb) { }
00498 
00499     };
00500 
00501     virtual void async_test_xrls_0_1_add_xrl2
00502        (
00503     const string&   data1,
00504     const string&   data2,
00505     TestXrls01AddXrl2CB);
00506 #endif
00507 
00508     virtual XrlCmdError test_xrls_0_1_add_xrl9(
00509     // Input values,
00510     const bool& data1,
00511     const int32_t&  data2,
00512     const IPv4& data3,
00513     const IPv4Net&  data4,
00514     const IPv6& data5,
00515     const IPv6Net&  data6,
00516     const Mac&  data7,
00517     const string&   data8,
00518     const vector<uint8_t>&  data9) = 0;
00519 #ifdef XORP_ENABLE_ASYNC_SERVER
00520     typedef
00521     XorpCallback1<void, const XrlCmdError &>::RefPtr
00522     TestXrls01AddXrl9RF;
00523 
00524     class TestXrls01AddXrl9CB {
00525         TestXrls01AddXrl9RF cb;
00526 
00527     public:
00528         operator const TestXrls01AddXrl9RF& () const { return cb; }
00529         const TestXrls01AddXrl9RF& operator ->() const { return cb; }
00530         TestXrls01AddXrl9CB(const TestXrls01AddXrl9RF& cb)
00531           : cb(cb) { }
00532 
00533         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00534 
00535         void respond() const {
00536             cb->dispatch(XrlCmdError::OKAY());
00537         }
00538     };
00539 
00540     struct TestXrls01AddXrl9Rsp :
00541       public TestXrls01AddXrl9CB {
00542         TestXrls01AddXrl9Rsp(const TestXrls01AddXrl9RF& cb)
00543           : TestXrls01AddXrl9CB(cb) { }
00544 
00545     };
00546 
00547     virtual void async_test_xrls_0_1_add_xrl9
00548        (
00549     const bool& data1,
00550     const int32_t&  data2,
00551     const IPv4& data3,
00552     const IPv4Net&  data4,
00553     const IPv6& data5,
00554     const IPv6Net&  data6,
00555     const Mac&  data7,
00556     const string&   data8,
00557     const vector<uint8_t>&  data9,
00558     TestXrls01AddXrl9CB);
00559 #endif
00560 
00561     virtual XrlCmdError test_xrls_0_1_add_xrlx(
00562     // Input values,
00563     const XrlAtomList&  data) = 0;
00564 #ifdef XORP_ENABLE_ASYNC_SERVER
00565     typedef
00566     XorpCallback1<void, const XrlCmdError &>::RefPtr
00567     TestXrls01AddXrlxRF;
00568 
00569     class TestXrls01AddXrlxCB {
00570         TestXrls01AddXrlxRF cb;
00571 
00572     public:
00573         operator const TestXrls01AddXrlxRF& () const { return cb; }
00574         const TestXrls01AddXrlxRF& operator ->() const { return cb; }
00575         TestXrls01AddXrlxCB(const TestXrls01AddXrlxRF& cb)
00576           : cb(cb) { }
00577 
00578         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00579 
00580         void respond() const {
00581             cb->dispatch(XrlCmdError::OKAY());
00582         }
00583     };
00584 
00585     struct TestXrls01AddXrlxRsp :
00586       public TestXrls01AddXrlxCB {
00587         TestXrls01AddXrlxRsp(const TestXrls01AddXrlxRF& cb)
00588           : TestXrls01AddXrlxCB(cb) { }
00589 
00590     };
00591 
00592     virtual void async_test_xrls_0_1_add_xrlx
00593        (
00594     const XrlAtomList&  data,
00595     TestXrls01AddXrlxCB);
00596 #endif
00597 
00598 private:
00599     XrlCmdRT handle_common_0_1_get_target_name(const XrlArgs& in, XrlCmdOT out);
00600 #ifdef XORP_ENABLE_ASYNC_SERVER
00601     void callback_common_0_1_get_target_name
00602        (const XrlCmdError &e,
00603     const string* arg_name,
00604         XrlRespCallback);
00605 #endif
00606 
00607     XrlCmdRT handle_common_0_1_get_version(const XrlArgs& in, XrlCmdOT out);
00608 #ifdef XORP_ENABLE_ASYNC_SERVER
00609     void callback_common_0_1_get_version
00610        (const XrlCmdError &e,
00611     const string* arg_version,
00612         XrlRespCallback);
00613 #endif
00614 
00615     XrlCmdRT handle_common_0_1_get_status(const XrlArgs& in, XrlCmdOT out);
00616 #ifdef XORP_ENABLE_ASYNC_SERVER
00617     void callback_common_0_1_get_status
00618        (const XrlCmdError &e,
00619     const uint32_t* arg_status,
00620     const string* arg_reason,
00621         XrlRespCallback);
00622 #endif
00623 
00624     XrlCmdRT handle_common_0_1_shutdown(const XrlArgs& in, XrlCmdOT out);
00625 #ifdef XORP_ENABLE_ASYNC_SERVER
00626     void callback_common_0_1_shutdown
00627        (const XrlCmdError &e,
00628         XrlRespCallback);
00629 #endif
00630 
00631     XrlCmdRT handle_common_0_1_startup(const XrlArgs& in, XrlCmdOT out);
00632 #ifdef XORP_ENABLE_ASYNC_SERVER
00633     void callback_common_0_1_startup
00634        (const XrlCmdError &e,
00635         XrlRespCallback);
00636 #endif
00637 
00638     XrlCmdRT handle_test_xrls_0_1_start_transmission(const XrlArgs& in, XrlCmdOT out);
00639 #ifdef XORP_ENABLE_ASYNC_SERVER
00640     void callback_test_xrls_0_1_start_transmission
00641        (const XrlCmdError &e,
00642         XrlRespCallback);
00643 #endif
00644 
00645     XrlCmdRT handle_test_xrls_0_1_end_transmission(const XrlArgs& in, XrlCmdOT out);
00646 #ifdef XORP_ENABLE_ASYNC_SERVER
00647     void callback_test_xrls_0_1_end_transmission
00648        (const XrlCmdError &e,
00649         XrlRespCallback);
00650 #endif
00651 
00652     XrlCmdRT handle_test_xrls_0_1_add_xrl0(const XrlArgs& in, XrlCmdOT out);
00653 #ifdef XORP_ENABLE_ASYNC_SERVER
00654     void callback_test_xrls_0_1_add_xrl0
00655        (const XrlCmdError &e,
00656         XrlRespCallback);
00657 #endif
00658 
00659     XrlCmdRT handle_test_xrls_0_1_add_xrl1(const XrlArgs& in, XrlCmdOT out);
00660 #ifdef XORP_ENABLE_ASYNC_SERVER
00661     void callback_test_xrls_0_1_add_xrl1
00662        (const XrlCmdError &e,
00663         XrlRespCallback);
00664 #endif
00665 
00666     XrlCmdRT handle_test_xrls_0_1_add_xrl2(const XrlArgs& in, XrlCmdOT out);
00667 #ifdef XORP_ENABLE_ASYNC_SERVER
00668     void callback_test_xrls_0_1_add_xrl2
00669        (const XrlCmdError &e,
00670         XrlRespCallback);
00671 #endif
00672 
00673     XrlCmdRT handle_test_xrls_0_1_add_xrl9(const XrlArgs& in, XrlCmdOT out);
00674 #ifdef XORP_ENABLE_ASYNC_SERVER
00675     void callback_test_xrls_0_1_add_xrl9
00676        (const XrlCmdError &e,
00677         XrlRespCallback);
00678 #endif
00679 
00680     XrlCmdRT handle_test_xrls_0_1_add_xrlx(const XrlArgs& in, XrlCmdOT out);
00681 #ifdef XORP_ENABLE_ASYNC_SERVER
00682     void callback_test_xrls_0_1_add_xrlx
00683        (const XrlCmdError &e,
00684         XrlRespCallback);
00685 #endif
00686 
00687     void add_handlers();
00688     void remove_handlers();
00689 
00690     struct handler_table {
00691         const char *name;
00692         XrlCmdRT (XrlTestXrlsTargetBase::*method)(const XrlArgs&, XrlCmdOT);
00693     };
00694 
00695     static const struct handler_table handlers[];
00696     static const size_t num_handlers;
00697 };
00698 
00699 #endif // __XRL_TARGETS_TEST_XRLS_BASE_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations