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

ACE_FIFO_Send_Msg Class Reference

Sender side for the Record oriented C++ wrapper for UNIX FIFOs. More...

#include <FIFO_Send_Msg.h>

Inheritance diagram for ACE_FIFO_Send_Msg:

Inheritance graph
[legend]
Collaboration diagram for ACE_FIFO_Send_Msg:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_FIFO_Send_Msg (void)
 Default constructor. More...

 ACE_FIFO_Send_Msg (const ACE_TCHAR *rendezvous, int flags=O_WRONLY, int perms=ACE_DEFAULT_FILE_PERMS, LPSECURITY_ATTRIBUTES sa=0)
 Open up a record-oriented named pipe for writing. More...

int open (const ACE_TCHAR *rendezvous, int flags=O_WRONLY, int perms=ACE_DEFAULT_FILE_PERMS, LPSECURITY_ATTRIBUTES sa=0)
 Open up a record-oriented named pipe for writing. More...

ssize_t send (const ACE_Str_Buf &msg)
 Send <buf> of up to <len> bytes. More...

ssize_t send (const void *buf, size_t len)
 Send <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...


Detailed Description

Sender side for the Record oriented C++ wrapper for UNIX FIFOs.

Definition at line 30 of file FIFO_Send_Msg.h.


Constructor & Destructor Documentation

ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg void   
 

Default constructor.

Definition at line 50 of file FIFO_Send_Msg.cpp.

00051 {
00052 //  ACE_TRACE ("ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg");
00053 }

ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg const ACE_TCHAR   rendezvous,
int    flags = O_WRONLY,
int    perms = ACE_DEFAULT_FILE_PERMS,
LPSECURITY_ATTRIBUTES    sa = 0
 

Open up a record-oriented named pipe for writing.

Definition at line 65 of file FIFO_Send_Msg.cpp.

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

00069 {
00070   ACE_TRACE ("ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg");
00071   if (this->ACE_FIFO_Send_Msg::open (fifo_name, flags, perms, sa) == -1)
00072     ACE_ERROR ((LM_ERROR,  ACE_LIB_TEXT ("%p\n"),  ACE_LIB_TEXT ("ACE_FIFO_Send_Msg")));
00073 }


Member Function Documentation

void ACE_FIFO_Send_Msg::dump void    const
 

Dump the state of an object.

Reimplemented from ACE_FIFO_Send.

Definition at line 16 of file FIFO_Send_Msg.cpp.

References ACE_TRACE, and ACE_FIFO_Send::dump.

00017 {
00018   ACE_TRACE ("ACE_FIFO_Send_Msg::dump");
00019   ACE_FIFO_Send::dump ();
00020 }

int ACE_FIFO_Send_Msg::open const ACE_TCHAR   rendezvous,
int    flags = O_WRONLY,
int    perms = ACE_DEFAULT_FILE_PERMS,
LPSECURITY_ATTRIBUTES    sa = 0
 

Open up a record-oriented named pipe for writing.

Reimplemented from ACE_FIFO_Send.

Definition at line 56 of file FIFO_Send_Msg.cpp.

References ACE_TCHAR, ACE_TRACE, and ACE_FIFO_Send::open.

Referenced by ACE_FIFO_Send_Msg.

00060 {
00061   ACE_TRACE ("ACE_FIFO_Send_Msg::open");
00062   return ACE_FIFO_Send::open (fifo_name, flags | O_WRONLY, perms, sa);
00063 }

ASYS_INLINE ssize_t ACE_FIFO_Send_Msg::send const void *    buf,
size_t    len
 

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

Reimplemented from ACE_FIFO_Send.

Definition at line 7 of file FIFO_Send_Msg.i.

References ACE_TRACE, and send.

00008 {
00009   ACE_TRACE ("ACE_FIFO_Send_Msg::send");
00010   ACE_Str_Buf send_msg ((char *) buf, ACE_static_cast (int, len));
00011 
00012   return this->send (send_msg);
00013 }

ssize_t ACE_FIFO_Send_Msg::send const ACE_Str_Buf   msg
 

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

Definition at line 23 of file FIFO_Send_Msg.cpp.

References strbuf::buf, iovec::iov_base, iovec::iov_len, strbuf::len, ACE_OS::putmsg, ssize_t, and ACE_OS::writev.

Referenced by send.

00024 {
00025   // ACE_TRACE ("ACE_FIFO_Send_Msg::send");
00026 #if defined (ACE_HAS_STREAM_PIPES)
00027   if (ACE_OS::putmsg (this->get_handle (),
00028                       (strbuf *) 0,
00029                       (strbuf *) &send_msg,
00030                       0) == -1)
00031     return -1;
00032   else 
00033     return send_msg.len;
00034 #else
00035   iovec iov[2];
00036 
00037   iov[0].iov_base = (char *) &send_msg.len;
00038   iov[0].iov_len  = sizeof send_msg.len;
00039 
00040   iov[1].iov_base = (char *) send_msg.buf;
00041   iov[1].iov_len  =  ACE_static_cast (u_long, send_msg.len);
00042 
00043   ssize_t sent = ACE_OS::writev (this->get_handle (), iov, 2);
00044   if (sent > 0)
00045     sent -= iov[0].iov_len;       // Don't count the length we added.
00046   return sent;
00047 #endif /* ACE_HAS_STREAM_PIPES */
00048 }


Member Data Documentation

ACE_FIFO_Send_Msg::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented from ACE_FIFO_Send.

Definition at line 72 of file FIFO_Send_Msg.h.


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