distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
StaticRawFifoQueue.hpp
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_DISTORTOS_STATICRAWFIFOQUEUE_HPP_
13 #define INCLUDE_DISTORTOS_STATICRAWFIFOQUEUE_HPP_
14 
15 #include "RawFifoQueue.hpp"
16 
18 
19 namespace distortos
20 {
21 
31 template<typename T, size_t QueueSize>
33 {
34 public:
35 
37  using Storage = typename std::aligned_storage<sizeof(T), alignof(T)>::type;
38 
43  explicit StaticRawFifoQueue() :
44  RawFifoQueue{{storage_.data(), internal::dummyDeleter<Storage>}, sizeof(*storage_.data()), storage_.size()}
45  {
46 
47  }
48 
49 private:
50 
52  std::array<Storage, QueueSize> storage_;
53 };
54 
63 template<size_t ElementSize, size_t QueueSize>
66 
67 } // namespace distortos
68 
69 #endif // INCLUDE_DISTORTOS_STATICRAWFIFOQUEUE_HPP_
RawFifoQueue class is very similar to FifoQueue, but optimized for binary serializable types (like PO...
Definition: RawFifoQueue.hpp:30
RawFifoQueue class header.
Top-level namespace of distortos project.
StaticRawFifoQueue class is a variant of RawFifoQueue that has automatic storage for queue&#39;s contents...
Definition: StaticRawFifoQueue.hpp:32
typename std::aligned_storage< sizeof(OperationCountingType::Value), alignof(OperationCountingType::Value)>::type Storage
type of uninitialized storage for data
Definition: StaticRawFifoQueue.hpp:37
StaticRawFifoQueue()
StaticRawFifoQueue&#39;s constructor.
Definition: StaticRawFifoQueue.hpp:43
dummyDeleter() declaration
std::array< Storage, QueueSize > storage_
storage for queue&#39;s contents
Definition: StaticRawFifoQueue.hpp:52