BLOCXX_NAMESPACE::PosixUnnamedPipe Class Reference

#include <PosixUnnamedPipe.hpp>

Inheritance diagram for BLOCXX_NAMESPACE::PosixUnnamedPipe:
BLOCXX_NAMESPACE::UnnamedPipe BLOCXX_NAMESPACE::IOIFC BLOCXX_NAMESPACE::IntrusiveCountableBase

List of all members.

Public Member Functions

 PosixUnnamedPipe (EOpen doOpen=E_OPEN)
 PosixUnnamedPipe (AutoDescriptor inputfd, AutoDescriptor outputfd)
 If fd_in == -1, then you cannot read from this object.
virtual ~PosixUnnamedPipe ()
virtual int write (const void *data, int dataLen, ErrorAction errorAsException=E_RETURN_ON_ERROR)
 Write a specified number of bytes to the device that is exposing the IOIFC interface.
virtual int read (void *buffer, int bufferLen, ErrorAction errorAsException=E_RETURN_ON_ERROR)
 Read a specified number of bytes from the device that is exposing the IOIFC interface.
Descriptor getInputHandle () const
Descriptor getOutputHandle () const
virtual void open ()
 Open the pipe.
virtual int close ()
 Close the pipe.
virtual bool isOpen () const
 Is the pipe open or closed?
virtual int closeInputHandle ()
virtual int closeOutputHandle ()
virtual void setBlocking (EBlockingMode outputIsBlocking=E_BLOCKING)
virtual void setWriteBlocking (EBlockingMode isBlocking=E_BLOCKING)
virtual void setReadBlocking (EBlockingMode isBlocking=E_BLOCKING)
virtual EBlockingMode getReadBlocking () const
 Get the current blocking mode for reading from pipe.
virtual EBlockingMode getWriteBlocking () const
 Get the current blocking mode for writing from pipe.
virtual Select_t getReadSelectObj () const
 Get the read select object.
virtual Select_t getWriteSelectObj () const
 Get the write select object.
virtual Descriptor getInputDescriptor () const
 Get the underlying input descriptor.
virtual Descriptor getOutputDescriptor () const
 Get the underlying output descriptor.
virtual void passDescriptor (Descriptor h, const UnnamedPipeRef &ackPipe=0, const ProcessRef &targetProcess=0)
 Sends a Descriptor to the peer.
virtual AutoDescriptor receiveDescriptor (const UnnamedPipeRef &ackPipe)
 Gets a Descriptor from the peer.

Private Member Functions

 PosixUnnamedPipe (const PosixUnnamedPipe &x)
PosixUnnamedPipeoperator= (const PosixUnnamedPipe &x)

Private Attributes

Descriptor m_fds [2]
EBlockingMode m_blocking [2]

Detailed Description

Definition at line 50 of file PosixUnnamedPipe.hpp.


Constructor & Destructor Documentation

BLOCXX_NAMESPACE::PosixUnnamedPipe::PosixUnnamedPipe ( EOpen  doOpen = E_OPEN  ) 

Definition at line 332 of file PosixUnnamedPipe.cpp.

BLOCXX_NAMESPACE::PosixUnnamedPipe::PosixUnnamedPipe ( AutoDescriptor  inputfd,
AutoDescriptor  outputfd 
)

If fd_in == -1, then you cannot read from this object.

If fd_out == -1, then you cannot write to this object

Definition at line 344 of file PosixUnnamedPipe.cpp.

BLOCXX_NAMESPACE::PosixUnnamedPipe::~PosixUnnamedPipe (  )  [virtual]

Definition at line 356 of file PosixUnnamedPipe.cpp.

BLOCXX_NAMESPACE::PosixUnnamedPipe::PosixUnnamedPipe ( const PosixUnnamedPipe x  )  [private]

Member Function Documentation

int BLOCXX_NAMESPACE::PosixUnnamedPipe::close (  )  [virtual]

Close the pipe.

