Channel< T > Class Template Reference

Channels can be used for micorthreads to communicate. More...

#include <channel_decls.h>

Inheritance diagram for Channel< T >:

BaseChannel List of all members.

Public Member Functions

 Channel (ChannelManager &m)
 Channel constructor.
void send (T data)
 Sends a message to this channel.
receive ()
 Receives the next (chronological) message from this channel.
bool isempty () const
 Checks whether there are messages waiting to be delivered.

Detailed Description

template<class T>
class Channel< T >

Channels can be used for micorthreads to communicate.

They must be registered with a ChannelManager.


Constructor & Destructor Documentation

template<class T>
Channel< T >::Channel ( ChannelManager m  )  [inline]

Channel constructor.

Parameters:
m is the ChannelManager to register with.


Member Function Documentation

template<class T>
void Channel< T >::send ( data  ) 

Sends a message to this channel.

Any microthread may invoke this method at any time.

Parameters:
data is the message to be sent

template<class T>
T Channel< T >::receive (  ) 

Receives the next (chronological) message from this channel.

Only the microthread owning the corresponding manager may invoke this method.

Returns:
the message

template<class T>
bool Channel< T >::isempty (  )  const [inline]

Checks whether there are messages waiting to be delivered.

This operation is not locked as it is used internally.

Returns:
true if there are no messages waiting


The documentation for this class was generated from the following files:
Generated on Sat Feb 7 01:26:51 2009 by  doxygen 1.5.1