|
CoreComponents 3.0.0
A Modern C++ Toolkit
|
Thread communication channel More...
#include <cc/Channel>
Public Types | |
| using | Item = T |
| Item type. | |
Public Member Functions | |
| Channel ()=default | |
| Create a new channel. | |
| bool | pushBack (const T &item) |
| Add a new item to the end. | |
| bool | pushFront (const T &item) |
| Add a new item to the front. | |
| bool | pushExclusive (const T &item) |
| Add a new item after removing all existing items. | |
| template<class... Args> | |
| bool | emplaceBack (Args... args) |
| Add a new item to the end. | |
| template<class... Args> | |
| bool | emplaceFront (Args... args) |
| Add a new item to the front. | |
| template<class... Args> | |
| bool | emplaceExclusive (Args... args) |
| Add a new item after replacing all existing items. | |
| bool | popBack (Out< T > item=None{}) |
| Remove an item from the end. | |
| bool | popFront (Out< T > item=None{}) |
| Remove an item from the front. | |
| bool | read (Out< T > item) |
| Remove an item from the front. | |
| bool | write (const T &item) |
| Add a new item to the end. | |
| Channel & | operator<< (const Item &item) |
| Add a new item to the end. | |
| Channel & | operator>> (Item &item) |
| Remove an item from the front. | |
| bool | wait () |
| Wait for the channel to become ready to read. | |
| bool | waitUntil (double time) |
| Wait for the channel to become ready to read for a limited time. | |
| bool | popBackBefore (double time, Out< T > item=None{}) |
| Remove an item from the end of the queue before given time. | |
| bool | popFrontBefore (double time, Out< T > item=None{}) |
| Remove an item from the head of the queue before given time. | |
| long | count () const |
| Get the number of queued items. | |
| void | close () |
| Close for writing. | |
| void | shutdown () |
| Shutdown communication: close for reading and writing and discard all intermediate data. | |
| SourceIterator< Channel > | begin () |
| Iteration start. | |
| SourceIterator< Channel > | end () |
| Iteration end. | |
Thread communication channel
| T | Item type |
| using Item = T |
Item type.
|
default |
Create a new channel.
| bool pushBack | ( | const T & | item | ) |
Add a new item to the end.
| item | Item value |
| bool pushFront | ( | const T & | item | ) |
Add a new item to the front.
| item | Item value |
| bool pushExclusive | ( | const T & | item | ) |
Add a new item after removing all existing items.
| item | Item value |
| bool emplaceBack | ( | Args... | args | ) |
Add a new item to the end.
| Args | Construction argument types |
| args | Construction arguments |
| bool emplaceFront | ( | Args... | args | ) |
Add a new item to the front.
| Args | Construction argument types |
| args | Construction arguments |
| bool emplaceExclusive | ( | Args... | args | ) |
Add a new item after replacing all existing items.
| Args | Construction argument types |
| args | Construction arguments |
Remove an item from the end.
| item | Returns the item value |
Remove an item from the front.
| item | Returns the item value |
| bool read | ( | Out< T > | item | ) |
Remove an item from the front.
| item | Returns the item value |
| bool write | ( | const T & | item | ) |
Add a new item to the end.
| item | Item value |
Add a new item to the end.
| item | Item value |
Remove an item from the front.
| item | Returns the item value |
| bool wait | ( | ) |
Wait for the channel to become ready to read.
| bool waitUntil | ( | double | time | ) |
Wait for the channel to become ready to read for a limited time.
| time | Seconds elapsed since the begin of Epoch |
Remove an item from the end of the queue before given time.
| time | Seconds elapsed since the begin of Epoch |
| item | Returns the item value |
Remove an item from the head of the queue before given time.
| time | Seconds elapsed since the begin of Epoch |
| item | Returns the item value |
| long count | ( | ) | const |
Get the number of queued items.
| void close | ( | ) |
Close for writing.
| void shutdown | ( | ) |
Shutdown communication: close for reading and writing and discard all intermediate data.
| SourceIterator< Channel > begin | ( | ) |
Iteration start.
| SourceIterator< Channel > end | ( | ) |
Iteration end.