distortos  v0.5.0
object-oriented C++ RTOS for microcontrollers
SemaphoreTryWaitUntilFunctor.hpp
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_DISTORTOS_INTERNAL_SYNCHRONIZATION_SEMAPHORETRYWAITUNTILFUNCTOR_HPP_
13 #define INCLUDE_DISTORTOS_INTERNAL_SYNCHRONIZATION_SEMAPHORETRYWAITUNTILFUNCTOR_HPP_
14 
16 
17 #include "distortos/TickClock.hpp"
18 
19 namespace distortos
20 {
21 
22 namespace internal
23 {
24 
28 {
29 public:
30 
37  constexpr explicit SemaphoreTryWaitUntilFunctor(const TickClock::time_point timePoint) :
38  timePoint_{timePoint}
39  {
40 
41  }
42 
51  int operator()(Semaphore& semaphore) const override;
52 
53 private:
54 
57 };
58 
59 } // namespace internal
60 
61 } // namespace distortos
62 
63 #endif // INCLUDE_DISTORTOS_INTERNAL_SYNCHRONIZATION_SEMAPHORETRYWAITUNTILFUNCTOR_HPP_
Semaphore is the basic synchronization primitive.
Definition: Semaphore.hpp:30
std::chrono::time_point< TickClock > time_point
basic time_point type of clock
Definition: TickClock.hpp:42
TickClock class header.
constexpr SemaphoreTryWaitUntilFunctor(const TickClock::time_point timePoint)
SemaphoreTryWaitUntilFunctor&#39;s constructor.
Definition: SemaphoreTryWaitUntilFunctor.hpp:37
Definition: SemaphoreTryWaitUntilFunctor.hpp:27
Top-level namespace of distortos project.
int operator()(Semaphore &semaphore) const override
Calls Semaphore::tryWaitUntil() with bound time point.
Definition: SemaphoreTryWaitUntilFunctor.cpp:26
SemaphoreFunctor is a type-erased interface for functors which execute some action on semaphore (wait...
Definition: SemaphoreFunctor.hpp:34
SemaphoreFunctor class header.
const TickClock::time_point timePoint_
bound time point for Semaphore::tryWaitUntil() call
Definition: SemaphoreTryWaitUntilFunctor.hpp:56