Faspstream Manager C/C++ API  3.6.1
A C and C++ language interface to basic streaming over the fasp protocol
FaspInputStream Class Reference

#include <FaspInputStream.h>

Public Member Functions

FASPSTREAM_CPP_API FaspInputStream (const Poco::Pipe &outPipe, Poco::SharedPtr< Poco::ProcessHandle > ph)
 
FASPSTREAM_CPP_API int read (char *buffer, int offset, int length)
 
FASPSTREAM_CPP_API bool eof ()
 
FASPSTREAM_CPP_API void close ()
 
FASPSTREAM_CPP_API void abort ()
 
FASPSTREAM_CPP_API void cleanup ()
 

Detailed Description

Use the FaspInputStream class to read faspstream data. Note this class does not inherit from any of the C++ std::ios stream classes, and requires the user to implement a read() loop to receive the data.

Constructor & Destructor Documentation

FASPSTREAM_CPP_API FaspInputStream::FaspInputStream ( const Poco::Pipe &  outPipe,
Poco::SharedPtr< Poco::ProcessHandle >  ph 
)

Initializes fasp input stream to use outPipe connected to faspstream process. The faspstream process should write to outPipe, and FaspInputStream will read from it.

Member Function Documentation

FASPSTREAM_CPP_API void FaspInputStream::abort ( )
FASPSTREAM_CPP_API void FaspInputStream::cleanup ( )
FASPSTREAM_CPP_API void FaspInputStream::close ( )

Closes the pipe to the faspstream process.

FASPSTREAM_CPP_API bool FaspInputStream::eof ( )

Returns true if end of file (stream) was reached while reading.

NOTE: read returns 0 to indicate end of file. This method may be deprecated/removed in the future.

FASPSTREAM_CPP_API int FaspInputStream::read ( char *  buffer,
int  offset,
int  length 
)

Reads available data from faspstream.

Returns the number of bytes read, zero for end of file, negative for error.

This is a blocking function.

Throws a FaspStreamException if there is an error reading from the faspstream.

NOTE: You may also encounter a SIGPIPE if the faspstream process exited prematurely (perhaps due to an error).

Parameters
bufferpointer to buffer containing bytes read (out parameter)
offsetnumber of bytes into the buffer to begin writing data
lennumber of bytes read into buf
Returns
number of bytes read, zero for end of file, negative for error

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