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

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 Methods

 ACE_FIFO_Recv (void)
 Default constructor. More...

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

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

int close (void)
 Close down the named pipe. More...

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

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

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


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Private Attributes

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


Detailed Description

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

Definition at line 33 of file FIFO_Recv.h.


Constructor & Destructor Documentation

ACE_FIFO_Recv::ACE_FIFO_Recv void   
 

Default constructor.

Definition at line 62 of file FIFO_Recv.cpp.

References ACE_TRACE.

00063   : aux_handle_ (ACE_INVALID_HANDLE)
00064 {
00065   ACE_TRACE ("ACE_FIFO_Recv::ACE_FIFO_Recv");
00066 }

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

Open up a bytestream named pipe for reading.

Definition at line 68 of file FIFO_Recv.cpp.

References ACE_ERROR, ACE_LIB_TEXT, ACE_TCHAR, ACE_TRACE, LM_ERROR, and open.

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


Member Function Documentation

int ACE_FIFO_Recv::close void   
 

Close down the named pipe.

Reimplemented from ACE_FIFO.

Definition at line 27 of file FIFO_Recv.cpp.

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

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

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 17 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.

00018 {
00019   ACE_TRACE ("ACE_FIFO_Recv::dump");
00020   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00021   ACE_FIFO::dump ();
00022   ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("aux_handle_ = %d"), this->aux_handle_));
00023   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00024 }

int ACE_FIFO_Recv::open const ACE_TCHAR   rendezvous,
int    flags = O_CREAT|O_RDONLY,
int    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 43 of file FIFO_Recv.cpp.

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

Referenced by ACE_FIFO_Recv, and ACE_FIFO_Recv_Msg::open.

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

ASYS_INLINE ssize_t ACE_FIFO_Recv::recv void *    buf,
size_t    len
 

Recv <buf> of up to <len> bytes.

Reimplemented in ACE_FIFO_Recv_Msg.

Definition at line 7 of file FIFO_Recv.i.

References ACE_TRACE, and ACE_OS::read.

00008 {
00009   ACE_TRACE ("ACE_FIFO_Recv::recv");
00010   return ACE_OS::read (this->get_handle (), (char *) buf, len);
00011 }

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

Recv <buf> of exactly <len> bytes (block until done).

Definition at line 14 of file FIFO_Recv.i.

References ACE_TRACE, and ACE::recv_n.

00015 {
00016   ACE_TRACE ("ACE_FIFO_Recv::recv_n");
00017   return ACE::recv_n (this->get_handle (), buf, n);
00018 }


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 67 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 71 of file FIFO_Recv.h.

Referenced by close, and open.


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