Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/asio/signal_set_base.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // signal_set_base.hpp
0003 // ~~~~~~~~~~~~~~~~~~~
0004 //
0005 // Copyright (c) 2003-2025 Christopher M. Kohlhoff (chris at kohlhoff dot com)
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009 //
0010 
0011 #ifndef BOOST_ASIO_SIGNAL_SET_BASE_HPP
0012 #define BOOST_ASIO_SIGNAL_SET_BASE_HPP
0013 
0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0015 # pragma once
0016 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
0017 
0018 #include <boost/asio/detail/config.hpp>
0019 #include <boost/asio/detail/socket_types.hpp>
0020 
0021 #include <boost/asio/detail/push_options.hpp>
0022 
0023 namespace boost {
0024 namespace asio {
0025 
0026 /// The signal_set_base class is used as a base for the basic_signal_set class
0027 /// templates so that we have a common place to define the flags enum.
0028 class signal_set_base
0029 {
0030 public:
0031 # if defined(GENERATING_DOCUMENTATION)
0032   /// Enumeration representing the different types of flags that may specified
0033   /// when adding a signal to a set.
0034   enum flags
0035   {
0036     /// Bitmask representing no flags.
0037     none = 0,
0038 
0039     /// Affects the behaviour of interruptible functions such that, if the
0040     /// function would have failed with error::interrupted when interrupted by
0041     /// the specified signal, the function shall instead be restarted and not
0042     /// fail with error::interrupted.
0043     restart = implementation_defined,
0044 
0045     /// Do not generate SIGCHLD when child processes stop or stopped child
0046     /// processes continue.
0047     no_child_stop = implementation_defined,
0048 
0049     /// Do not transform child processes into zombies when they terminate.
0050     no_child_wait = implementation_defined,
0051 
0052     /// Special value to indicate that the signal registration does not care
0053     /// which flags are set, and so will not conflict with any prior
0054     /// registrations of the same signal.
0055     dont_care = -1
0056   };
0057 
0058   /// Portability typedef.
0059   typedef flags flags_t;
0060 
0061 #else // defined(GENERATING_DOCUMENTATION)
0062 
0063   enum class flags : int
0064   {
0065     none = 0,
0066     restart = BOOST_ASIO_OS_DEF(SA_RESTART),
0067     no_child_stop = BOOST_ASIO_OS_DEF(SA_NOCLDSTOP),
0068     no_child_wait = BOOST_ASIO_OS_DEF(SA_NOCLDWAIT),
0069     dont_care = -1
0070   };
0071 
0072   typedef flags flags_t;
0073 
0074 #endif // defined(GENERATING_DOCUMENTATION)
0075 
0076 protected:
0077   /// Protected destructor to prevent deletion through this type.
0078   ~signal_set_base()
0079   {
0080   }
0081 };
0082 
0083 /// Negation operator.
0084 /**
0085  * @relates signal_set_base::flags
0086  */
0087 inline constexpr bool operator!(signal_set_base::flags_t x)
0088 {
0089   return static_cast<int>(x) == 0;
0090 }
0091 
0092 /// Bitwise and operator.
0093 /**
0094  * @relates signal_set_base::flags
0095  */
0096 inline constexpr signal_set_base::flags_t operator&(
0097     signal_set_base::flags_t x, signal_set_base::flags_t y)
0098 {
0099   return static_cast<signal_set_base::flags_t>(
0100       static_cast<int>(x) & static_cast<int>(y));
0101 }
0102 
0103 /// Bitwise or operator.
0104 /**
0105  * @relates signal_set_base::flags
0106  */
0107 inline constexpr signal_set_base::flags_t operator|(
0108     signal_set_base::flags_t x, signal_set_base::flags_t y)
0109 {
0110   return static_cast<signal_set_base::flags_t>(
0111       static_cast<int>(x) | static_cast<int>(y));
0112 }
0113 
0114 /// Bitwise xor operator.
0115 /**
0116  * @relates signal_set_base::flags
0117  */
0118 inline constexpr signal_set_base::flags_t operator^(
0119     signal_set_base::flags_t x, signal_set_base::flags_t y)
0120 {
0121   return static_cast<signal_set_base::flags_t>(
0122       static_cast<int>(x) ^ static_cast<int>(y));
0123 }
0124 
0125 /// Bitwise negation operator.
0126 /**
0127  * @relates signal_set_base::flags
0128  */
0129 inline constexpr signal_set_base::flags_t operator~(
0130     signal_set_base::flags_t x)
0131 {
0132   return static_cast<signal_set_base::flags_t>(~static_cast<int>(x));
0133 }
0134 
0135 /// Bitwise and-assignment operator.
0136 /**
0137  * @relates signal_set_base::flags
0138  */
0139 inline signal_set_base::flags_t& operator&=(
0140     signal_set_base::flags_t& x, signal_set_base::flags_t y)
0141 {
0142   x = x & y;
0143   return x;
0144 }
0145 
0146 /// Bitwise or-assignment operator.
0147 /**
0148  * @relates signal_set_base::flags
0149  */
0150 inline signal_set_base::flags_t& operator|=(
0151     signal_set_base::flags_t& x, signal_set_base::flags_t y)
0152 {
0153   x = x | y;
0154   return x;
0155 }
0156 
0157 /// Bitwise xor-assignment operator.
0158 /**
0159  * @relates signal_set_base::flags
0160  */
0161 inline signal_set_base::flags_t& operator^=(
0162     signal_set_base::flags_t& x, signal_set_base::flags_t y)
0163 {
0164   x = x ^ y;
0165   return x;
0166 }
0167 
0168 } // namespace asio
0169 } // namespace boost
0170 
0171 #include <boost/asio/detail/pop_options.hpp>
0172 
0173 #endif // BOOST_ASIO_SIGNAL_SET_BASE_HPP