xorp

datain_xif.hh

00001 /*
00002  * obj/i686-pc-linux-gnu/xrl/interfaces/datain_xif.hh
00003  * vim:set sts=4 ts=8 ft=cpp:
00004  *
00005  * Copyright (c) 2001-2010 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 'clnt-gen'.
00012  */
00013 
00014 #ifndef __XRL_INTERFACES_DATAIN_XIF_HH__
00015 #define __XRL_INTERFACES_DATAIN_XIF_HH__
00016 
00017 #undef XORP_LIBRARY_NAME
00018 #define XORP_LIBRARY_NAME "XifDatain"
00019 
00020 #include "libxorp/xlog.h"
00021 #include "libxorp/callback.hh"
00022 
00023 #include "libxipc/xrl.hh"
00024 #include "libxipc/xrl_error.hh"
00025 #include "libxipc/xrl_sender.hh"
00026 
00027 //#include <memory>
00028 
00029 class XrlDatainV0p1Client {
00030 public:
00031     XrlDatainV0p1Client(XrlSender* s) : _sender(s) {}
00032     virtual ~XrlDatainV0p1Client() {}
00033 
00034     typedef XorpCallback1<void, const XrlError&>::RefPtr ReceiveCB;
00035 
00036     bool send_receive(
00037     const char* dst_xrl_target_name,
00038     const string&   peer,
00039     const uint32_t& genid,
00040     const bool& status,
00041     const uint32_t& secs,
00042     const uint32_t& micro,
00043     const vector<uint8_t>&  data,
00044     const ReceiveCB&    cb
00045     );
00046 
00047     typedef XorpCallback1<void, const XrlError&>::RefPtr ErrorCB;
00048 
00049     bool send_error(
00050     const char* dst_xrl_target_name,
00051     const string&   peer,
00052     const uint32_t& genid,
00053     const string&   reason,
00054     const ErrorCB&  cb
00055     );
00056 
00057     typedef XorpCallback1<void, const XrlError&>::RefPtr ClosedCB;
00058 
00059     bool send_closed(
00060     const char* dst_xrl_target_name,
00061     const string&   peer,
00062     const uint32_t& genid,
00063     const ClosedCB& cb
00064     );
00065 
00066 protected:
00067     XrlSender* _sender;
00068 
00069 private:
00070     static void unmarshall_receive(
00071     const XrlError& e,
00072     XrlArgs*    a,
00073     ReceiveCB       cb
00074     );
00075 
00076     static void unmarshall_error(
00077     const XrlError& e,
00078     XrlArgs*    a,
00079     ErrorCB     cb
00080     );
00081 
00082     static void unmarshall_closed(
00083     const XrlError& e,
00084     XrlArgs*    a,
00085     ClosedCB        cb
00086     );
00087 
00088 private:
00089     /* Declare cached Xrl pointers */
00090     auto_ptr<Xrl> ap_xrl_receive;
00091     auto_ptr<Xrl> ap_xrl_error;
00092     auto_ptr<Xrl> ap_xrl_closed;
00093 };
00094 
00095 #endif /* __XRL_INTERFACES_DATAIN_XIF_HH__ */
 All Classes Namespaces Functions Variables Typedefs Enumerations