csp::WhiteHoleChannel< DATA_TYPE > Class Template Reference
[Channels]

List of all members.

Detailed Description

template<typename DATA_TYPE>
class csp::WhiteHoleChannel< DATA_TYPE >

A "none-to-one" channel.

This channel is the reverse of the BlackHoleChannel, as its name suggests. Where the BlackHoleChannel discards all data written to it, the WhiteHoleChannel forever produces the same piece of data for every read. An ALT guard for the WhiteHoleChannel is always ready immediately.

The white-hole channel can be useful when you want a process to always be able to read from a particular channel. It is particularly useful for testing processes.

It should only be used by one reader. The channel does support poison - although only the reader can poison it or detect the poison, so it is fairly useless.

DATA_TYPE Requirements

DATA_TYPE* and DATA_TYPE& must be valid types; DATA_TYPE cannot be a reference. DATA_TYPE must have an available copy constructor, and must support assignment.


Public Member Functions

AltChanin< DATA_TYPE > reader ()
 Gets a reading end of the channel.
 WhiteHoleChannel (const DATA_TYPE &_data)
 Constructs a channel that forever outputs the specified value.


Constructor & Destructor Documentation

template<typename DATA_TYPE>
csp::WhiteHoleChannel< DATA_TYPE >::WhiteHoleChannel ( const DATA_TYPE &  _data  )  [inline, explicit]

Constructs a channel that forever outputs the specified value.

Parameters:
_data The value to always output on the channel


Member Function Documentation

template<typename DATA_TYPE>
AltChanin<DATA_TYPE> csp::WhiteHoleChannel< DATA_TYPE >::reader (  )  [inline]

Gets a reading end of the channel.


Generated on Mon Aug 20 12:24:29 2007 for C++CSP2 by  doxygen 1.4.7