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.
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. |
csp::WhiteHoleChannel< DATA_TYPE >::WhiteHoleChannel | ( | const DATA_TYPE & | _data | ) | [inline, explicit] |
Constructs a channel that forever outputs the specified value.
_data | The value to always output on the channel |
AltChanin<DATA_TYPE> csp::WhiteHoleChannel< DATA_TYPE >::reader | ( | ) | [inline] |
Gets a reading end of the channel.