csp::common::ExtSyncId< DATA_TYPE > Class Template Reference

Inheritance diagram for csp::common::ExtSyncId< DATA_TYPE >:

csp::CSProcess csp::ThreadCSProcess boost::noncopyable List of all members.

Detailed Description

template<typename DATA_TYPE>
class csp::common::ExtSyncId< DATA_TYPE >

A process that forever performs an extended input from a channel, and for its extended action: syncs on a barrier and then sends the data out on another channel.

Just to be clear: both the barrier sync and the channel output are part of the extended action, and happen in the order: sync, write.

This can be useful when you want to have an invisible process connecting two channels, but only allow data to proceed along a channel when a barrier sync occurs, or to look at it from another perspective, to only allow a barrier to sync when data passes along the channel.

For reasons similar to the BarrierSyncer process, you will probably want to give this process a pre-enrolled end of the barrier.

To use this process, you will need to include <cppcsp/common/basic.h>

DATA_TYPE Requirements

DATA_TYPE must have a default constructor, and must meet the requirements of the channels it is being used with.


Public Member Functions

 ExtSyncId (const Chanin< DATA_TYPE > &_in, const Chanout< DATA_TYPE > &_out, const Mobile< BarrierEnd > &_end)
 Constructs the ExtSyncId process.

Protected Member Functions

void run ()
 You must implement this function to provide the code for your process.


Constructor & Destructor Documentation

template<typename DATA_TYPE>
csp::common::ExtSyncId< DATA_TYPE >::ExtSyncId ( const Chanin< DATA_TYPE > &  _in,
const Chanout< DATA_TYPE > &  _out,
const Mobile< BarrierEnd > &  _end 
) [inline]

Constructs the ExtSyncId process.

Parameters:
_in The input channel
_out The output channel
_end The barrier end


Member Function Documentation

template<typename DATA_TYPE>
void csp::common::ExtSyncId< 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.


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