Inheritance diagram for csp::common::ReaderProcess< DATA_TYPE >:
Nothing is done with the values; it is as if they vanish. Therefore this process is only really for absorbing values you don't want from a channel. It is also used for testing C++CSP2.
When the process has completed the specified number of reads, it simply finishes. It does not poison the channel. If you want to poison the channel afterwards, consider using something like this:
Run( InSequenceOneThread(new ReaderProcess<int>(in,7)) (new ChannelPoisoner(in)) );
To use this process, you will need to include <cppcsp/common/basic.h>
Public Member Functions | |
ReaderProcess (const Chanin< DATA_TYPE > &_in, int _times=1) | |
Constructs the process. | |
Protected Member Functions | |
void | run () |
You must implement this function to provide the code for your process. |
csp::common::ReaderProcess< DATA_TYPE >::ReaderProcess | ( | const Chanin< DATA_TYPE > & | _in, | |
int | _times = 1 | |||
) | [inline, explicit] |
Constructs the process.
_in | The channel to read from | |
_times | The number of times to read from the channel. Defaults to one. |
void csp::common::ReaderProcess< DATA_TYPE >::run | ( | ) | [inline, protected, virtual] |
You must implement this function to provide the code for your process.
When the run method finishes, the process will terminate.
You should not let an uncaught exception cause the end of this function. If it derives from std::exception, it will be caught (although this behaviour should not be relied upon) but otherwise undefined behaviour will result.
Implements csp::ThreadCSProcess.