#include <IO_SAP.h>
Inheritance diagram for ACE_IO_SAP:

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... | |
Definition at line 30 of file IO_SAP.h.
|
|
Definition at line 33 of file IO_SAP.h.
00034 {
00035 /// Be consistent with Winsock
00036 INVALID_HANDLE = -1
00037 };
|
|
|
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 }
|
|
|
Ensure that ACE_IO_SAP is an abstract base class.
Definition at line 19 of file IO_SAP.cpp. References ACE_TRACE.
|
|
||||||||||||
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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.
|
|
|
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.
|
|
|
Declare the dynamic allocation hooks.
Reimplemented in ACE_DEV. |
|
|
Underlying I/O handle.
Definition at line 79 of file IO_SAP.h. Referenced by get_handle, and set_handle. |
|
|
Cache the process ID.
Definition at line 37 of file IO_SAP.cpp. Referenced by enable. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002