#include <IO_SAP.h>
Inheritance diagram for ACE_IO_SAP:
Public Types | |
enum | { INVALID_HANDLE = -1 } |
Public Member Functions | |
~ACE_IO_SAP (void) | |
Default dtor. | |
int | control (int cmd, void *) const |
Interface for ioctl. | |
int | enable (int value) const |
int | disable (int value) const |
ACE_HANDLE | get_handle (void) const |
Get the underlying handle. | |
void | set_handle (ACE_HANDLE handle) |
Set the underlying handle. | |
void | dump (void) const |
Dump the state of an object. | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
Protected Member Functions | |
ACE_IO_SAP (void) | |
Ensure that ACE_IO_SAP is an abstract base class. | |
Private Attributes | |
ACE_HANDLE | handle_ |
Underlying I/O handle. | |
Static Private Attributes | |
pid_t | pid_ = 0 |
Cache the process ID. |
Definition at line 34 of file IO_SAP.h.
|
Definition at line 37 of file IO_SAP.h.
00038 { 00039 /// Be consistent with Winsock 00040 INVALID_HANDLE = -1 00041 }; |
|
Default dtor.
Definition at line 10 of file IO_SAP.inl. References ACE_TRACE.
00011 { 00012 ACE_TRACE ("ACE_IO_SAP::~ACE_IO_SAP"); 00013 } |
|
Ensure that ACE_IO_SAP is an abstract base class.
Definition at line 24 of file IO_SAP.cpp. References ACE_TRACE.
|
|
Interface for ioctl.
Definition at line 36 of file IO_SAP.inl. References ACE_TRACE, and ACE_OS::ioctl(). Referenced by ACE_TTY_IO::control().
00037 { 00038 ACE_TRACE ("ACE_IO_SAP::control"); 00039 return ACE_OS::ioctl (this->handle_, cmd, arg); 00040 } |
|
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, and ACE_FILE. Definition at line 97 of file IO_SAP.cpp. References ACE_NONBLOCK, ACE_NOTSUP_RETURN, ACE_SIGIO, ACE_SIGURG, ACE_TRACE, ACE::clr_flags(), ACE_OS::fcntl(), and SIGIO. Referenced by ACE_FILE::disable(), and ACE_DEV::disable().
00098 { 00099 ACE_TRACE ("ACE_IO_SAP::disable"); 00100 00101 switch (value) 00102 { 00103 #if defined (SIGURG) 00104 case SIGURG: 00105 case ACE_SIGURG: 00106 #if defined (F_SETOWN) 00107 if (ACE_OS::fcntl (this->handle_, 00108 F_SETOWN, 0) == -1) 00109 return -1; 00110 break; 00111 #else 00112 ACE_NOTSUP_RETURN (-1); 00113 #endif /* F_SETOWN */ 00114 #endif /* SIGURG */ 00115 #if defined (SIGIO) 00116 case SIGIO: 00117 case ACE_SIGIO: 00118 #if defined (F_SETOWN) && defined (FASYNC) 00119 if (ACE_OS::fcntl (this->handle_, 00120 F_SETOWN, 00121 0) == -1 00122 || ACE::clr_flags (this->handle_, FASYNC) == -1) 00123 return -1; 00124 break; 00125 #else 00126 ACE_NOTSUP_RETURN (-1); 00127 #endif /* F_SETOWN && FASYNC */ 00128 #else // <== 00129 ACE_NOTSUP_RETURN (-1); 00130 #endif /* SIGIO <== */ 00131 case ACE_NONBLOCK: 00132 if (ACE::clr_flags (this->handle_, 00133 ACE_NONBLOCK) == -1) 00134 return -1; 00135 break; 00136 default: 00137 return -1; 00138 } 00139 return 0; 00140 } |
|
Dump the state of an object.
Reimplemented in ACE_DEV, ACE_DEV_IO, ACE_FILE, and ACE_FILE_IO. Definition at line 31 of file IO_SAP.cpp. References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_TEXT, ACE_TRACE, and LM_DEBUG. Referenced by ACE_FILE::dump().
00032 { 00033 #if defined (ACE_HAS_DUMP) 00034 ACE_TRACE ("ACE_IO_SAP::dump"); 00035 00036 ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); 00037 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("handle_ = %d"), this->handle_)); 00038 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\npid_ = %d"), this->pid_)); 00039 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); 00040 #endif /* ACE_HAS_DUMP */ 00041 } |
|
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 47 of file IO_SAP.cpp. References ACE_NONBLOCK, ACE_NOTSUP_RETURN, ACE_SIGIO, ACE_SIGURG, ACE_TRACE, ACE_OS::fcntl(), ACE_OS::getpid(), pid_, ACE::set_flags(), and SIGIO.
00048 { 00049 ACE_TRACE ("ACE_IO_SAP::enable"); 00050 /* First-time in initialization. */ 00051 if (ACE_IO_SAP::pid_ == 0) 00052 ACE_IO_SAP::pid_ = ACE_OS::getpid (); 00053 00054 switch (value) 00055 { 00056 #if defined (SIGURG) 00057 case SIGURG: 00058 case ACE_SIGURG: 00059 #if defined (F_SETOWN) 00060 return ACE_OS::fcntl (this->handle_, 00061 F_SETOWN, 00062 ACE_IO_SAP::pid_); 00063 #else 00064 ACE_NOTSUP_RETURN (-1); 00065 #endif /* F_SETOWN */ 00066 #endif /* SIGURG */ 00067 #if defined (SIGIO) 00068 case SIGIO: 00069 case ACE_SIGIO: 00070 #if defined (F_SETOWN) && defined (FASYNC) 00071 if (ACE_OS::fcntl (this->handle_, 00072 F_SETOWN, 00073 ACE_IO_SAP::pid_) == -1 00074 || ACE::set_flags (this->handle_, 00075 FASYNC) == -1) 00076 return -1; 00077 break; 00078 #else 00079 ACE_NOTSUP_RETURN (-1); 00080 #endif /* F_SETOWN && FASYNC */ 00081 #else // <== 00082 ACE_NOTSUP_RETURN (-1); 00083 #endif /* SIGIO <== */ 00084 case ACE_NONBLOCK: 00085 if (ACE::set_flags (this->handle_, 00086 ACE_NONBLOCK) == -1) 00087 return -1; 00088 break; 00089 default: 00090 return -1; 00091 } 00092 00093 return 0; 00094 } |
|
Get the underlying handle.
Definition at line 18 of file IO_SAP.inl. References ACE_TRACE. Referenced by ACE_FILE::close(), ACE_FILE_Connector::connect(), and ACE_TTY_IO::control().
|
|
Set the underlying handle.
Definition at line 27 of file IO_SAP.inl. References ACE_TRACE. 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, ACE_DEV_IO, ACE_FILE, and ACE_FILE_IO. |
|
Underlying I/O handle.
|
|
Cache the process ID.
Definition at line 44 of file IO_SAP.cpp. Referenced by enable(). |