Returns:
-1 on error, 0 on success.

Implements BLOCXX_NAMESPACE::UnnamedPipe.

Definition at line 443 of file PosixUnnamedPipe.cpp.

References BLOCXX_INVALID_HANDLE, BLOCXX_THROW_ERRNO_MSG, and m_fds.

int BLOCXX_NAMESPACE::PosixUnnamedPipe::closeInputHandle (  )  [virtual]

Implements BLOCXX_NAMESPACE::UnnamedPipe.

Definition at line 477 of file PosixUnnamedPipe.cpp.

Referenced by getReadSelectObj().

int BLOCXX_NAMESPACE::PosixUnnamedPipe::closeOutputHandle (  )  [virtual]

Implements BLOCXX_NAMESPACE::UnnamedPipe.

Definition at line 492 of file PosixUnnamedPipe.cpp.

Descriptor BLOCXX_NAMESPACE::PosixUnnamedPipe::getInputDescriptor (  )  const [virtual]

Get the underlying input descriptor.

The UnnamedPipe instance retains ownership of the descriptor.

Implements BLOCXX_NAMESPACE::UnnamedPipe.

Definition at line 719 of file PosixUnnamedPipe.cpp.

References BLOCXX_NAMESPACE::IOIFC::E_THROW_ON_ERROR.

Descriptor BLOCXX_NAMESPACE::PosixUnnamedPipe::getInputHandle (  )  const [inline]
Descriptor BLOCXX_NAMESPACE::PosixUnnamedPipe::getOutputDescriptor (  )  const [virtual]

Get the underlying output descriptor.

The UnnamedPipe instance retains ownership of the descriptor.

Implements BLOCXX_NAMESPACE::UnnamedPipe.

Definition at line 726 of file PosixUnnamedPipe.cpp.

Descriptor BLOCXX_NAMESPACE::PosixUnnamedPipe::getOutputHandle (  )  const [inline]
EBlockingMode BLOCXX_NAMESPACE::PosixUnnamedPipe::getReadBlocking (  )  const [virtual]

Get the current blocking mode for reading from pipe.

Implements BLOCXX_NAMESPACE::UnnamedPipe.

Definition at line 733 of file PosixUnnamedPipe.cpp.

Select_t BLOCXX_NAMESPACE::PosixUnnamedPipe::getReadSelectObj (  )  const [virtual]

Get the read select object.

Implements BLOCXX_NAMESPACE::UnnamedPipe.

Definition at line 595 of file PosixUnnamedPipe.cpp.

References closeInputHandle().

EBlockingMode BLOCXX_NAMESPACE::PosixUnnamedPipe::getWriteBlocking (  )  const [virtual]

Get the current blocking mode for writing from pipe.

Implements BLOCXX_NAMESPACE::UnnamedPipe.

Definition at line 740 of file PosixUnnamedPipe.cpp.

Select_t BLOCXX_NAMESPACE::PosixUnnamedPipe::getWriteSelectObj (  )  const [virtual]

Get the write select object.

Implements BLOCXX_NAMESPACE::UnnamedPipe.

Definition at line 602 of file PosixUnnamedPipe.cpp.

References BLOCXX_THROW.

bool BLOCXX_NAMESPACE::PosixUnnamedPipe::isOpen (  )  const [virtual]

Is the pipe open or closed?

Implements BLOCXX_NAMESPACE::UnnamedPipe.

Definition at line 470 of file PosixUnnamedPipe.cpp.

void BLOCXX_NAMESPACE::PosixUnnamedPipe::open (  )  [virtual]

Open the pipe.

Implements BLOCXX_NAMESPACE::UnnamedPipe.

Definition at line 417 of file PosixUnnamedPipe.cpp.

References i, m_blocking, and m_fds.

