PNConnection Class Reference

Process Network Connection. More...

#include <pnconnection.h>

Inheritance diagram for PNConnection:

Inheritance graph
[legend]
Collaboration diagram for PNConnection:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PNConnection ()
 ~PNConnection ()
DataBlockClassread ()
void write (DataBlockClass *data)
int getNumReads ()
int getNumWrites ()
void clear ()
bool isEmpty ()
unsigned int getSize ()
ProcessLoadergetWriter ()
ProcessLoadergetReader ()
void setReader (ProcessLoader *reader, YMLPort *port)
void setWriter (ProcessLoader *writer, YMLPort *port)
YMLPortgetReaderPort ()
YMLPortgetWriterPort ()

Detailed Description

Process Network Connection.

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.


Constructor & Destructor Documentation

PNConnection::PNConnection  ) 
 

PNConnection::~PNConnection  ) 
 


Member Function Documentation

DataBlockClass * PNConnection::read  ) 
 

Block until a datablock is available. However if it is found that the writers thread has exited a NULL will be returned.

Returns:
the data read or NULL

void PNConnection::write DataBlockClass data  ) 
 

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.

Parameters:
data data to be written

int PNConnection::getNumReads  )  [inline]
 

int PNConnection::getNumWrites  )  [inline]
 

void PNConnection::clear  )  [inline]
 

Clears all data in the queue.

bool PNConnection::isEmpty  ) 
 

Check if the queue is empty.

Returns:
True if empty

unsigned int PNConnection::getSize  ) 
 

Get the current number of datablocks in the queue.

Returns:
the number of dataBlocks in the queue

ProcessLoader* PNConnection::getWriter  )  [inline]
 

ProcessLoader* PNConnection::getReader  )  [inline]
 

void PNConnection::setReader ProcessLoader reader,
YMLPort port
[inline]
 

void PNConnection::setWriter ProcessLoader writer,
YMLPort port
[inline]
 

YMLPort* PNConnection::getReaderPort  )  [inline]
 

YMLPort* PNConnection::getWriterPort  )  [inline]
 


The documentation for this class was generated from the following files:
Generated on Wed Apr 5 21:05:02 2006 for Sesame by  doxygen 1.4.6