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

DEV_IO.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    DEV_IO.h
00006  *
00007  *  $Id: DEV_IO.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Gerhard Lenzer
00010  *  @author Douglas C. Schmidt
00011  */
00012 //=============================================================================
00013 
00014 
00015 #ifndef ACE_DEV_IO_H
00016 #define ACE_DEV_IO_H
00017 #include "ace/pre.h"
00018 
00019 #include "ace/DEV.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif /* ACE_LACKS_PRAGMA_ONCE */
00024 
00025 #include "ace/ACE.h"
00026 
00027 
00028 /**
00029  * @class ACE_DEV_IO
00030  *
00031  * @brief Read/Write operations on Devices.
00032  */
00033 class ACE_Export ACE_DEV_IO : public ACE_DEV
00034 {
00035 public:
00036   friend class ACE_DEV_Connector;
00037 
00038   /// Default constructor.
00039   ACE_DEV_IO (void);
00040 
00041   // = Various send operations.
00042   /// send upto <n> bytes in <buf>.
00043   ssize_t send (const void *buf, size_t n) const;
00044 
00045   /// Recv upto <n> bytes in <buf>.
00046   ssize_t recv (void *buf, size_t n) const;
00047 
00048   /// Send n bytes, keep trying until n are sent.
00049   ssize_t send_n (const void *buf, size_t n) const;
00050 
00051   /// Recv n bytes, keep trying until n are received.
00052   ssize_t recv_n (void *buf, size_t n) const;
00053 
00054 #if defined (ACE_HAS_STREAM_PIPES)
00055   /// Recv bytes via STREAM pipes using "band" mode.
00056   ssize_t recv (ACE_Str_Buf *cntl,
00057                 ACE_Str_Buf *data,
00058                 int *band,
00059                 int *flags) const;
00060 
00061   /// Send bytes via STREAM pipes using "band" mode.
00062   ssize_t send (const ACE_Str_Buf *cntl,
00063                 const ACE_Str_Buf *data,
00064                 int band,
00065                 int flags) const;
00066 
00067   /// Recv <cntl> and <data> via STREAM pipes.
00068   ssize_t recv (ACE_Str_Buf *cntl,
00069                 ACE_Str_Buf *data,
00070                 int *flags) const;
00071 
00072   /// Send <cntl> and <data> via STREAM pipes.
00073   ssize_t send (const ACE_Str_Buf *cntl,
00074                 const ACE_Str_Buf *data,
00075                 int flags = 0) const;
00076 #endif /* ACE_HAS_STREAM_PIPES */
00077 
00078   /// Send iovecs via <::writev>.
00079   ssize_t send (const iovec iov[], size_t n) const;
00080 
00081   /// Recv iovecs via <::readv>.
00082   ssize_t recv (iovec iov[], size_t n) const;
00083 
00084   /**
00085    * Send N char *ptrs and int lengths.  Note that the char *'s
00086    * precede the ints (basically, an varargs version of writev).  The
00087    * count N is the *total* number of trailing arguments, *not* a
00088    * couple of the number of tuple pairs!
00089    */
00090   ssize_t send (size_t n, ...) const;
00091 
00092   /**
00093    * This is an interface to ::readv, that doesn't use the struct
00094    * iovec explicitly.  The ... can be passed as an arbitrary number
00095    * of (char *ptr, int len) tuples.  However, the count N is the
00096    * *total* number of trailing arguments, *not* a couple of the
00097    * number of tuple pairs!
00098    */
00099   ssize_t recv (size_t n, ...) const;
00100 
00101   /// Send <n> bytes via Win32 WriteFile using overlapped I/O.
00102   ssize_t send (const void *buf, size_t n, ACE_OVERLAPPED *overlapped) const;
00103 
00104   /// Recv <n> bytes via Win32 ReadFile using overlapped I/O.
00105   ssize_t recv (void *buf, size_t n, ACE_OVERLAPPED *overlapped) const;
00106 
00107   /// Dump the state of an object.
00108   void dump (void) const;
00109 
00110   // = The following two methods are no-ops to keep the
00111   // <ACE_Connector> happy.
00112   /// Return the local endpoint address.
00113   int get_local_addr (ACE_DEV_Addr &) const;
00114 
00115   /// Return the address of the remotely connected peer (if there is
00116   /// one).
00117   int get_remote_addr (ACE_DEV_Addr &) const;
00118 
00119   /// Declare the dynamic allocation hooks.
00120   ACE_ALLOC_HOOK_DECLARE;
00121 
00122   // = Meta-type info
00123   typedef ACE_DEV_Addr PEER_ADDR;
00124 
00125 private:
00126   /// Address of device we are connected to.
00127   ACE_DEV_Addr addr_;
00128 };
00129 
00130 #if !defined (ACE_LACKS_INLINE_FUNCTIONS)
00131 #include "ace/DEV_IO.i"
00132 #endif
00133 
00134 #include "ace/post.h"
00135 #endif /* ACE_DEV_IO_H */

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