PosixUnnamedPipe& BLOCXX_NAMESPACE::PosixUnnamedPipe::operator= ( const PosixUnnamedPipe x  )  [private]
void BLOCXX_NAMESPACE::PosixUnnamedPipe::passDescriptor ( Descriptor  h,
const UnnamedPipeRef ackPipe = 0,
const ProcessRef targetProcess = 0 
) [virtual]

Sends a Descriptor to the peer.

Parameters:
h The Descriptor to send.
Exceptions:
IOException on I/O error.

Implements BLOCXX_NAMESPACE::UnnamedPipe.

Definition at line 609 of file PosixUnnamedPipe.cpp.

int BLOCXX_NAMESPACE::PosixUnnamedPipe::read ( void *  dataIn,
int  dataInLen,
ErrorAction  errorAsException = E_RETURN_ON_ERROR 
) [virtual]

Read a specified number of bytes from the device that is exposing the IOIFC interface.

Parameters:
dataIn A pointer to a location in memory to put the bytes that have been read.
dataInLen The number of bytes being requested from the device.
errorAsException If true and an error occurs durring the read operation, then throw an exception.
Exceptions:
An exception will be thrown upon an error condition if errorAsException is true.
Returns:
The number of bytes actually read from the device, or -1 on error. If the device is set to nonblocking and no input is available, -1 will be returned and errno will be set to ETIMEDOUT

Implements BLOCXX_NAMESPACE::IOIFC.

Definition at line 548 of file PosixUnnamedPipe.cpp.

AutoDescriptor BLOCXX_NAMESPACE::PosixUnnamedPipe::receiveDescriptor ( const UnnamedPipeRef ackPipe  )  [virtual]

Gets a Descriptor from the peer.

Returns:
The Descriptor sent by the peer.
Exceptions:
IOException on I/O error or if the peer does not send a Descriptor

Implements BLOCXX_NAMESPACE::UnnamedPipe.

Definition at line 675 of file PosixUnnamedPipe.cpp.

void BLOCXX_NAMESPACE::PosixUnnamedPipe::setBlocking ( EBlockingMode  outputIsBlocking = E_BLOCKING  )  [virtual]

Definition at line 391 of file PosixUnnamedPipe.cpp.

void BLOCXX_NAMESPACE::PosixUnnamedPipe::setReadBlocking ( EBlockingMode  isBlocking = E_BLOCKING  )  [virtual]

Definition at line 411 of file PosixUnnamedPipe.cpp.

References BLOCXX_ASSERT, BLOCXX_INVALID_HANDLE, i, and m_fds.

void BLOCXX_NAMESPACE::PosixUnnamedPipe::setWriteBlocking ( EBlockingMode  isBlocking = E_BLOCKING  )  [virtual]

Definition at line 405 of file PosixUnnamedPipe.cpp.

int BLOCXX_NAMESPACE::PosixUnnamedPipe::write ( const void *  dataOut,
int  dataOutLen,
ErrorAction  errorAsException = E_RETURN_ON_ERROR 
) [virtual]

Write a specified number of bytes to the device that is exposing the IOIFC interface.

Parameters:
dataOut A pointer to a location in memory that contains the bytes that will be written to the device.
dataOutLen The length of the data pointed to by the dataOut param.
errorAsException If true and an error occurs durring the write operation, then throw an exception.
Exceptions:
An exception will be thrown upon an error condition if errorAsException is true.
Returns:
The number of bytes actually written to the device. or -1 on error. If the device is set to nonblocking and the write would block, -1 will be returned and errno will be set to ETIMEDOUT.

Implements BLOCXX_NAMESPACE::IOIFC.

Definition at line 507 of file PosixUnnamedPipe.cpp.


Member Data Documentation

Definition at line 87 of file PosixUnnamedPipe.hpp.

Referenced by open().

Definition at line 86 of file PosixUnnamedPipe.hpp.

Referenced by close(), open(), and setReadBlocking().


The documentation for this class was generated from the following files:
Generated on Mon Jul 5 19:59:47 2010 for blocxx by  doxygen 1.6.3