distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
SignalInformationQueue.hpp
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_DISTORTOS_INTERNAL_SYNCHRONIZATION_SIGNALINFORMATIONQUEUE_HPP_
13 #define INCLUDE_DISTORTOS_INTERNAL_SYNCHRONIZATION_SIGNALINFORMATIONQUEUE_HPP_
14 
16 
18 
19 #include <memory>
20 
21 namespace distortos
22 {
23 
24 class SignalSet;
25 
26 namespace internal
27 {
28 
31 {
32 public:
33 
35  struct QueueNode
36  {
39 
42  };
43 
45  using Storage = typename std::aligned_storage<sizeof(QueueNode), alignof(QueueNode)>::type;
46 
48  using StorageUniquePointer = std::unique_ptr<Storage[], void(&)(Storage*)>;
49 
58  SignalInformationQueue(StorageUniquePointer&& storageUniquePointer, size_t maxElements);
59 
65 
78  std::pair<int, SignalInformation> acceptQueuedSignal(uint8_t signalNumber);
79 
85 
97  int queueSignal(uint8_t signalNumber, sigval value);
98 
101  const SignalInformationQueue& operator=(const SignalInformationQueue&) = delete;
102  SignalInformationQueue& operator=(SignalInformationQueue&&) = delete;
103 
104 private:
105 
108 
111 
114 
117 };
118 
119 } // namespace internal
120 
121 } // namespace distortos
122 
123 #endif // INCLUDE_DISTORTOS_INTERNAL_SYNCHRONIZATION_SIGNALINFORMATIONQUEUE_HPP_
SignalInformation signalInformation
queued SignalInformation
Definition: SignalInformationQueue.hpp:41
Definition: signal.h:28
std::pair< int, SignalInformation > acceptQueuedSignal(uint8_t signalNumber)
Accepts (dequeues) one of signals that are queued.
Definition: SignalInformationQueue.cpp:45
single node of internal forward list - estd::IntrusiveForwardListNode and SignalInformation ...
Definition: SignalInformationQueue.hpp:35
StorageUniquePointer storageUniquePointer_
storage for queue elements
Definition: SignalInformationQueue.hpp:110
IntrusiveForwardListNode class is the node that is needed for the object to be linked in IntrusiveFor...
Definition: IntrusiveForwardList.hpp:38
List signalInformationList_
list of queued SignalInformation objects
Definition: SignalInformationQueue.hpp:113
typename std::aligned_storage< sizeof(QueueNode), alignof(QueueNode)>::type Storage
type of uninitialized storage for QueueNode
Definition: SignalInformationQueue.hpp:45
SignalSet class is used as a set of signals.
Definition: SignalSet.hpp:28
Top-level namespace of distortos project.
IntrusiveForwardList template class header.
SignalInformationQueue(StorageUniquePointer &&storageUniquePointer, size_t maxElements)
SignalInformationQueue&#39;s constructor.
Definition: SignalInformationQueue.cpp:28
std::unique_ptr< Storage[], void(&)(Storage *)> StorageUniquePointer
unique_ptr (with deleter) to Storage[]
Definition: SignalInformationQueue.hpp:48
~SignalInformationQueue()
SignalInformationQueue&#39;s destructor.
Definition: SignalInformationQueue.cpp:40
SignalInformationQueue class can be used for queuing of SignalInformation objects.
Definition: SignalInformationQueue.hpp:30
SignalInformation class contains information about queued signal.
Definition: SignalInformation.hpp:29
SignalInformation class header.
estd::IntrusiveForwardListNode node
node for intrusive forward list
Definition: SignalInformationQueue.hpp:38
int queueSignal(uint8_t signalNumber, sigval value)
Adds the signalNumber and signal value (sigval union) to list of queued SignalInformation objects...
Definition: SignalInformationQueue.cpp:75
SignalSet getQueuedSignalSet() const
Definition: SignalInformationQueue.cpp:67
List freeSignalInformationList_
list of "free" SignalInformation objects
Definition: SignalInformationQueue.hpp:116