distortos  v0.5.0
object-oriented C++ RTOS for microcontrollers
StaticMessageQueue.hpp
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_DISTORTOS_STATICMESSAGEQUEUE_HPP_
13 #define INCLUDE_DISTORTOS_STATICMESSAGEQUEUE_HPP_
14 
15 #include "MessageQueue.hpp"
16 
18 
19 namespace distortos
20 {
21 
31 template<typename T, size_t QueueSize>
33 {
34 public:
35 
37  using typename MessageQueue<T>::EntryStorage;
38 
40  using typename MessageQueue<T>::ValueStorage;
41 
46  explicit StaticMessageQueue() :
47  MessageQueue<T>{{entryStorage_.data(), internal::dummyDeleter<EntryStorage>},
48  {valueStorage_.data(), internal::dummyDeleter<ValueStorage>}, valueStorage_.size()}
49  {
50 
51  }
52 
53 private:
54 
56  std::array<EntryStorage, QueueSize> entryStorage_;
57 
59  std::array<ValueStorage, QueueSize> valueStorage_;
60 };
61 
62 } // namespace distortos
63 
64 #endif // INCLUDE_DISTORTOS_STATICMESSAGEQUEUE_HPP_
MessageQueue class is a message queue for thread-thread, thread-interrupt or interrupt-interrupt comm...
Definition: MessageQueue.hpp:46
internal::MessageQueueBase::ValueStorage< T > ValueStorage
type of uninitialized storage for value
Definition: MessageQueue.hpp:54
MessageQueue class header.
Top-level namespace of distortos project.
internal::MessageQueueBase::EntryStorage EntryStorage
type of uninitialized storage for Entry with link
Definition: MessageQueue.hpp:51
StaticMessageQueue class is a variant of MessageQueue that has automatic storage for queue&#39;s contents...
Definition: StaticMessageQueue.hpp:32
StaticMessageQueue()
StaticMessageQueue&#39;s constructor.
Definition: StaticMessageQueue.hpp:46
std::array< ValueStorage, QueueSize > valueStorage_
storage for queue&#39;s contents
Definition: StaticMessageQueue.hpp:49
dummyDeleter() declaration