distortos  v0.5.0
object-oriented C++ RTOS for microcontrollers
SignalAction.hpp
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_DISTORTOS_SIGNALACTION_HPP_
13 #define INCLUDE_DISTORTOS_SIGNALACTION_HPP_
14 
15 #include "distortos/SignalSet.hpp"
16 
17 namespace distortos
18 {
19 
20 class SignalInformation;
21 
31 {
32 public:
33 
35  using Handler = void(const SignalInformation&);
36 
41  constexpr SignalAction() :
43  handler_{}
44  {
45 
46  }
47 
56  constexpr SignalAction(Handler& handler, const SignalSet signalMask) :
57  signalMask_{signalMask},
59  {
60 
61  }
62 
69  {
70  return handler_;
71  }
72 
79  {
80  return signalMask_;
81  }
82 
83 private:
84 
88 
92 };
93 
94 } // namespace distortos
95 
96 #endif // INCLUDE_DISTORTOS_SIGNALACTION_HPP_
SignalSet signalMask_
Definition: SignalAction.hpp:87
void handler(const SignalInformation &signalInformation)
Signal handler.
Definition: ARMv7-M-FpuSignalTestCase.cpp:111
SignalSet class header.
SignalSet class is used as a set of signals.
Definition: SignalSet.hpp:28
Top-level namespace of distortos project.
constexpr SignalAction(Handler &handler, const SignalSet signalMask)
SignalAction's constructor.
Definition: SignalAction.hpp:56
SignalInformation class contains information about queued signal.
Definition: SignalInformation.hpp:29
constexpr SignalAction()
SignalAction's constructor which uses "default" signal handler.
Definition: SignalAction.hpp:41
Handler * getHandler() const
Definition: SignalAction.hpp:68
SignalAction class contains information needed to handle signal that was caught.
Definition: SignalAction.hpp:30
void(const SignalInformation &) Handler
handler function
Definition: SignalAction.hpp:35
Handler * handler_
Definition: SignalAction.hpp:91
SignalSet getSignalMask() const
Definition: SignalAction.hpp:78
static constexpr Empty empty
tag object to construct empty SignalSet
Definition: SignalSet.hpp:48