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

ACE_IO_SAP Class Reference

Defines the methods for the base class of the <ACE_IO_SAP> abstraction, which includes <ACE_FILE> and <ACE_DEV>. More...

#include <IO_SAP.h>

Inheritance diagram for ACE_IO_SAP:

Inheritance graph
[legend]
List of all members.

Public Types

enum  { INVALID_HANDLE = -1 }

Public Methods

 ~ACE_IO_SAP (void)
 Default dtor. More...

int control (int cmd, void *) const
 Interface for ioctl. More...

int enable (int value) const
int disable (int value) const
ACE_HANDLE get_handle (void) const
 Get the underlying handle. More...

void set_handle (ACE_HANDLE handle)
 Set the underlying handle. More...

void dump (void) const
 Dump the state of an object. More...


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Protected Methods

 ACE_IO_SAP (void)
 Ensure that ACE_IO_SAP is an abstract base class. More...


Private Attributes

ACE_HANDLE handle_
 Underlying I/O handle. More...


Static Private Attributes

pid_t pid_ = 0
 Cache the process ID. More...


Detailed Description

Defines the methods for the base class of the <ACE_IO_SAP> abstraction, which includes <ACE_FILE> and <ACE_DEV>.

Definition at line 30 of file IO_SAP.h.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
INVALID_HANDLE  Be consistent with Winsock.

Definition at line 33 of file IO_SAP.h.

00034   {
00035     /// Be consistent with Winsock
00036     INVALID_HANDLE = -1
00037   };


Constructor & Destructor Documentation

ASYS_INLINE ACE_IO_SAP::~ACE_IO_SAP void   
 

Default dtor.

Definition at line 7 of file IO_SAP.i.

References ACE_TRACE.

00008 {
00009   ACE_TRACE ("ACE_IO_SAP::~ACE_IO_SAP");
00010 }

ACE_IO_SAP::ACE_IO_SAP void    [protected]
 

Ensure that ACE_IO_SAP is an abstract base class.

Definition at line 19 of file IO_SAP.cpp.

References ACE_TRACE.

00020   : handle_ (ACE_INVALID_HANDLE)
00021 {
00022   ACE_TRACE ("ACE_IO_SAP::ACE_IO_SAP");
00023 }


Member Function Documentation

ASYS_INLINE int ACE_IO_SAP::control int    cmd,
void *   
const
 

Interface for ioctl.

Definition at line 33 of file IO_SAP.i.

References ACE_TRACE, and ACE_OS::ioctl.

Referenced by ACE_TTY_IO::control.

00034 {
00035   ACE_TRACE ("ACE_IO_SAP::control");
00036   return ACE_OS::ioctl (this->handle_, cmd, arg);
00037 }

int ACE_IO_SAP::disable int    value const
 

Disable asynchronous I/O (ACE_SIGIO), urgent data (ACE_SIGURG), non-blocking I/O (ACE_NONBLOCK), or close-on-exec (ACE_CLOEXEC), which is passed as the <value>.

Reimplemented in ACE_DEV.

Definition at line 95 of file IO_SAP.cpp.

References ACE_NONBLOCK, ACE_SIGIO, ACE_SIGURG, ACE_TRACE, ACE_Flag_Manip::clr_flags, ACE_OS::fcntl, and SIGIO.

Referenced by ACE_FILE::disable, and ACE_DEV::disable.

00096 {
00097   ACE_TRACE ("ACE_IO_SAP::disable");
00098 
00099 #if !defined(ACE_WIN32) && !defined (VXWORKS)
00100   switch (value)
00101     {
00102 #if defined (SIGURG)
00103     case SIGURG:
00104     case ACE_SIGURG:
00105 #if defined (F_SETOWN)
00106       if (ACE_OS::fcntl (this->handle_,
00107                          F_SETOWN, 0) == -1)
00108         return -1;
00109       break;
00110 #else
00111       ACE_NOTSUP_RETURN (-1);
00112 #endif /* F_SETOWN */
00113 #endif /* SIGURG */
00114 #if defined (SIGIO)
00115     case SIGIO:
00116     case ACE_SIGIO:
00117 #if defined (F_SETOWN) && defined (FASYNC)
00118       if (ACE_OS::fcntl (this->handle_,
00119                          F_SETOWN,
00120                          0) == -1
00121           || ACE_Flag_Manip::clr_flags (this->handle_, FASYNC) == -1)
00122         return -1;
00123       break;
00124 #else
00125       ACE_NOTSUP_RETURN (-1);
00126 #endif /* F_SETOWN && FASYNC */
00127 #else  // <==
00128       ACE_NOTSUP_RETURN (-1);
00129 #endif /* SIGIO <== */
00130     case ACE_NONBLOCK:
00131       if (ACE_Flag_Manip::clr_flags (this->handle_,
00132                                      ACE_NONBLOCK) == -1)
00133         return -1;
00134       break;
00135     default:
00136       return -1;
00137     }
00138   return 0;
00139 #else
00140   ACE_UNUSED_ARG (value);
00141   ACE_NOTSUP_RETURN (-1);
00142 #endif /* !ACE_WIN32 */
00143 }

