blocxx
BLOCXX_NAMESPACE::IOIFC Class Referenceabstract

#include <IOIFC.hpp>

Inheritance diagram for BLOCXX_NAMESPACE::IOIFC:
BLOCXX_NAMESPACE::Socket BLOCXX_NAMESPACE::SocketBaseImpl BLOCXX_NAMESPACE::UnnamedPipe BLOCXX_NAMESPACE::SSLSocketImpl BLOCXX_NAMESPACE::SocketImpl BLOCXX_NAMESPACE::PosixUnnamedPipe

Public Types

enum  ErrorAction { E_THROW_ON_ERROR , E_RETURN_ON_ERROR }
 

Public Member Functions

virtual ~IOIFC ()
 
virtual int read (void *dataIn, int dataInLen, ErrorAction errorAsException=E_RETURN_ON_ERROR)=0
 Read a specified number of bytes from the device that is exposing the IOIFC interface.
 
virtual int write (const void *dataOut, int dataOutLen, ErrorAction errorAsException=E_RETURN_ON_ERROR)=0
 Write a specified number of bytes to the device that is exposing the IOIFC interface.
 

Detailed Description

Definition at line 46 of file IOIFC.hpp.

Member Enumeration Documentation

◆ ErrorAction

Enumerator
E_THROW_ON_ERROR 
E_RETURN_ON_ERROR 

Definition at line 51 of file IOIFC.hpp.

Constructor & Destructor Documentation

◆ ~IOIFC()

BLOCXX_NAMESPACE::IOIFC::~IOIFC ( )
virtual

Definition at line 46 of file IOIFC.cpp.

Member Function Documentation

◆ read()

virtual int BLOCXX_NAMESPACE::IOIFC::read ( void * dataIn,
int dataInLen,
ErrorAction errorAsException = E_RETURN_ON_ERROR )
pure virtual

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

Parameters
dataInA pointer to a location in memory to put the bytes that have been read.
dataInLenThe number of bytes being requested from the device.
errorAsExceptionIf true and an error occurs durring the read operation, then throw an exception.
Exceptions
Anexception 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

Implemented in BLOCXX_NAMESPACE::PosixUnnamedPipe, BLOCXX_NAMESPACE::Socket, and BLOCXX_NAMESPACE::SocketBaseImpl.

Referenced by BLOCXX_NAMESPACE::IOIFCStreamBuffer::buffer_from_device(), BLOCXX_NAMESPACE::PosixUnnamedPipe::passDescriptor(), BLOCXX_NAMESPACE::Exec::processInputOutput(), BLOCXX_NAMESPACE::UnnamedPipe::readAll(), BLOCXX_NAMESPACE::UnnamedPipe::readInt(), BLOCXX_NAMESPACE::UnnamedPipe::readString(), and BLOCXX_NAMESPACE::PosixExec::spawnImpl().

◆ write()

virtual int BLOCXX_NAMESPACE::IOIFC::write ( const void * dataOut,
int dataOutLen,
ErrorAction errorAsException = E_RETURN_ON_ERROR )
pure virtual

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

Parameters
dataOutA pointer to a location in memory that contains the bytes that will be written to the device.
dataOutLenThe length of the data pointed to by the dataOut param.
errorAsExceptionIf true and an error occurs durring the write operation, then throw an exception.
Exceptions
Anexception 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.

Implemented in BLOCXX_NAMESPACE::PosixUnnamedPipe, BLOCXX_NAMESPACE::Socket, and BLOCXX_NAMESPACE::SocketBaseImpl.

Referenced by BLOCXX_NAMESPACE::IOIFCStreamBuffer::buffer_to_device(), BLOCXX_NAMESPACE::Exec::processInputOutput(), BLOCXX_NAMESPACE::PosixUnnamedPipe::receiveDescriptor(), BLOCXX_NAMESPACE::UnnamedPipe::writeInt(), and BLOCXX_NAMESPACE::UnnamedPipe::writeString().


The documentation for this class was generated from the following files: