BLOCXX_NAMESPACE::PosixUnnamedPipe Class Reference

#include <PosixUnnamedPipe.hpp>

Inheritance diagram for BLOCXX_NAMESPACE::PosixUnnamedPipe:

BLOCXX_NAMESPACE::UnnamedPipe BLOCXX_NAMESPACE::SelectableIFC BLOCXX_NAMESPACE::IOIFC BLOCXX_NAMESPACE::IntrusiveCountableBase List of all members.

Public Member Functions

 PosixUnnamedPipe (EOpen doOpen=E_OPEN)
virtual ~PosixUnnamedPipe ()
virtual int write (const void *data, int dataLen, bool errorAsException=false)
 Write a specified number of bytes to the device that is exposing the IOIFC interface.
virtual int read (void *buffer, int bufferLen, bool errorAsException=false)
 Read a specified number of bytes from the device that is exposing the IOIFC interface.
int getInputHandle ()
int getOutputHandle ()
virtual void open ()
 Open the pipe.
virtual int close ()
 Close the pipe.
virtual bool isOpen () const
 Is the pipe open or closed?
int closeInputHandle ()
int closeOutputHandle ()
virtual void setBlocking (EBlockingMode outputIsBlocking=E_BLOCKING)
virtual Select_t getSelectObj () const
virtual Select_t getWriteSelectObj () const
 Get a write select object.

Private Attributes

int m_fds [2]
EBlockingMode m_blocking

Detailed Description

Definition at line 49 of file PosixUnnamedPipe.hpp.


Constructor & Destructor Documentation

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

Definition at line 212 of file PosixUnnamedPipe.cpp.

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

Definition at line 230 of file PosixUnnamedPipe.cpp.

References close().


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 350 of file PosixUnnamedPipe.cpp.

References _CLOSE, and m_fds.

Referenced by open(), and ~PosixUnnamedPipe().

int BLOCXX_NAMESPACE::PosixUnnamedPipe::closeInputHandle  ) 
 

Definition at line 388 of file PosixUnnamedPipe.cpp.

References _CLOSE, and m_fds.

int BLOCXX_NAMESPACE::PosixUnnamedPipe::closeOutputHandle  ) 
 

Definition at line 407 of file PosixUnnamedPipe.cpp.

References _CLOSE, and m_fds.

int BLOCXX_NAMESPACE::PosixUnnamedPipe::getInputHandle  )  [inline]
 

Definition at line 56 of file PosixUnnamedPipe.hpp.

int BLOCXX_NAMESPACE::PosixUnnamedPipe::getOutputHandle  )  [inline]
 

Definition at line 57 of file PosixUnnamedPipe.hpp.

Select_t BLOCXX_NAMESPACE::PosixUnnamedPipe::getSelectObj  )  const [virtual]
 

Implements BLOCXX_NAMESPACE::SelectableIFC.

Definition at line 536 of file PosixUnnamedPipe.cpp.

References m_fds.

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

Get a write select object.

Implements BLOCXX_NAMESPACE::UnnamedPipe.

Definition at line 553 of file PosixUnnamedPipe.cpp.

References m_fds.

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

Is the pipe open or closed?

Implements BLOCXX_NAMESPACE::UnnamedPipe.

Definition at line 381 of file PosixUnnamedPipe.cpp.

References m_fds.

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

Open the pipe.

Implements BLOCXX_NAMESPACE::UnnamedPipe.

Definition at line 282 of file PosixUnnamedPipe.cpp.

References BLOCXX_THROW, close(), and m_fds.

int BLOCXX_NAMESPACE::PosixUnnamedPipe::read void *  buffer,
int  bufferLen,
bool  errorAsException = false
[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.

Implements BLOCXX_NAMESPACE::IOIFC.

Definition at line 481 of file PosixUnnamedPipe.cpp.

References _READ, BLOCXX_THROW_ERRNO_MSG, BLOCXX_NAMESPACE::SocketFlags::E_WAIT_FOR_INPUT, m_blocking, m_fds, BLOCXX_NAMESPACE::UnnamedPipe::m_readTimeout, and BLOCXX_NAMESPACE::SocketUtils::waitForIO().

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

Definition at line 236 of file PosixUnnamedPipe.cpp.

References BLOCXX_ASSERT, BLOCXX_THROW_ERRNO_MSG, i, m_blocking, and m_fds.

int BLOCXX_NAMESPACE::PosixUnnamedPipe::write const void *  data,
int  dataLen,
bool  errorAsException = false
[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

Implements BLOCXX_NAMESPACE::IOIFC.

Definition at line 426 of file PosixUnnamedPipe.cpp.

References _WRITE, BLOCXX_THROW_ERRNO_MSG, BLOCXX_NAMESPACE::SocketFlags::E_WAIT_FOR_OUTPUT, m_blocking, m_fds, BLOCXX_NAMESPACE::UnnamedPipe::m_writeTimeout, and BLOCXX_NAMESPACE::SocketUtils::waitForIO().


Member Data Documentation

EBlockingMode BLOCXX_NAMESPACE::PosixUnnamedPipe::m_blocking [private]
 

Definition at line 72 of file PosixUnnamedPipe.hpp.

Referenced by read(), setBlocking(), and write().

int BLOCXX_NAMESPACE::PosixUnnamedPipe::m_fds[2] [private]
 

Definition at line 67 of file PosixUnnamedPipe.hpp.

Referenced by close(), closeInputHandle(), closeOutputHandle(), getSelectObj(), getWriteSelectObj(), isOpen(), open(), read(), setBlocking(), and write().


The documentation for this class was generated from the following files:
Generated on Fri Jun 16 15:39:11 2006 for blocxx by  doxygen 1.4.6