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

#include <FaspOutputStream.h>

Public Member Functions

FASPSTREAM_CPP_API FaspOutputStream (const Poco::Pipe &inPipe, Poco::SharedPtr< Poco::ProcessHandle > ph)
 
FASPSTREAM_CPP_API void write (const char *buffer, int length)
 
FASPSTREAM_CPP_API void close ()
 
FASPSTREAM_CPP_API void abort ()
 
FASPSTREAM_CPP_API void cleanup ()
 

Detailed Description

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

Constructor & Destructor Documentation

FASPSTREAM_CPP_API FaspOutputStream::FaspOutputStream ( const Poco::Pipe &  inPipe,
Poco::SharedPtr< Poco::ProcessHandle >  ph 
)

Initializes fasp output stream to use inPipe connected to faspstream process. The faspstream process should read from inPipe, and FaspOutputStream will write to it.

Member Function Documentation

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

Closes the pipe to the faspstream process.

FASPSTREAM_CPP_API void FaspOutputStream::write ( const char *  buffer,
int  length 
)

Writes data to faspstream.

Returns the number of bytes written, negative for error.

This is a blocking function.

Throws a FaspStreamException if there is an error writing to the faspstream.

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

Parameters
bufferdata to write to faspstream
lengthnumber of bytes to write in buffer
Returns
number of bytes written, negative for error

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