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

ACE_MEM_Stream Class Reference

Defines the methods in the <ACE_MEM_Stream> abstraction. More...

#include <MEM_Stream.h>

Inheritance diagram for ACE_MEM_Stream:

Inheritance graph
[legend]
Collaboration diagram for ACE_MEM_Stream:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Addr PEER_ADDR

Public Methods

 ACE_MEM_Stream (void)
 Constructor. More...

 ACE_MEM_Stream (ACE_HANDLE h)
 Constructor (sets the underlying <ACE_HANDLE> with <h>). More...

 ~ACE_MEM_Stream (void)
 Destructor. More...

ssize_t send_n (const void *buf, int n)
 Send n bytes, keep trying until n are sent. Recv n bytes, keep trying until n are received. More...

ssize_t recv_n (void *buf, int n)
ssize_t send_n (const void *buf, int n, int flags)
 Send n bytes, keep trying until n are sent. Recv n bytes, keep trying until n are received. More...

ssize_t recv_n (void *buf, int n, int flags)
int close_reader (void)
 Close down the reader. More...

int close_writer (void)
 Close down the writer. More...

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


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Friends

class ACE_MEM_Acceptor
class ACE_MEM_Connector

Detailed Description

Defines the methods in the <ACE_MEM_Stream> abstraction.

This adds additional wrapper methods atop the <ACE_MEM_IO> class.

Definition at line 39 of file MEM_Stream.h.


Member Typedef Documentation

typedef ACE_Addr ACE_MEM_Stream::PEER_ADDR
 

Definition at line 126 of file MEM_Stream.h.


Constructor & Destructor Documentation

ASYS_INLINE ACE_MEM_Stream::ACE_MEM_Stream void   
 

Constructor.

Definition at line 9 of file MEM_Stream.i.

00010 {
00011   // ACE_TRACE ("ACE_MEM_Stream::ACE_MEM_Stream");
00012 }

ASYS_INLINE ACE_MEM_Stream::ACE_MEM_Stream ACE_HANDLE    h
 

Constructor (sets the underlying <ACE_HANDLE> with <h>).

Definition at line 15 of file MEM_Stream.i.

References ACE_IPC_SAP::set_handle.

00016 {
00017   // ACE_TRACE ("ACE_MEM_Stream::ACE_MEM_Stream");
00018   this->set_handle (h);
00019 }

ASYS_INLINE ACE_MEM_Stream::~ACE_MEM_Stream void   
 

Destructor.

Definition at line 22 of file MEM_Stream.i.

00023 {
00024   // ACE_TRACE ("ACE_MEM_Stream::~ACE_MEM_Stream");
00025 }


Member Function Documentation

int ACE_MEM_Stream::close void   
 

Close down the socket (we need this to make things work correctly on Win32, which requires use to do a <close_writer> before doing the close to avoid losing data).

Reimplemented from ACE_SOCK.

Definition at line 23 of file MEM_Stream.cpp.

References ACE_SOCK::close, close_writer, ACE_MEM_IO::fini, and ACE_MEM_IO::send.

00024 {
00025   this->send ((char *)0, 0);
00026 
00027   this->fini ();
00028 
00029 #if defined (ACE_WIN32)
00030   // We need the following call to make things work correctly on
00031   // Win32, which requires use to do a <close_writer> before doing the
00032   // close in order to avoid losing data.  Note that we don't need to
00033   // do this on UNIX since it doesn't have this "feature".  Moreover,
00034   // this will cause subtle problems on UNIX due to the way that
00035   // fork() works.
00036   this->close_writer ();
00037 #endif /* ACE_WIN32 */
00038   // Close down the socket.
00039   return ACE_SOCK::close ();
00040 }

ASYS_INLINE int ACE_MEM_Stream::close_reader void   
 

Close down the reader.

Definition at line 28 of file MEM_Stream.i.

References ACE_SHUTDOWN_READ, ACE_TRACE, ACE_IPC_SAP::get_handle, and ACE_OS::shutdown.

00029 {
00030   ACE_TRACE ("ACE_MEM_Stream::close_reader");
00031   if (this->get_handle () != ACE_INVALID_HANDLE)
00032     return ACE_OS::shutdown (this->get_handle (), ACE_SHUTDOWN_READ);
00033   else
00034     return 0;
00035 }

ASYS_INLINE int ACE_MEM_Stream::close_writer void   
 

Close down the writer.

Definition at line 40 of file MEM_Stream.i.

References ACE_SHUTDOWN_WRITE, ACE_TRACE, ACE_IPC_SAP::get_handle, and ACE_OS::shutdown.

Referenced by close.

00041 {
00042   ACE_TRACE ("ACE_MEM_Stream::close_writer");
00043   if (this->get_handle () != ACE_INVALID_HANDLE)
00044     return ACE_OS::shutdown (this->get_handle (), ACE_SHUTDOWN_WRITE);
00045   else
00046     return 0;
00047 }

void ACE_MEM_Stream::dump void    const
 

Dump the state of an object.

Reimplemented from ACE_MEM_IO.

Definition at line 17 of file MEM_Stream.cpp.

References ACE_TRACE.

00018 {
00019   ACE_TRACE ("ACE_MEM_Stream::dump");
00020 }

ASYS_INLINE ssize_t ACE_MEM_Stream::recv_n void *    buf,
int    n,
int    flags
 

Definition at line 69 of file MEM_Stream.i.

References ACE_MEM_IO::recv.

00070 {
00071   return this->recv (buf, n, flags);
00072 }

ASYS_INLINE ssize_t ACE_MEM_Stream::recv_n void *    buf,
int    n
 

Definition at line 57 of file MEM_Stream.i.

References ACE_MEM_IO::recv.

00058 {
00059   return this->recv (buf, n);
00060 }

ASYS_INLINE ssize_t ACE_MEM_Stream::send_n const void *    buf,
int    n,
int    flags
 

Send n bytes, keep trying until n are sent. Recv n bytes, keep trying until n are received.

Definition at line 63 of file MEM_Stream.i.

References ACE_MEM_IO::send.

00064 {
00065   return this->send (buf, n, flags);
00066 }

ASYS_INLINE ssize_t ACE_MEM_Stream::send_n const void *    buf,
int    n
 

Send n bytes, keep trying until n are sent. Recv n bytes, keep trying until n are received.

Definition at line 50 of file MEM_Stream.i.

References ACE_MEM_IO::send.

00051 {
00052   return this->send (buf, n);
00053 }


Friends And Related Function Documentation

friend class ACE_MEM_Acceptor [friend]
 

Definition at line 43 of file MEM_Stream.h.

friend class ACE_MEM_Connector [friend]
 

Definition at line 44 of file MEM_Stream.h.


Member Data Documentation

ACE_MEM_Stream::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented from ACE_MEM_IO.

Definition at line 132 of file MEM_Stream.h.


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