#include <pnconnection.h>
Inheritance diagram for PNConnection:
Public Member Functions | |
PNConnection () | |
~PNConnection () | |
DataBlockClass * | read () |
void | write (DataBlockClass *data) |
int | getNumReads () |
int | getNumWrites () |
void | clear () |
bool | isEmpty () |
unsigned int | getSize () |
ProcessLoader * | getWriter () |
ProcessLoader * | getReader () |
void | setReader (ProcessLoader *reader, YMLPort *port) |
void | setWriter (ProcessLoader *writer, YMLPort *port) |
YMLPort * | getReaderPort () |
YMLPort * | getWriterPort () |
This class implements the connections of the Kahn paradigm. Reading is blocking and writing non-blocking. However if sizeLimit is set blocking during a write may occur. It is expected that reading and writing be done by different threads so the class has been made thread safe.
|
|
|
|
|
Block until a datablock is available. However if it is found that the writers thread has exited a NULL will be returned.
|
|
Write a datablock to the queue. This is a non-blocking operation unless a sizeLimit is set on the queue in which case blocking is possible. If a limit is set, the queue is full and the reader thread is no longer running the data will not be written to the queue.
|
|
|
|
|
|
Clears all data in the queue.
|
|
Check if the queue is empty.
|
|
Get the current number of datablocks in the queue.
|
|
|
|
|
|
|
|
|
|
|
|
|