A channel buffer is a sub-class of ChannelBuffer, and provides a buffering strategy for a buffered channel.
Currently three buffers are provided with the library: limited-size FIFO buffering (FIFOBuffer), unlimited-size FIFO buffering (InfiniteFIFOBuffer) and limited-size overwriting FIFO buffering (OverwritingBuffer).
Channel buffers are provided to buffered channels via channel buffer factories. This ensures that the same channel buffer is not accidentally used with multiple channels, as each buffered channel asks the factory for a separate buffer. A channel buffer factory is a sub-class of ChannelBufferFactory.
C++CSP v1.x Compatibility:
ZeroBuffer has been removed in C++CSP2. ZeroBuffer did not actually have correct semantics, and so has been removed. If you wish to change between buffered and unbuffered channels easily, consider using a ChannelFactory.
In C++CSP v1.x, channel buffers provided the clone method to ensure that the same buffer was not used by two different channels. This has been replaced by channel buffer factories in C++CSP2, that remove the need to create a fully-fledged buffer just to pass to buffered channels to be cloned. The channel factories are a lower-overhead cleaner way of accomplishing the same thing.
Classes | |
class | csp::ChannelBuffer< DATA_TYPE > |
The base class for channel buffers. More... | |
class | csp::ChannelBufferFactory< DATA_TYPE > |
The base class for all the channel buffer factories. More... | |
class | csp::ChannelBufferFactoryImpl< DATA_TYPE, BUFFER_TYPE > |
A default implementation of ChannelBufferFactory for use with buffers that have default constructors. More... | |
class | csp::FIFOBuffer< DATA_TYPE, _LIST_DATA_TYPE > |
A FIFO buffer with a fixed maximum capacity. More... | |
class | csp::InfiniteFIFOBuffer< DATA_TYPE > |
A FIFO buffer of unlimited capacity. More... | |
class | csp::OverwritingBuffer< DATA_TYPE, _LIST_DATA_TYPE > |
An overwriting FIFO buffer. More... | |
class | csp::SizedChannelBufferFactoryImpl< DATA_TYPE, BUFFER_TYPE > |
A default implementation of ChannelBufferFactory for use with buffers that have constructors that take a size argument. More... |