IO_SAP.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    IO_SAP.h
00006  *
00007  *  IO_SAP.h,v 4.16 2005/10/28 16:14:52 ossama Exp
00008  *
00009  *  @author Doug Schmidt
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef ACE_IO_SAP_H
00015 #define ACE_IO_SAP_H
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "ace/Flag_Manip.h"
00019 #include "ace/os_include/sys/os_types.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif /* ACE_LACKS_PRAGMA_ONCE */
00024 
00025 
00026 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00027 
00028 /**
00029  * @class ACE_IO_SAP
00030  *
00031  * @brief Defines the methods for the base class of the <ACE_IO_SAP>
00032  * abstraction, which includes <ACE_FILE> and <ACE_DEV>.
00033  */
00034 class ACE_Export ACE_IO_SAP
00035 {
00036 public:
00037   enum
00038   {
00039     /// Be consistent with Winsock
00040     INVALID_HANDLE = -1
00041   };
00042 
00043   /// Default dtor.
00044   ~ACE_IO_SAP (void);
00045 
00046   /// Interface for ioctl.
00047   int control (int cmd, void *) const;
00048 
00049   // = Common I/O handle options related to files.
00050 
00051   /**
00052    * Enable asynchronous I/O (ACE_SIGIO), urgent data (ACE_SIGURG),
00053    * non-blocking I/O (ACE_NONBLOCK), or close-on-exec (ACE_CLOEXEC),
00054    * which is passed as the <value>.
00055    */
00056   int enable (int value) const;
00057 
00058   /**
00059    * Disable asynchronous I/O (ACE_SIGIO), urgent data (ACE_SIGURG),
00060    * non-blocking I/O (ACE_NONBLOCK), or close-on-exec (ACE_CLOEXEC),
00061    * which is passed as the <value>.
00062    */
00063   int disable (int value) const;
00064 
00065   /// Get the underlying handle.
00066   ACE_HANDLE get_handle (void) const;
00067 
00068   /// Set the underlying handle.
00069   void set_handle (ACE_HANDLE handle);
00070 
00071   /// Dump the state of an object.
00072   void dump (void) const;
00073 
00074   /// Declare the dynamic allocation hooks.
00075   ACE_ALLOC_HOOK_DECLARE;
00076 
00077 protected:
00078   /// Ensure that ACE_IO_SAP is an abstract base class.
00079   ACE_IO_SAP (void);
00080 
00081 private:
00082   /// Underlying I/O handle.
00083   ACE_HANDLE handle_;
00084 
00085   /// Cache the process ID.
00086   static pid_t pid_;
00087 };
00088 
00089 ACE_END_VERSIONED_NAMESPACE_DECL
00090 
00091 #if defined (__ACE_INLINE__)
00092 #include "ace/IO_SAP.inl"
00093 #endif /* __ACE_INLINE__ */
00094 
00095 #include /**/ "ace/post.h"
00096 #endif /* ACE_IO_SAP_H */

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