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>

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 | |
| static pid_t | pid_ = 0 |
| Cache the process ID. | |
Defines the methods for the base class of the ACE_IO_SAP abstraction, which includes ACE_FILE and ACE_DEV.
Definition at line 34 of file IO_SAP.h.
| anonymous enum |
Definition at line 37 of file IO_SAP.h.
{
/// Be consistent with Winsock
INVALID_HANDLE = -1
};
| ACE_IO_SAP::~ACE_IO_SAP | ( | void | ) | [inline] |
| ACE_IO_SAP::ACE_IO_SAP | ( | void | ) | [protected] |
Ensure that ACE_IO_SAP is an abstract base class.
Definition at line 24 of file IO_SAP.cpp.
| int ACE_IO_SAP::control | ( | int | cmd, | |
| void * | arg | |||
| ) | const [inline] |
Interface for ioctl.
Definition at line 36 of file IO_SAP.inl.
{
ACE_TRACE ("ACE_IO_SAP::control");
return ACE_OS::ioctl (this->handle_, cmd, arg);
}
| 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, and ACE_FILE.
Definition at line 97 of file IO_SAP.cpp.
{
ACE_TRACE ("ACE_IO_SAP::disable");
switch (value)
{
#if defined (SIGURG)
case SIGURG:
case ACE_SIGURG:
#if defined (F_SETOWN)
if (ACE_OS::fcntl (this->handle_,
F_SETOWN, 0) == -1)
return -1;
break;
#else
ACE_NOTSUP_RETURN (-1);
#endif /* F_SETOWN */
#endif /* SIGURG */
#if defined (SIGIO)
case SIGIO:
case ACE_SIGIO:
#if defined (F_SETOWN) && defined (FASYNC)
if (ACE_OS::fcntl (this->handle_,
F_SETOWN,
0) == -1
|| ACE::clr_flags (this->handle_, FASYNC) == -1)
return -1;
break;
#else
ACE_NOTSUP_RETURN (-1);
#endif /* F_SETOWN && FASYNC */
#else // <==
ACE_NOTSUP_RETURN (-1);
#endif /* SIGIO <== */
case ACE_NONBLOCK:
if (ACE::clr_flags (this->handle_,
ACE_NONBLOCK) == -1)
return -1;
break;
default:
return -1;
}
return 0;
}
| void ACE_IO_SAP::dump | ( | void | ) | const |
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.
{
#if defined (ACE_HAS_DUMP)
ACE_TRACE ("ACE_IO_SAP::dump");
ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("handle_ = %d"), this->handle_));
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\npid_ = %d"), this->pid_));
ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
#endif /* ACE_HAS_DUMP */
}
| 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 47 of file IO_SAP.cpp.
{
ACE_TRACE ("ACE_IO_SAP::enable");
/* First-time in initialization. */
if (ACE_IO_SAP::pid_ == 0)
ACE_IO_SAP::pid_ = ACE_OS::getpid ();
switch (value)
{
#if defined (SIGURG)
case SIGURG:
case ACE_SIGURG:
#if defined (F_SETOWN)
return ACE_OS::fcntl (this->handle_,
F_SETOWN,
ACE_IO_SAP::pid_);
#else
ACE_NOTSUP_RETURN (-1);
#endif /* F_SETOWN */
#endif /* SIGURG */
#if defined (SIGIO)
case SIGIO:
case ACE_SIGIO:
#if defined (F_SETOWN) && defined (FASYNC)
if (ACE_OS::fcntl (this->handle_,
F_SETOWN,
ACE_IO_SAP::pid_) == -1
|| ACE::set_flags (this->handle_,
FASYNC) == -1)
return -1;
break;
#else
ACE_NOTSUP_RETURN (-1);
#endif /* F_SETOWN && FASYNC */
#else // <==
ACE_NOTSUP_RETURN (-1);
#endif /* SIGIO <== */
case ACE_NONBLOCK:
if (ACE::set_flags (this->handle_,
ACE_NONBLOCK) == -1)
return -1;
break;
default:
return -1;
}
return 0;
}
| ACE_HANDLE ACE_IO_SAP::get_handle | ( | void | ) | const [inline] |
Get the underlying handle.
Definition at line 18 of file IO_SAP.inl.
| void ACE_IO_SAP::set_handle | ( | ACE_HANDLE | handle | ) | [inline] |
Set the underlying handle.
Definition at line 27 of file IO_SAP.inl.
Declare the dynamic allocation hooks.
Reimplemented in ACE_DEV, ACE_DEV_IO, ACE_FILE, and ACE_FILE_IO.
ACE_HANDLE ACE_IO_SAP::handle_ [private] |
pid_t ACE_IO_SAP::pid_ = 0 [static, private] |
1.7.0