distortos  v0.5.0
object-oriented C++ RTOS for microcontrollers
SignalInformation.hpp
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_DISTORTOS_SIGNALINFORMATION_HPP_
13 #define INCLUDE_DISTORTOS_SIGNALINFORMATION_HPP_
14 
15 #include <csignal>
16 #include <cstdint>
17 
18 namespace distortos
19 {
20 
30 {
31 public:
32 
34  enum class Code : uint8_t
35  {
38  generated,
40  queued,
41  };
42 
51  constexpr SignalInformation(const uint8_t signalNumber, const Code code, const sigval value) :
52  value_(value),
53  code_{code},
54  signalNumber_{signalNumber}
55  {
56 
57  }
58 
63  Code getCode() const
64  {
65  return code_;
66  }
67 
72  uint8_t getSignalNumber() const
73  {
74  return signalNumber_;
75  }
76 
81  sigval getValue() const
82  {
83  return value_;
84  }
85 
86 private:
87 
90 
93 
95  uint8_t signalNumber_;
96 };
97 
98 } // namespace distortos
99 
100 #endif // INCLUDE_DISTORTOS_SIGNALINFORMATION_HPP_
signal queued by Thread::queueSignal() or ThisThread::Signals::queueSignal() (similar to SI_QUEUE) ...
Code
replacement for predefined si_code values
Definition: SignalInformation.hpp:34
Definition: signal.h:28
Code getCode() const
Definition: SignalInformation.hpp:63
sigval getValue() const
Definition: SignalInformation.hpp:81
uint8_t signalNumber_
signal number (similar to si_signo member of siginfo_t)
Definition: SignalInformation.hpp:95
Top-level namespace of distortos project.
uint8_t getSignalNumber() const
Definition: SignalInformation.hpp:72
Code code_
signal code (similar to si_code member of siginfo_t)
Definition: SignalInformation.hpp:92
SignalInformation class contains information about queued signal.
Definition: SignalInformation.hpp:29
constexpr SignalInformation(const uint8_t signalNumber, const Code code, const sigval value)
SignalInformation&#39;s constructor.
Definition: SignalInformation.hpp:51
sigval value_
signal value (similar to si_value member of siginfo_t)
Definition: SignalInformation.hpp:89