xtd 0.2.0
signal.h
Go to the documentation of this file.
1 #pragma once
5 #include "enum.h"
6 #include <csignal>
7 
9 namespace xtd {
18  enum class signal {
20  abnormal_termination = SIGABRT,
22  floating_point_exception = SIGFPE,
24  illegal_instruction = SIGILL,
26  interrupt = SIGINT,
28  segmentation_violation = SIGSEGV,
30  software_termination = SIGTERM,
31  };
32 }
33 
35 template<> struct xtd::enum_register<xtd::signal> {
36  explicit operator auto() const noexcept {return xtd::enum_collection<xtd::signal> {{xtd::signal::abnormal_termination, "abnormal_termination"}, {xtd::signal::floating_point_exception, "floating_point_exception"}, {xtd::signal::illegal_instruction, "illegal_instruction"}, {xtd::signal::interrupt, "interrupt"}, {xtd::signal::segmentation_violation, "segmentation_violation"}, {xtd::signal::software_termination, "software_termination"}};}
37 };
signal
Specifies signals that can interrupt the current process.
Definition: signal.h:18
Abnormal termination triggered by abort call. Is equal to SIGABRT.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
std::vector< std::pair< enum_t, xtd::ustring > > enum_collection
Represents a pair of an enum_t value and a string of an enum of type enum_t.
Definition: enum_collection.h:19
Invalid program image, such as invalid instruction. Is equal to SIGILL.
Contains enum_ and enum_ut_ keywords.
external interrupt, usually initiated by the user. Is equal to SIGINT.
Termination request, sent to the program. Is equal to SIGTERM.
Erroneous arithmetic operation such as divide by zero. Is equal to SIGFPE.
Invalid memory access (segmentation fault). Is equal to SIGSEGV.
Provides the registration struct for enumerations.
Definition: enum_register.h:36