void ACE_IO_SAP::dump void    const
 

Dump the state of an object.

Reimplemented in ACE_DEV.

Definition at line 26 of file IO_SAP.cpp.

References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_TRACE, and LM_DEBUG.

Referenced by ACE_FILE::dump.

00027 {
00028   ACE_TRACE ("ACE_IO_SAP::dump");
00029 
00030   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00031   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("handle_ = %d"), this->handle_));
00032   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\npid_ = %d"), this->pid_));
00033   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00034 }

int ACE_IO_SAP::enable int    value const
 

Enable asynchronous I/O (ACE_SIGIO), urgent data (ACE_SIGURG), non-blocking I/O (ACE_NONBLOCK), or close-on-exec (ACE_CLOEXEC), which is passed as the <value>.

Definition at line 40 of file IO_SAP.cpp.

References ACE_NONBLOCK, ACE_SIGIO, ACE_SIGURG, ACE_TRACE, ACE_OS::fcntl, ACE_OS::getpid, pid_, ACE_Flag_Manip::set_flags, and SIGIO.

00041 {
00042   ACE_TRACE ("ACE_IO_SAP::enable");
00043   /* First-time in initialization. */
00044   if (ACE_IO_SAP::pid_ == 0)
00045     ACE_IO_SAP::pid_ = ACE_OS::getpid ();
00046 
00047 #if !defined(ACE_WIN32) && !defined (VXWORKS)
00048 
00049   switch (value)
00050     {
00051 #if defined (SIGURG)
00052     case SIGURG:
00053     case ACE_SIGURG:
00054 #if defined (F_SETOWN)
00055       return ACE_OS::fcntl (this->handle_,
00056                             F_SETOWN,
00057                             ACE_IO_SAP::pid_);
00058 #else
00059       ACE_NOTSUP_RETURN (-1);
00060 #endif /* F_SETOWN */
00061 #endif /* SIGURG */
00062 #if defined (SIGIO)
00063     case SIGIO:
00064     case ACE_SIGIO:
00065 #if defined (F_SETOWN) && defined (FASYNC)
00066       if (ACE_OS::fcntl (this->handle_,
00067                          F_SETOWN,
00068                          ACE_IO_SAP::pid_) == -1
00069           || ACE_Flag_Manip::set_flags (this->handle_,
00070                              FASYNC) == -1)
00071         return -1;
00072       break;
00073 #else
00074       ACE_NOTSUP_RETURN (-1);
00075 #endif /* F_SETOWN && FASYNC */
00076 #else  // <==
00077       ACE_NOTSUP_RETURN (-1);
00078 #endif /* SIGIO <== */
00079     case ACE_NONBLOCK:
00080       if (ACE_Flag_Manip::set_flags (this->handle_,
00081                           ACE_NONBLOCK) == -1)
00082         return -1;
00083       break;
00084     default:
00085       return -1;
00086     }
00087 #else
00088   ACE_UNUSED_ARG (value);
00089 #endif /* !ACE_WIN32 */
00090 
00091   return 0;
00092 }

ASYS_INLINE ACE_HANDLE ACE_IO_SAP::get_handle void    const
 

Get the underlying handle.

Definition at line 15 of file IO_SAP.i.

References ACE_TRACE, and handle_.

Referenced by ACE_FILE::close, ACE_FILE_Connector::connect, and ACE_TTY_IO::control.

00016 {
00017   ACE_TRACE ("ACE_IO_SAP::get_handle");
00018   return this->handle_;
00019 }

ASYS_INLINE void ACE_IO_SAP::set_handle ACE_HANDLE    handle
 

Set the underlying handle.

Definition at line 24 of file IO_SAP.i.

References ACE_TRACE, and handle_.

Referenced by ACE_FILE::close, ACE_DEV::close, ACE_FILE_Connector::connect, and ACE_DEV_Connector::connect.

00025 {
00026   ACE_TRACE ("ACE_IO_SAP::set_handle");
00027   this->handle_ = handle;
00028 }


Member Data Documentation

ACE_IO_SAP::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented in ACE_DEV.

Definition at line 71 of file IO_SAP.h.

ACE_HANDLE ACE_IO_SAP::handle_ [private]
 

Underlying I/O handle.

Definition at line 79 of file IO_SAP.h.

Referenced by get_handle, and set_handle.

pid_t ACE_IO_SAP::pid_ = 0 [static, private]
 

Cache the process ID.

Definition at line 37 of file IO_SAP.cpp.

Referenced by enable.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:49:07 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002