ACE_FIFO_Recv Class Reference

Receiver side of the bytestream C++ wrapper for UNIX FIFOs. More...

#include <FIFO_Recv.h>

Inheritance diagram for ACE_FIFO_Recv:

Inheritance graph
[legend]
Collaboration diagram for ACE_FIFO_Recv:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ACE_FIFO_Recv (void)
 Default constructor.

 ACE_FIFO_Recv (const ACE_TCHAR *rendezvous, int flags=O_CREAT|O_RDONLY, mode_t perms=ACE_DEFAULT_FILE_PERMS, int persistent=1, LPSECURITY_ATTRIBUTES sa=0)
 Open up a bytestream named pipe for reading.

int open (const ACE_TCHAR *rendezvous, int flags=O_CREAT|O_RDONLY, mode_t perms=ACE_DEFAULT_FILE_PERMS, int persistent=1, LPSECURITY_ATTRIBUTES sa=0)
 Open up a bytestream named pipe for reading.

int close (void)
 Close down the named pipe.

ssize_t recv (void *buf, size_t len)
 Recv of up to bytes.

ssize_t recv_n (void *buf, size_t len)
 Recv of exactly bytes (block until done).

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


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.


Private Attributes

ACE_HANDLE aux_handle_
 Auxiliary handle that is used to implement persistent FIFOs.


Detailed Description

Receiver side of the bytestream C++ wrapper for UNIX FIFOs.

Definition at line 36 of file FIFO_Recv.h.


Constructor & Destructor Documentation

ACE_FIFO_Recv::ACE_FIFO_Recv void   ) 
 

Default constructor.

Definition at line 65 of file FIFO_Recv.cpp.

References ACE_TRACE.

00066   : aux_handle_ (ACE_INVALID_HANDLE)
00067 {
00068   ACE_TRACE ("ACE_FIFO_Recv::ACE_FIFO_Recv");
00069 }

ACE_FIFO_Recv::ACE_FIFO_Recv const ACE_TCHAR rendezvous,
int  flags = O_CREAT|O_RDONLY,
mode_t  perms = ACE_DEFAULT_FILE_PERMS,
int  persistent = 1,
LPSECURITY_ATTRIBUTES  sa = 0
 

Open up a bytestream named pipe for reading.

Definition at line 71 of file FIFO_Recv.cpp.

References ACE_ERROR, ACE_LIB_TEXT, ACE_TCHAR, ACE_TRACE, LM_ERROR, mode_t, and open().

00076   : aux_handle_ (ACE_INVALID_HANDLE)
00077 {
00078   ACE_TRACE ("ACE_FIFO_Recv::ACE_FIFO_Recv");
00079 
00080   if (this->ACE_FIFO_Recv::open (fifo_name,
00081                                  flags,
00082                                  perms,
00083                                  persistent,
00084                                  sa) == -1)
00085     ACE_ERROR ((LM_ERROR,  ACE_LIB_TEXT ("%p\n"),  ACE_LIB_TEXT ("ACE_FIFO_Recv")));
00086 }


Member Function Documentation

int ACE_FIFO_Recv::close void   ) 
 

Close down the named pipe.

Reimplemented from ACE_FIFO.

Definition at line 30 of file FIFO_Recv.cpp.

References ACE_TRACE, aux_handle_, ACE_OS::close(), and ACE_FIFO::close().

00031 {
00032   ACE_TRACE ("ACE_FIFO_Recv::close");
00033   int result = ACE_FIFO::close ();
00034 
00035   if (this->aux_handle_ != ACE_INVALID_HANDLE)
00036     return ACE_OS::close (this->aux_handle_);
00037   else
00038     return result;
00039 }

ACE_BEGIN_VERSIONED_NAMESPACE_DECL void ACE_FIFO_Recv::dump void   )  const
 

Dump the state of an object.

Reimplemented from ACE_FIFO.

Reimplemented in ACE_FIFO_Recv_Msg.

Definition at line 18 of file FIFO_Recv.cpp.

References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_TRACE, ACE_FIFO::dump(), and LM_DEBUG.

Referenced by ACE_FIFO_Recv_Msg::dump().

00019 {
00020 #if defined (ACE_HAS_DUMP)
00021   ACE_TRACE ("ACE_FIFO_Recv::dump");
00022   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00023   ACE_FIFO::dump ();
00024   ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("aux_handle_ = %d"), this->aux_handle_));
00025   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00026 #endif /* ACE_HAS_DUMP */
00027 }

int ACE_FIFO_Recv::open const ACE_TCHAR rendezvous,
int  flags = O_CREAT|O_RDONLY,
mode_t  perms = ACE_DEFAULT_FILE_PERMS,
int  persistent = 1,
LPSECURITY_ATTRIBUTES  sa = 0
 

Open up a bytestream named pipe for reading.

Reimplemented in ACE_FIFO_Recv_Msg.

Definition at line 46 of file FIFO_Recv.cpp.

References ACE_NONBLOCK, ACE_TCHAR, ACE_TRACE, aux_handle_, ACE_IPC_SAP::disable(), ACE_IPC_SAP::get_handle(), mode_t, ACE_OS::open(), and ACE_FIFO::open().

Referenced by ACE_FIFO_Recv(), and ACE_FIFO_Recv_Msg::open().

00051 {
00052   ACE_TRACE ("ACE_FIFO_Recv::open");
00053 
00054   if (ACE_FIFO::open (fifo_name, ACE_NONBLOCK | flags, perms, sa) == -1)
00055     return -1;
00056   else if (this->disable (ACE_NONBLOCK) == -1)
00057     return -1;
00058   else if (persistent
00059            && (this->aux_handle_ = ACE_OS::open (fifo_name, O_WRONLY, 0, sa)) == ACE_INVALID_HANDLE)
00060     return -1;
00061   else
00062     return this->get_handle () == ACE_INVALID_HANDLE ? -1 : 0;
00063 }

ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ssize_t ACE_FIFO_Recv::recv void *  buf,
size_t  len
 

Recv of up to bytes.

Reimplemented in ACE_FIFO_Recv_Msg.

Definition at line 11 of file FIFO_Recv.inl.

References ACE_TRACE, and ACE_OS::read().

00012 {
00013   ACE_TRACE ("ACE_FIFO_Recv::recv");
00014   return ACE_OS::read (this->get_handle (), (char *) buf, len);
00015 }

ACE_INLINE ssize_t ACE_FIFO_Recv::recv_n void *  buf,
size_t  len
 

Recv of exactly bytes (block until done).

Definition at line 18 of file FIFO_Recv.inl.

References ACE_TRACE, and ACE::recv_n().

00019 {
00020   ACE_TRACE ("ACE_FIFO_Recv::recv_n");
00021   return ACE::recv_n (this->get_handle (), buf, n);
00022 }


Member Data Documentation

ACE_FIFO_Recv::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented from ACE_FIFO.

Reimplemented in ACE_FIFO_Recv_Msg.

Definition at line 70 of file FIFO_Recv.h.

ACE_HANDLE ACE_FIFO_Recv::aux_handle_ [private]
 

Auxiliary handle that is used to implement persistent FIFOs.

Definition at line 74 of file FIFO_Recv.h.

Referenced by close(), and open().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:22:10 2006 for ACE by doxygen 1.3.6