fesa-core  7.0.0
fesa::Pipe Class Reference

#include <Pipe.h>

Inherits noncopyable.

Public Member Functions

 Pipe (bool nonBlockingRead, bool nonBlockingWrite, bool closeOnExec)
 
std::size_t read (void *buf, std::size_t count)
 
std::size_t write (const void *buf, std::size_t count)
 

Detailed Description

Simple wrapper around pipes.

Constructor & Destructor Documentation

fesa::Pipe::Pipe ( bool  nonBlockingRead,
bool  nonBlockingWrite,
bool  closeOnExec 
)

Constructor.

Parameters
nonBlockingReadif true, reads on this pipe will be non-blocking
nonBlockingWriteif true, writes on this pipe will be non-blocking
closeOnExecif true, the close on exec flag is set on pipes file descriptors

Member Function Documentation

std::size_t fesa::Pipe::read ( void *  buf,
std::size_t  count 
)

Reads from the pipe up to count bytes. Result is written to buf. If the pipe is non-blocking and the read operation would block, then this immediately returns 0.

Returns
the number of bytes actually read
Exceptions
FesaExceptionin case of error
std::size_t fesa::Pipe::write ( const void *  buf,
std::size_t  count 
)

Writes to the pipe up to count bytes from buf. If the pipe is non-blocking and the write operation would block, then this immediately returns 0.

Returns
the number of bytes actually read
Exceptions
FesaExceptionin case of error

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