distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
DynamicMessageQueue.hpp
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_DISTORTOS_DYNAMICMESSAGEQUEUE_HPP_
13 #define INCLUDE_DISTORTOS_DYNAMICMESSAGEQUEUE_HPP_
14 
15 #include "MessageQueue.hpp"
16 
18 
19 namespace distortos
20 {
21 
30 template<typename T>
32 {
33 public:
34 
36  using typename MessageQueue<T>::EntryStorage;
37 
39  using typename MessageQueue<T>::ValueStorage;
40 
47  explicit DynamicMessageQueue(size_t queueSize);
48 };
49 
50 template<typename T>
52  MessageQueue<T>{{new EntryStorage[queueSize], internal::storageDeleter<EntryStorage>},
53  {new ValueStorage[queueSize], internal::storageDeleter<ValueStorage>}, queueSize}
54 {
55 
56 }
57 
58 } // namespace distortos
59 
60 #endif // INCLUDE_DISTORTOS_DYNAMICMESSAGEQUEUE_HPP_
MessageQueue class is a message queue for thread-thread, thread-interrupt or interrupt-interrupt comm...
Definition: MessageQueue.hpp:45
internal::MessageQueueBase::ValueStorage< T > ValueStorage
type of uninitialized storage for value
Definition: MessageQueue.hpp:53
MessageQueue class header.
storageDeleter() definition
Top-level namespace of distortos project.
internal::MessageQueueBase::EntryStorage EntryStorage
type of uninitialized storage for Entry with link
Definition: MessageQueue.hpp:50
DynamicMessageQueue(size_t queueSize)
DynamicMessageQueue&#39;s constructor.
Definition: DynamicMessageQueue.hpp:51
DynamicMessageQueue class is a variant of MessageQueue that has dynamic storage for queue&#39;s contents...
Definition: DynamicMessageQueue.hpp:31