distortos  v0.5.0
object-oriented C++ RTOS for microcontrollers
StaticFifoQueue.hpp
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_DISTORTOS_STATICFIFOQUEUE_HPP_
13 #define INCLUDE_DISTORTOS_STATICFIFOQUEUE_HPP_
14 
15 #include "FifoQueue.hpp"
16 
18 
19 namespace distortos
20 {
21 
31 template<typename T, size_t QueueSize>
32 class StaticFifoQueue : public FifoQueue<T>
33 {
34 public:
35 
37  using typename FifoQueue<T>::Storage;
38 
43  explicit StaticFifoQueue() :
44  FifoQueue<T>{{storage_.data(), internal::dummyDeleter<Storage>}, storage_.size()}
45  {
46 
47  }
48 
49 private:
50 
52  std::array<Storage, QueueSize> storage_;
53 };
54 
55 } // namespace distortos
56 
57 #endif // INCLUDE_DISTORTOS_STATICFIFOQUEUE_HPP_
StaticFifoQueue class is a variant of FifoQueue that has automatic storage for queue&#39;s contents...
Definition: StaticFifoQueue.hpp:32
typename std::aligned_storage< sizeof(T), alignof(T)>::type Storage
type of uninitialized storage for data
Definition: FifoQueue.hpp:49
FifoQueue class is a simple FIFO queue for thread-thread, thread-interrupt or interrupt-interrupt com...
Definition: FifoQueue.hpp:44
Top-level namespace of distortos project.
StaticFifoQueue()
StaticFifoQueue&#39;s constructor.
Definition: StaticFifoQueue.hpp:43
FifoQueue class header.
dummyDeleter() declaration