Archon::Utilities::Stream::BasicPipe< C > Struct Template Reference

The BasicPipe provide functionality much like the UNIX pipe. More...

#include <archon/util/pipe.H>

Inheritance diagram for Archon::Utilities::Stream::BasicPipe< C >:

Inheritance graph
[legend]
Collaboration diagram for Archon::Utilities::Stream::BasicPipe< C >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void raiseReadError (string message)
 Force the next read call to throw a ReadException with the specified message.
void raiseWriteError (string message)
 Force the next write call to throw a WriteException with the specified message.
int read (C *b, int n) throw (ReadException, UnexpectedException)
int write (const C *b, int n) throw (WriteException, UnexpectedException)

Static Public Member Functions

static void make (Ref< ReaderBase< C > > &r, Ref< WriterBase< C > > &w, int bufferSize=4096, bool expand=false)

Protected Member Functions

 BasicPipe (int bufferSize, bool expand)
virtual ~BasicPipe ()
void refDispose (Mutex::Lock &l)

Detailed Description

template<class C>
struct Archon::Utilities::Stream::BasicPipe< C >

The BasicPipe provide functionality much like the UNIX pipe.

Note:
The character type used as template argument 'C' must have default copy semantics like for std::string.
Todo:
It may be better for performance if we add a new Mutex to protect the pipe specific variables.
When we use the RefObjectBase mutex we let read/write operation block simple reference copying. Reference copying must be fast since it is often done many times when passed as an argument or returned.

Definition at line 49 of file pipe.H.


Member Function Documentation

template<class C>
static void Archon::Utilities::Stream::BasicPipe< C >::make Ref< ReaderBase< C > > &  r,
Ref< WriterBase< C > > &  w,
int  bufferSize = 4096,
bool  expand = false
[inline, static]
 

Parameters:
expand If true the pipe will be able to buffer an infinite (memory limited) amount of data and the write call may be considered never to block. In this case the buffer consists of a sequence of memory chunks and 'bufferSize' specifies the chunk size.

Definition at line 58 of file pipe.H.


The documentation for this struct was generated from the following file:
Generated on Sun Jul 30 22:58:12 2006 for Archon by  doxygen 1.4.4