Back to index

im-sdk  12.3.91
IIIMPTrans.hh
Go to the documentation of this file.
00001 #ifndef IIIMPTRANS_HH_
00002 #define IIIMPTRANS_HH_
00003 #include <string>
00004 #include <iiimp.h>
00005 #include "basictype.hh"
00006 #include "IMUtil.hh"
00007 
00008 extern "C" IIIMF_status IIIMPTrans_read(
00009     IIIMF_stream_private ptrans,
00010     void *buf,
00011     size_t nbyte
00012 );
00013 extern "C" IIIMF_status IIIMPTrans_write(
00014     IIIMF_stream_private ptrans,
00015     const void* buf,
00016     size_t nbyte
00017 );
00018 class IIIMPTrans {
00019     bool open;
00020     IMSocketTrans *pimst;
00021     IIIMP_data_s *pimplibstate;
00022     IIIMF_stream *pstream;
00023 
00024   private:
00025     // inhibit duplication.
00026     IIIMPTrans(const IIIMPTrans&);
00027     IIIMPTrans& operator=(const IIIMPTrans& a);
00028 
00029   public:
00030     IIIMPTrans(IMSocketTrans *pimst);
00031     ~IIIMPTrans();
00032     bool send(IIIMP_message *pmes);
00033     IIIMP_message* receive();
00034 
00035     bool open_p()
00036     { return open; }
00037 
00038     IIIMP_data_s* get_data_s()
00039     { return pimplibstate; }
00040     int get_fd() const
00041     { return pimst->get_fd(); }
00042 
00043   friend IIIMF_status IIIMPTrans_read(IIIMF_stream_private, void*, size_t);
00044   friend IIIMF_status IIIMPTrans_write(IIIMF_stream_private, const void*, size_t);
00045 };
00046 
00047 #endif /* not IIIMPTRANS_HH_ */
00048 
00049 /* Local Variables: */
00050 /* c-file-style: "iiim-project" */
00051 /* End: */