distortos  v0.5.0
object-oriented C++ RTOS for microcontrollers
MemcpyPushQueueFunctor.hpp
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_DISTORTOS_INTERNAL_SYNCHRONIZATION_MEMCPYPUSHQUEUEFUNCTOR_HPP_
13 #define INCLUDE_DISTORTOS_INTERNAL_SYNCHRONIZATION_MEMCPYPUSHQUEUEFUNCTOR_HPP_
14 
16 
17 #include <cstddef>
18 
19 namespace distortos
20 {
21 
22 namespace internal
23 {
24 
27 {
28 public:
29 
37  constexpr MemcpyPushQueueFunctor(const void* const data, const size_t size) :
38  data_{data},
39  size_{size}
40  {
41 
42  }
43 
50  void operator()(void* storage) const override;
51 
52 private:
53 
55  const void* const data_;
56 
58  const size_t size_;
59 };
60 
61 } // namespace internal
62 
63 } // namespace distortos
64 
65 #endif // INCLUDE_DISTORTOS_INTERNAL_SYNCHRONIZATION_MEMCPYPUSHQUEUEFUNCTOR_HPP_
const size_t size_
size of data_, bytes
Definition: MemcpyPushQueueFunctor.hpp:58
MemcpyPushQueueFunctor is a functor used for pushing of data to the raw queue with memcpy() ...
Definition: MemcpyPushQueueFunctor.hpp:26
const void *const data_
pointer to data that will be pushed to raw queue
Definition: MemcpyPushQueueFunctor.hpp:55
void operator()(void *storage) const override
Copies the data to raw queue&#39;s storage (with memcpy()).
Definition: MemcpyPushQueueFunctor.cpp:26
Top-level namespace of distortos project.
QueueFunctor class header.
QueueFunctor is a type-erased interface for functors which execute some action on queue&#39;s storage (li...
Definition: QueueFunctor.hpp:31
constexpr MemcpyPushQueueFunctor(const void *const data, const size_t size)
MemcpyPushQueueFunctor&#39;s constructor.
Definition: MemcpyPushQueueFunctor.hpp:37