F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
CountingSemaphoreInterface.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title Os/Interfaces/CountingSemaphoreInterface.hpp
3 // \brief pure-virtual interface implemented by Os::CountingSemaphore implementations
4 // ======================================================================
5 #ifndef OS_INTERFACES_COUNTINGSEMAPHOREINTERFACE_HPP_
6 #define OS_INTERFACES_COUNTINGSEMAPHOREINTERFACE_HPP_
7 
9 
10 namespace Os {
11 
13  public:
15  CountingSemaphoreInterface() = default;
16 
18  virtual ~CountingSemaphoreInterface() = default;
19 
22 
25 
28  virtual Status wait() = 0;
29 
33  virtual Status waitTimeout(const Fw::TimeInterval& interval) = 0;
34 
37  virtual Status tryWait() = 0;
38 
41  virtual Status post() = 0;
42 
45  virtual CountingSemaphoreHandle* getHandle() = 0;
46 };
47 
48 } // namespace Os
49 
50 #endif // OS_INTERFACES_COUNTINGSEMAPHOREINTERFACE_HPP_
CountingSemaphoreInterface()=default
default constructor
virtual ~CountingSemaphoreInterface()=default
default virtual destructor
types and constants shared by users of Os::CountingSemaphore and by its implementations ...
CountingSemaphoreInterface & operator=(const CountingSemaphoreInterface &other)=delete
assignment operator is forbidden
virtual Status tryWait()=0
non-blocking attempt to decrement the semaphore
virtual Status waitTimeout(const Fw::TimeInterval &interval)=0
wait on the semaphore with a timeout
virtual Status post()=0
post (increment) the semaphore, potentially waking a waiting thread
virtual Status wait()=0
wait (decrement) the semaphore, blocking if count is zero
virtual CountingSemaphoreHandle * getHandle()=0
return the underlying semaphore handle (implementation specific)