Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE.i

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 // $Id: ACE.i,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00003 
00004 // Wrappers for methods that have been moved to ACE_OS.
00005 
00006 ASYS_INLINE ssize_t
00007 ACE::read_n (ACE_HANDLE handle,
00008              void *buf,
00009              size_t len,
00010              size_t *bytes_transferred)
00011 {
00012   return ACE_OS::read_n (handle,
00013                          buf,
00014                          len,
00015                          bytes_transferred);
00016 }
00017 
00018 ASYS_INLINE ssize_t
00019 ACE::write_n (ACE_HANDLE handle,
00020               const void *buf,
00021               size_t len,
00022               size_t *bytes_transferred)
00023 {
00024   return ACE_OS::write_n (handle,
00025                           buf,
00026                           len,
00027                           bytes_transferred);
00028 }
00029 
00030 ASYS_INLINE ssize_t
00031 ACE::recv_n (ACE_HANDLE handle,
00032              void *buf,
00033              size_t len,
00034              int flags,
00035              const ACE_Time_Value *timeout,
00036              size_t *bytes_transferred)
00037 {
00038   if (timeout == 0)
00039     return ACE::recv_n_i (handle,
00040                           buf,
00041                           len,
00042                           flags,
00043                           bytes_transferred);
00044   else
00045     return ACE::recv_n_i (handle,
00046                           buf,
00047                           len,
00048                           flags,
00049                           timeout,
00050                           bytes_transferred);
00051 }
00052 
00053 #if defined (ACE_HAS_TLI)
00054 
00055 ASYS_INLINE ssize_t
00056 ACE::t_rcv_n (ACE_HANDLE handle,
00057               void *buf,
00058               size_t len,
00059               int *flags,
00060               const ACE_Time_Value *timeout,
00061               size_t *bytes_transferred)
00062 {
00063   if (timeout == 0)
00064     return ACE::t_rcv_n_i (handle,
00065                            buf,
00066                            len,
00067                            flags,
00068                            bytes_transferred);
00069   else
00070     return ACE::t_rcv_n_i (handle,
00071                            buf,
00072                            len,
00073                            flags,
00074                            timeout,
00075                            bytes_transferred);
00076 }
00077 
00078 #endif /* ACE_HAS_TLI */
00079 
00080 ASYS_INLINE ssize_t
00081 ACE::recv_n (ACE_HANDLE handle,
00082              void *buf,
00083              size_t len,
00084              const ACE_Time_Value *timeout,
00085              size_t *bytes_transferred)
00086 {
00087   if (timeout == 0)
00088     return ACE::recv_n_i (handle,
00089                           buf,
00090                           len,
00091                           bytes_transferred);
00092   else
00093     return ACE::recv_n_i (handle,
00094                           buf,
00095                           len,
00096                           timeout,
00097                           bytes_transferred);
00098 }
00099 
00100 ASYS_INLINE ssize_t
00101 ACE::recvv_n (ACE_HANDLE handle,
00102               iovec *iov,
00103               int iovcnt,
00104               const ACE_Time_Value *timeout,
00105               size_t *bytes_transferred)
00106 {
00107   if (timeout == 0)
00108     return ACE::recvv_n_i (handle,
00109                            iov,
00110                            iovcnt,
00111                            bytes_transferred);
00112   else
00113     return ACE::recvv_n_i (handle,
00114                            iov,
00115                            iovcnt,
00116                            timeout,
00117                            bytes_transferred);
00118 }
00119 
00120 ASYS_INLINE ssize_t
00121 ACE::send_n (ACE_HANDLE handle,
00122              const void *buf,
00123              size_t len,
00124              int flags,
00125              const ACE_Time_Value *timeout,
00126              size_t *bytes_transferred)
00127 {
00128   if (timeout == 0)
00129     return ACE::send_n_i (handle,
00130                           buf,
00131                           len,
00132                           flags,
00133                           bytes_transferred);
00134   else
00135     return ACE::send_n_i (handle,
00136                           buf,
00137                           len,
00138                           flags,
00139                           timeout,
00140                           bytes_transferred);
00141 }
00142 
00143 #if defined (ACE_HAS_TLI)
00144 
00145 ASYS_INLINE ssize_t
00146 ACE::t_snd_n (ACE_HANDLE handle,
00147               const void *buf,
00148               size_t len,
00149               int flags,
00150               const ACE_Time_Value *timeout,
00151               size_t *bytes_transferred)
00152 {
00153   if (timeout == 0)
00154     return ACE::t_snd_n_i (handle,
00155                            buf,
00156                            len,
00157                            flags,
00158                            bytes_transferred);
00159   else
00160     return ACE::t_snd_n_i (handle,
00161                            buf,
00162                            len,
00163                            flags,
00164                            timeout,
00165                            bytes_transferred);
00166 }
00167 
00168 #endif /* ACE_HAS_TLI */
00169 
00170 ASYS_INLINE ssize_t
00171 ACE::send_n (ACE_HANDLE handle,
00172              const void *buf,
00173              size_t len,
00174              const ACE_Time_Value *timeout,
00175              size_t *bytes_transferred)
00176 {
00177   if (timeout == 0)
00178     return ACE::send_n_i (handle,
00179                           buf,
00180                           len,
00181                           bytes_transferred);
00182   else
00183     return ACE::send_n_i (handle,
00184                           buf,
00185                           len,
00186                           timeout,
00187                           bytes_transferred);
00188 }
00189 
00190 ASYS_INLINE ssize_t
00191 ACE::sendv_n (ACE_HANDLE handle,
00192               const iovec *iov,
00193               int iovcnt,
00194               const ACE_Time_Value *timeout,
00195               size_t *bytes_transferred)
00196 {
00197   if (timeout == 0)
00198     return ACE::sendv_n_i (handle,
00199                            iov,
00200                            iovcnt,
00201                            bytes_transferred);
00202   else
00203     return ACE::sendv_n_i (handle,
00204                            iov,
00205                            iovcnt,
00206                            timeout,
00207                            bytes_transferred);
00208 }
00209 
00210 ASYS_INLINE ssize_t
00211 ACE::send_i (ACE_HANDLE handle, const void *buf, size_t len)
00212 {
00213 #if defined (ACE_WIN32) || defined (ACE_PSOS) || defined (HPUX)
00214   return ACE_OS::send (handle, (const char *) buf, len);
00215 #else
00216   return ACE_OS::write (handle, (const char *) buf, len);
00217 #endif /* ACE_WIN32 */
00218 }
00219 
00220 ASYS_INLINE ssize_t
00221 ACE::recv_i (ACE_HANDLE handle, void *buf, size_t len)
00222 {
00223 #if defined (ACE_WIN32) || defined (ACE_PSOS)
00224   return ACE_OS::recv (handle, (char *) buf, len);
00225 #else
00226   return ACE_OS::read (handle, (char *) buf, len);
00227 #endif /* ACE_WIN32 */
00228 }
00229 
00230 ASYS_INLINE int
00231 ACE::handle_read_ready (ACE_HANDLE handle,
00232                         const ACE_Time_Value *timeout)
00233 {
00234   return ACE::handle_ready (handle,
00235                             timeout,
00236                             1,
00237                             0,
00238                             0);
00239 }
00240 
00241 ASYS_INLINE int
00242 ACE::handle_write_ready (ACE_HANDLE handle,
00243                          const ACE_Time_Value *timeout)
00244 {
00245   return ACE::handle_ready (handle,
00246                             timeout,
00247                             0,
00248                             1,
00249                             0);
00250 }
00251 
00252 ASYS_INLINE int
00253 ACE::handle_exception_ready (ACE_HANDLE handle,
00254                              const ACE_Time_Value *timeout)
00255 {
00256   return ACE::handle_ready (handle,
00257                             timeout,
00258                             0,
00259                             0,
00260                             1);
00261 }
00262 
00263 ASYS_INLINE void
00264 ACE::unique_name (const void *object,
00265                   ACE_TCHAR *name,
00266                   size_t length)
00267 {
00268   ACE_OS::unique_name (object, name, length);
00269 }
00270 
00271 ASYS_INLINE u_long
00272 ACE::log2 (u_long num)
00273 {
00274   u_long log = 0;
00275 
00276   for (;
00277        num > 0;
00278        log++)
00279     num >>= 1;
00280 
00281   return log;
00282 }
00283 
00284 ASYS_INLINE ACE_TCHAR
00285 ACE::nibble2hex (u_int n)
00286 {
00287   // @@ UNICODE does this work?
00288   return ACE::hex_chars_[n & 0x0f];
00289 }
00290 
00291 ASYS_INLINE u_char
00292 ACE::hex2byte (ACE_TCHAR c)
00293 {
00294   if (isdigit (c))
00295     return (u_char) (c - ACE_LIB_TEXT ('0'));
00296   else if (islower (c))
00297     return (u_char) (10 + c - ACE_LIB_TEXT ('a'));
00298   else
00299     return (u_char) (10 + c - ACE_LIB_TEXT ('A'));
00300 }
00301 
00302 ASYS_INLINE char
00303 ACE::debug (void)
00304 {
00305   return ACE::debug_;
00306 }
00307 
00308 ASYS_INLINE void
00309 ACE::debug (char c)
00310 {
00311   ACE::debug_ = c;
00312 }

Generated on Mon Jun 16 11:19:02 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002