#include <DataChannels.h>
|
| virtual | ~DataChannels ()=default |
| |
| bool | open (T_channel channel, size_t limit) |
| | Creates a new data channel with the specified capacity.
|
| |
| bool | close (T_channel channel) |
| | Removes an existing channel and frees associated resources.
|
| |
| bool | send (T_channel channel, T_data data) |
| | Sends data to the specified channel.
|
| |
| T_data | receive (T_channel channel) |
| | Retrieves and removes the oldest data from the specified channel.
|
| |
| bool | isEmpty (T_channel channel) |
| | Checks if a channel has no data available.
|
| |
◆ ~DataChannels()
template<class T_channel, class T_data>
◆ close()
template<class T_channel, class T_data>
Removes an existing channel and frees associated resources.
- Parameters
-
| channel | The identifier of the channel to close |
- Return values
-
| true | If the channel was successfully closed |
| false | If the channel doesn't exist |
◆ isEmpty()
template<class T_channel, class T_data>
Checks if a channel has no data available.
- Parameters
-
| channel | The identifier of the channel to check |
- Return values
-
| true | If the channel is empty or doesn't exist |
| false | If the channel exists and contains data |
◆ open()
template<class T_channel, class T_data>
Creates a new data channel with the specified capacity.
- Parameters
-
| channel | The unique identifier for the channel |
| limit | The maximum number of data items the channel can hold |
- Return values
-
| true | If the channel was successfully created |
| false | If a channel with the same identifier already exists |
◆ receive()
template<class T_channel, class T_data>
Retrieves and removes the oldest data from the specified channel.
- Parameters
-
| channel | The identifier of the source channel |
- Return values
-
| T_data | The retrieved data, or an empty/default data object if the channel doesn't exist or is empty |
◆ send()
template<class T_channel, class T_data>
Sends data to the specified channel.
If the channel is full, the oldest data will be overwritten.
- Parameters
-
| channel | The identifier of the destination channel |
| data | The data to send |
- Return values
-
| true | If the data was successfully sent |
| false | If the channel doesn't exist |
The documentation for this class was generated from the following files: