xorp

finder_client_base.hh

00001 /*
00002  * obj/i386-pc-mingw32/xrl/targets/finder_client_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_FINDER_CLIENT_BASE_HH__
00016 #define __XRL_TARGETS_FINDER_CLIENT_BASE_HH__
00017 
00018 #undef XORP_LIBRARY_NAME
00019 #define XORP_LIBRARY_NAME "XrlFinderClientTarget"
00020 
00021 #include "libxorp/xlog.h"
00022 #include "libxipc/xrl_cmd_map.hh"
00023 
00024 class XrlFinderclientTargetBase {
00025 protected:
00026     XrlCmdMap* _cmds;
00027 
00028 public:
00036     XrlFinderclientTargetBase(XrlCmdMap* cmds = 0);
00037 
00043     virtual ~XrlFinderclientTargetBase();
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 "finderclient/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 
00335     virtual XrlCmdError finder_client_0_2_hello() = 0;
00336 #ifdef XORP_ENABLE_ASYNC_SERVER
00337     typedef
00338     XorpCallback1<void, const XrlCmdError &>::RefPtr
00339     FinderClient02HelloRF;
00340 
00341     class FinderClient02HelloCB {
00342         FinderClient02HelloRF cb;
00343 
00344     public:
00345         operator const FinderClient02HelloRF& () const { return cb; }
00346         const FinderClient02HelloRF& operator ->() const { return cb; }
00347         FinderClient02HelloCB(const FinderClient02HelloRF& cb)
00348           : cb(cb) { }
00349 
00350         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00351 
00352         void respond() const {
00353             cb->dispatch(XrlCmdError::OKAY());
00354         }
00355     };
00356 
00357     struct FinderClient02HelloRsp :
00358       public FinderClient02HelloCB {
00359         FinderClient02HelloRsp(const FinderClient02HelloRF& cb)
00360           : FinderClient02HelloCB(cb) { }
00361 
00362     };
00363 
00364     virtual void async_finder_client_0_2_hello
00365        (
00366     FinderClient02HelloCB);
00367 #endif
00368 
00377     virtual XrlCmdError finder_client_0_2_remove_xrl_from_cache(
00378     // Input values,
00379     const string&   xrl) = 0;
00380 #ifdef XORP_ENABLE_ASYNC_SERVER
00381     typedef
00382     XorpCallback1<void, const XrlCmdError &>::RefPtr
00383     FinderClient02RemoveXrlFromCacheRF;
00384 
00385     class FinderClient02RemoveXrlFromCacheCB {
00386         FinderClient02RemoveXrlFromCacheRF cb;
00387 
00388     public:
00389         operator const FinderClient02RemoveXrlFromCacheRF& () const { return cb; }
00390         const FinderClient02RemoveXrlFromCacheRF& operator ->() const { return cb; }
00391         FinderClient02RemoveXrlFromCacheCB(const FinderClient02RemoveXrlFromCacheRF& cb)
00392           : cb(cb) { }
00393 
00394         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00395 
00396         void respond() const {
00397             cb->dispatch(XrlCmdError::OKAY());
00398         }
00399     };
00400 
00401     struct FinderClient02RemoveXrlFromCacheRsp :
00402       public FinderClient02RemoveXrlFromCacheCB {
00403         FinderClient02RemoveXrlFromCacheRsp(const FinderClient02RemoveXrlFromCacheRF& cb)
00404           : FinderClient02RemoveXrlFromCacheCB(cb) { }
00405 
00406     };
00407 
00408     virtual void async_finder_client_0_2_remove_xrl_from_cache
00409        (
00410     const string&   xrl,
00411     FinderClient02RemoveXrlFromCacheCB);
00412 #endif
00413 
00419     virtual XrlCmdError finder_client_0_2_remove_xrls_for_target_from_cache(
00420     // Input values,
00421     const string&   target_name) = 0;
00422 #ifdef XORP_ENABLE_ASYNC_SERVER
00423     typedef
00424     XorpCallback1<void, const XrlCmdError &>::RefPtr
00425     FinderClient02RemoveXrlsForTargetFromCacheRF;
00426 
00427     class FinderClient02RemoveXrlsForTargetFromCacheCB {
00428         FinderClient02RemoveXrlsForTargetFromCacheRF cb;
00429 
00430     public:
00431         operator const FinderClient02RemoveXrlsForTargetFromCacheRF& () const { return cb; }
00432         const FinderClient02RemoveXrlsForTargetFromCacheRF& operator ->() const { return cb; }
00433         FinderClient02RemoveXrlsForTargetFromCacheCB(const FinderClient02RemoveXrlsForTargetFromCacheRF& cb)
00434           : cb(cb) { }
00435 
00436         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00437 
00438         void respond() const {
00439             cb->dispatch(XrlCmdError::OKAY());
00440         }
00441     };
00442 
00443     struct FinderClient02RemoveXrlsForTargetFromCacheRsp :
00444       public FinderClient02RemoveXrlsForTargetFromCacheCB {
00445         FinderClient02RemoveXrlsForTargetFromCacheRsp(const FinderClient02RemoveXrlsForTargetFromCacheRF& cb)
00446           : FinderClient02RemoveXrlsForTargetFromCacheCB(cb) { }
00447 
00448     };
00449 
00450     virtual void async_finder_client_0_2_remove_xrls_for_target_from_cache
00451        (
00452     const string&   target_name,
00453     FinderClient02RemoveXrlsForTargetFromCacheCB);
00454 #endif
00455 
00462     virtual XrlCmdError finder_client_0_2_dispatch_tunneled_xrl(
00463     // Input values,
00464     const string&   xrl,
00465     // Output values,
00466     uint32_t&   xrl_error,
00467     string& xrl_error_note) = 0;
00468 #ifdef XORP_ENABLE_ASYNC_SERVER
00469     typedef
00470     XorpCallback3<void, const XrlCmdError &,
00471     const uint32_t*,
00472     const string*>::RefPtr
00473     FinderClient02DispatchTunneledXrlRF;
00474 
00475     class FinderClient02DispatchTunneledXrlCB {
00476         FinderClient02DispatchTunneledXrlRF cb;
00477 
00478     public:
00479         operator const FinderClient02DispatchTunneledXrlRF& () const { return cb; }
00480         const FinderClient02DispatchTunneledXrlRF& operator ->() const { return cb; }
00481         FinderClient02DispatchTunneledXrlCB(const FinderClient02DispatchTunneledXrlRF& cb)
00482           : cb(cb) { }
00483 
00484         void fail(const XrlCmdError &e) const { cb->dispatch(e, NULL, NULL); }
00485 
00486         void respond(const uint32_t& arg_xrl_error,
00487                      const string& arg_xrl_error_note) const {
00488             cb->dispatch(XrlCmdError::OKAY(),
00489                          &arg_xrl_error,
00490                          &arg_xrl_error_note);
00491         }
00492     };
00493 
00494     struct FinderClient02DispatchTunneledXrlRsp :
00495       public FinderClient02DispatchTunneledXrlCB {
00496         struct args_str {
00497             uint32_t xrl_error;
00498             string xrl_error_note;
00499         };
00500 
00501     private:
00502         args_str args;
00503 
00504     public:
00505         FinderClient02DispatchTunneledXrlRsp(const FinderClient02DispatchTunneledXrlRF& cb)
00506           : FinderClient02DispatchTunneledXrlCB(cb) { }
00507 
00508         void respond() const {
00509             FinderClient02DispatchTunneledXrlCB::
00510             respond(args.xrl_error,
00511                         args.xrl_error_note);
00512         }
00513 
00514         args_str* operator ->() {
00515             return &args;
00516         }
00517     };
00518 
00519     virtual void async_finder_client_0_2_dispatch_tunneled_xrl
00520        (
00521     const string&   xrl,
00522     FinderClient02DispatchTunneledXrlCB);
00523 #endif
00524 
00525 private:
00526     XrlCmdRT handle_common_0_1_get_target_name(const XrlArgs& in, XrlCmdOT out);
00527 #ifdef XORP_ENABLE_ASYNC_SERVER
00528     void callback_common_0_1_get_target_name
00529        (const XrlCmdError &e,
00530     const string* arg_name,
00531         XrlRespCallback);
00532 #endif
00533 
00534     XrlCmdRT handle_common_0_1_get_version(const XrlArgs& in, XrlCmdOT out);
00535 #ifdef XORP_ENABLE_ASYNC_SERVER
00536     void callback_common_0_1_get_version
00537        (const XrlCmdError &e,
00538     const string* arg_version,
00539         XrlRespCallback);
00540 #endif
00541 
00542     XrlCmdRT handle_common_0_1_get_status(const XrlArgs& in, XrlCmdOT out);
00543 #ifdef XORP_ENABLE_ASYNC_SERVER
00544     void callback_common_0_1_get_status
00545        (const XrlCmdError &e,
00546     const uint32_t* arg_status,
00547     const string* arg_reason,
00548         XrlRespCallback);
00549 #endif
00550 
00551     XrlCmdRT handle_common_0_1_shutdown(const XrlArgs& in, XrlCmdOT out);
00552 #ifdef XORP_ENABLE_ASYNC_SERVER
00553     void callback_common_0_1_shutdown
00554        (const XrlCmdError &e,
00555         XrlRespCallback);
00556 #endif
00557 
00558     XrlCmdRT handle_common_0_1_startup(const XrlArgs& in, XrlCmdOT out);
00559 #ifdef XORP_ENABLE_ASYNC_SERVER
00560     void callback_common_0_1_startup
00561        (const XrlCmdError &e,
00562         XrlRespCallback);
00563 #endif
00564 
00565     XrlCmdRT handle_finder_client_0_2_hello(const XrlArgs& in, XrlCmdOT out);
00566 #ifdef XORP_ENABLE_ASYNC_SERVER
00567     void callback_finder_client_0_2_hello
00568        (const XrlCmdError &e,
00569         XrlRespCallback);
00570 #endif
00571 
00572     XrlCmdRT handle_finder_client_0_2_remove_xrl_from_cache(const XrlArgs& in, XrlCmdOT out);
00573 #ifdef XORP_ENABLE_ASYNC_SERVER
00574     void callback_finder_client_0_2_remove_xrl_from_cache
00575        (const XrlCmdError &e,
00576         XrlRespCallback);
00577 #endif
00578 
00579     XrlCmdRT handle_finder_client_0_2_remove_xrls_for_target_from_cache(const XrlArgs& in, XrlCmdOT out);
00580 #ifdef XORP_ENABLE_ASYNC_SERVER
00581     void callback_finder_client_0_2_remove_xrls_for_target_from_cache
00582        (const XrlCmdError &e,
00583         XrlRespCallback);
00584 #endif
00585 
00586     XrlCmdRT handle_finder_client_0_2_dispatch_tunneled_xrl(const XrlArgs& in, XrlCmdOT out);
00587 #ifdef XORP_ENABLE_ASYNC_SERVER
00588     void callback_finder_client_0_2_dispatch_tunneled_xrl
00589        (const XrlCmdError &e,
00590     const uint32_t* arg_xrl_error,
00591     const string* arg_xrl_error_note,
00592         XrlRespCallback);
00593 #endif
00594 
00595     void add_handlers();
00596     void remove_handlers();
00597 
00598     struct handler_table {
00599         const char *name;
00600         XrlCmdRT (XrlFinderclientTargetBase::*method)(const XrlArgs&, XrlCmdOT);
00601     };
00602 
00603     static const struct handler_table handlers[];
00604     static const size_t num_handlers;
00605 };
00606 
00607 #endif // __XRL_TARGETS_FINDER_CLIENT_BASE_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations