distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
StaticRawMessageQueue.hpp
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_DISTORTOS_STATICRAWMESSAGEQUEUE_HPP_
13 #define INCLUDE_DISTORTOS_STATICRAWMESSAGEQUEUE_HPP_
14 
16 
18 
19 namespace distortos
20 {
21 
31 template<typename T, size_t QueueSize>
33 {
34 public:
35 
40  explicit StaticRawMessageQueue() :
41  RawMessageQueue{{entryStorage_.data(), internal::dummyDeleter<EntryStorage>},
42  {valueStorage_.data(), internal::dummyDeleter<ValueStorage<T>>}, sizeof(*valueStorage_.data()),
43  valueStorage_.size()}
44  {
45 
46  }
47 
48 private:
49 
51  std::array<EntryStorage, QueueSize> entryStorage_;
52 
54  std::array<ValueStorage<T>, QueueSize> valueStorage_;
55 };
56 
65 template<size_t ElementSize, size_t QueueSize>
68 
69 } // namespace distortos
70 
71 #endif // INCLUDE_DISTORTOS_STATICRAWMESSAGEQUEUE_HPP_
RawMessageQueue class is very similar to MessageQueue, but optimized for binary serializable types (l...
Definition: RawMessageQueue.hpp:33
StaticRawMessageQueue()
StaticRawMessageQueue&#39;s constructor.
Definition: StaticRawMessageQueue.hpp:40
std::array< EntryStorage, QueueSize > entryStorage_
storage for queue&#39;s entries
Definition: StaticRawMessageQueue.hpp:51
RawMessageQueue class header.
std::array< ValueStorage< T >, QueueSize > valueStorage_
storage for queue&#39;s contents
Definition: StaticRawMessageQueue.hpp:54
StaticRawMessageQueue class is a variant of RawMessageQueue that has automatic storage for queue&#39;s co...
Definition: StaticRawMessageQueue.hpp:32
Top-level namespace of distortos project.
dummyDeleter() declaration