SignalInformationQueue class can be used for queuing of SignalInformation objects.
More...
#include "distortos/internal/synchronization/SignalInformationQueue.hpp"
SignalInformationQueue class can be used for queuing of SignalInformation objects.
◆ List
◆ Storage
◆ StorageUniquePointer
unique_ptr (with deleter) to Storage[]
◆ SignalInformationQueue()
distortos::internal::SignalInformationQueue::SignalInformationQueue |
( |
StorageUniquePointer && |
storageUniquePointer, |
|
|
size_t |
maxElements |
|
) |
| |
SignalInformationQueue's constructor.
- Parameters
-
[in] | storageUniquePointer | is a rvalue reference to StorageUniquePointer with storage for queue elements (sufficiently large for maxElements Storage objects) and appropriate deleter |
[in] | maxElements | is the number of elements in storage array |
◆ ~SignalInformationQueue()
distortos::internal::SignalInformationQueue::~SignalInformationQueue |
( |
| ) |
|
◆ acceptQueuedSignal()
std::pair< int, SignalInformation > distortos::internal::SignalInformationQueue::acceptQueuedSignal |
( |
uint8_t |
signalNumber | ) |
|
Accepts (dequeues) one of signals that are queued.
This should be called when the signal is "accepted".
- Parameters
-
[in] | signalNumber | is the signal that will be accepted, [0; 31] |
- Returns
- pair with return code (0 on success, error code otherwise) and dequeued SignalInformation object; error codes:
- EAGAIN - no SignalInformation object with signal number equal to signalNumber was queued;
◆ canQueueSignal()
bool distortos::internal::SignalInformationQueue::canQueueSignal |
( |
| ) |
const |
|
inline |
- Returns
- true if at least one object can be queued, false otherwise
◆ getQueuedSignalSet()
SignalSet distortos::internal::SignalInformationQueue::getQueuedSignalSet |
( |
| ) |
const |
- Returns
- set of currently queued signals
◆ queueSignal()
int distortos::internal::SignalInformationQueue::queueSignal |
( |
uint8_t |
signalNumber, |
|
|
sigval |
value |
|
) |
| |
Adds the signalNumber and signal value (sigval union) to list of queued SignalInformation objects.
- Parameters
-
[in] | signalNumber | is the signal that will be queued, [0; 31] |
[in] | value | is the signal value |
- Returns
- 0 on success, error code otherwise:
- EAGAIN - no resources are available to queue the signal, maxElements signals are already queued;
- EINVAL - signalNumber value is invalid;
◆ freeSignalInformationList_
List distortos::internal::SignalInformationQueue::freeSignalInformationList_ |
|
private |
◆ signalInformationList_
List distortos::internal::SignalInformationQueue::signalInformationList_ |
|
private |
◆ storageUniquePointer_
storage for queue elements
The documentation for this class was generated from the following files: