A Reader is used to read items from a Channel.
More...
#include <cpp/symbian/concurrency/common/thread/channel.h>
template<class T>
class thread::Reader< T >
A Reader is used to read items from a Channel.
You can get a pointer to a Reader by calling Channel<T>::reader(), which is the object that you should pass to code that needs to read from the channel.
◆ Reader() [1/2]
◆ Reader() [2/2]
◆ OnRead() [1/2]
Returns a Case that can be used to wait for and synchronise on reading an item from the channel.
- Note
- The item is only read out of the channel if the returned Case is selected. For example:
std::string item;
bool ok;
reader->OnRead(&item, &ok),
});
if (selected == 0) {
assert(!ok);
assert(item.empty());
}
Case OnCancel()
Definition fiber.cc:294
int Select(const CaseArray &cases)
Returns the index of the first case that is ready, blocking until one is.
Definition select.h:18
- Returns
- True if an item was read from the channel, false if the channel was closed before or while reading.
◆ OnRead() [2/2]
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ Read() [1/2]
Reads an item from the channel, blocking until it can be read.
Returns false if and only if the channel is closed.
On returning true, the item is moved into the provided pointer.
- Returns
- True if an item was read from the channel, false if the channel was closed before or while reading.
◆ Read() [2/2]
◆ Channel< T >
The documentation for this class was generated from the following files:
- cpp/symbian/concurrency/common/thread/channel.h
- cpp/symbian/concurrency/guest/thread/channel.h