FILE_IO.inl

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // FILE_IO.inl,v 4.3 2005/10/28 16:14:52 ossama Exp
00004 
00005 #include "ace/ACE.h"
00006 #include "ace/OS_NS_sys_uio.h"
00007 #include "ace/OS_NS_unistd.h"
00008 
00009 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00010 
00011 ACE_INLINE ssize_t
00012 ACE_FILE_IO::sendv_n (const iovec iov[], int n) const
00013 {
00014   ACE_TRACE ("ACE_FILE_IO::sendv_n");
00015   return ACE::writev_n (this->get_handle (),
00016                         iov,
00017                         n);
00018 }
00019 
00020 ACE_INLINE ssize_t
00021 ACE_FILE_IO::send_n (const ACE_Message_Block *message_block,
00022                      const ACE_Time_Value *timeout,
00023                      size_t *bytes_transferred)
00024 {
00025   ACE_TRACE ("ACE_FILE_IO::send_n");
00026   ACE_UNUSED_ARG (timeout);
00027   return ACE::write_n (this->get_handle (),
00028                       message_block,
00029                       bytes_transferred);
00030 }
00031 
00032 // Recv an n byte message from the file.
00033 
00034 ACE_INLINE ssize_t
00035 ACE_FILE_IO::recvv_n (iovec iov[], int n) const
00036 {
00037   ACE_TRACE ("ACE_FILE_IO::recvv_n");
00038   // @@ Carlos, can you please update this to call the
00039   // new ACE::recvv_n() method that you write?
00040   return ACE_OS::readv (this->get_handle (),
00041                         iov,
00042                         n);
00043 }
00044 
00045 // Send an <iovec> of size <n> to the file.
00046 
00047 ACE_INLINE ssize_t
00048 ACE_FILE_IO::sendv (const iovec iov[], int n) const
00049 {
00050   ACE_TRACE ("ACE_FILE_IO::sendv");
00051   return ACE_OS::writev (this->get_handle (), iov, n);
00052 }
00053 
00054 // Send exactly N bytes from BUF to this file.  Keeping trying until
00055 // this many bytes are sent.
00056 
00057 ACE_INLINE ssize_t
00058 ACE_FILE_IO::send_n (const void *buf, size_t n) const
00059 {
00060   ACE_TRACE ("ACE_FILE_IO::send_n");
00061   return ACE::write_n (this->get_handle (), buf, n);
00062 }
00063 
00064 // Receive exactly N bytes from this file into BUF.  Keep trying until
00065 // this many bytes are received.
00066 
00067 ACE_INLINE ssize_t
00068 ACE_FILE_IO::recv_n (void *buf, size_t n) const
00069 {
00070   ACE_TRACE ("ACE_FILE_IO::recv_n");
00071   return ACE::read_n (this->get_handle (), buf, n);
00072 }
00073 
00074 ACE_INLINE ssize_t
00075 ACE_FILE_IO::send (const void *buf, size_t n) const
00076 {
00077   ACE_TRACE ("ACE_FILE_IO::send");
00078   return ACE_OS::write (this->get_handle (), buf, n);
00079 }
00080 
00081 ACE_INLINE ssize_t
00082 ACE_FILE_IO::recv (void *buf, size_t n) const
00083 {
00084   ACE_TRACE ("ACE_FILE_IO::recv");
00085   return ACE_OS::read (this->get_handle (), buf, n);
00086 }
00087 
00088 ACE_INLINE ssize_t
00089 ACE_FILE_IO::send (const iovec iov[], int n) const
00090 {
00091   ACE_TRACE ("ACE_FILE_IO::send");
00092   return ACE_OS::writev (this->get_handle (), iov, n);
00093 }
00094 
00095 ACE_INLINE ssize_t
00096 ACE_FILE_IO::recv (iovec iov[], int n) const
00097 {
00098   ACE_TRACE ("ACE_FILE_IO::recv");
00099   return ACE_OS::readv (this->get_handle (), iov, n);
00100 }
00101 
00102 #if defined (ACE_HAS_STREAM_PIPES)
00103 ACE_INLINE ssize_t
00104 ACE_FILE_IO::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *band, int *flags) const
00105 {
00106   ACE_TRACE ("ACE_FILE_IO::recv");
00107   return ACE_OS::getpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags);
00108 }
00109 
00110 ACE_INLINE ssize_t
00111 ACE_FILE_IO::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int band, int flags) const
00112 {
00113   ACE_TRACE ("ACE_FILE_IO::send");
00114   return ACE_OS::putpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags);
00115 }
00116 
00117 ACE_INLINE ssize_t
00118 ACE_FILE_IO::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *flags) const
00119 {
00120   ACE_TRACE ("ACE_FILE_IO::recv");
00121   return ACE_OS::getmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags);
00122 }
00123 
00124 ACE_INLINE ssize_t
00125 ACE_FILE_IO::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int flags) const
00126 {
00127   ACE_TRACE ("ACE_FILE_IO::send");
00128   return ACE_OS::putmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags);
00129 }
00130 
00131 ACE_INLINE ssize_t
00132 ACE_FILE_IO::send (const void *buf, size_t n,
00133                    ACE_OVERLAPPED *overlapped) const
00134 {
00135   ACE_TRACE ("ACE_FILE_IO::send");
00136   return ACE_OS::write (this->get_handle (),
00137                         buf, n,
00138                         overlapped);
00139 }
00140 
00141 ACE_INLINE ssize_t
00142 ACE_FILE_IO::recv (void *buf, size_t n,
00143                    ACE_OVERLAPPED *overlapped) const
00144 {
00145   ACE_TRACE ("ACE_FILE_IO::recv");
00146   return ACE_OS::read (this->get_handle (), buf, n,
00147                        overlapped);
00148 }
00149 
00150 #endif /* ACE_HAS_STREAM_PIPES */
00151 
00152 ACE_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 09:41:51 2006 for ACE by doxygen 1.3.6