Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //
0002 // cancellation_type.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_CANCELLATION_TYPE_HPP
0012 #define BOOST_ASIO_CANCELLATION_TYPE_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 
0020 #include <boost/asio/detail/push_options.hpp>
0021 
0022 namespace boost {
0023 namespace asio {
0024 
0025 # if defined(GENERATING_DOCUMENTATION)
0026 
0027 /// Enumeration representing the different types of cancellation that may
0028 /// be requested from or implemented by an asynchronous operation.
0029 enum cancellation_type
0030 {
0031   /// Bitmask representing no types of cancellation.
0032   none = 0,
0033 
0034   /// Requests cancellation where, following a successful cancellation, the only
0035   /// safe operations on the I/O object are closure or destruction.
0036   terminal = 1,
0037 
0038   /// Requests cancellation where a successful cancellation may result in
0039   /// partial side effects or no side effects. Following cancellation, the I/O
0040   /// object is in a well-known state, and may be used for further operations.
0041   partial = 2,
0042 
0043   /// Requests cancellation where a successful cancellation results in no
0044   /// apparent side effects. Following cancellation, the I/O object is in the
0045   /// same observable state as it was prior to the operation.
0046   total = 4,
0047 
0048   /// Bitmask representing all types of cancellation.
0049   all = 0xFFFFFFFF
0050 };
0051 
0052 /// Portability typedef.
0053 typedef cancellation_type cancellation_type_t;
0054 
0055 #else // defined(GENERATING_DOCUMENTATION)
0056 
0057 enum class cancellation_type : unsigned int
0058 {
0059   none = 0,
0060   terminal = 1,
0061   partial = 2,
0062   total = 4,
0063   all = 0xFFFFFFFF
0064 };
0065 
0066 typedef cancellation_type cancellation_type_t;
0067 
0068 #endif // defined(GENERATING_DOCUMENTATION)
0069 
0070 /// Negation operator.
0071 /**
0072  * @relates cancellation_type
0073  */
0074 inline constexpr bool operator!(cancellation_type_t x)
0075 {
0076   return static_cast<unsigned int>(x) == 0;
0077 }
0078 
0079 /// Bitwise and operator.
0080 /**
0081  * @relates cancellation_type
0082  */
0083 inline constexpr cancellation_type_t operator&(
0084     cancellation_type_t x, cancellation_type_t y)
0085 {
0086   return static_cast<cancellation_type_t>(
0087       static_cast<unsigned int>(x) & static_cast<unsigned int>(y));
0088 }
0089 
0090 /// Bitwise or operator.
0091 /**
0092  * @relates cancellation_type
0093  */
0094 inline constexpr cancellation_type_t operator|(
0095     cancellation_type_t x, cancellation_type_t y)
0096 {
0097   return static_cast<cancellation_type_t>(
0098       static_cast<unsigned int>(x) | static_cast<unsigned int>(y));
0099 }
0100 
0101 /// Bitwise xor operator.
0102 /**
0103  * @relates cancellation_type
0104  */
0105 inline constexpr cancellation_type_t operator^(
0106     cancellation_type_t x, cancellation_type_t y)
0107 {
0108   return static_cast<cancellation_type_t>(
0109       static_cast<unsigned int>(x) ^ static_cast<unsigned int>(y));
0110 }
0111 
0112 /// Bitwise negation operator.
0113 /**
0114  * @relates cancellation_type
0115  */
0116 inline constexpr cancellation_type_t operator~(cancellation_type_t x)
0117 {
0118   return static_cast<cancellation_type_t>(~static_cast<unsigned int>(x));
0119 }
0120 
0121 /// Bitwise and-assignment operator.
0122 /**
0123  * @relates cancellation_type
0124  */
0125 inline cancellation_type_t& operator&=(
0126     cancellation_type_t& x, cancellation_type_t y)
0127 {
0128   x = x & y;
0129   return x;
0130 }
0131 
0132 /// Bitwise or-assignment operator.
0133 /**
0134  * @relates cancellation_type
0135  */
0136 inline cancellation_type_t& operator|=(
0137     cancellation_type_t& x, cancellation_type_t y)
0138 {
0139   x = x | y;
0140   return x;
0141 }
0142 
0143 /// Bitwise xor-assignment operator.
0144 /**
0145  * @relates cancellation_type
0146  */
0147 inline cancellation_type_t& operator^=(
0148     cancellation_type_t& x, cancellation_type_t y)
0149 {
0150   x = x ^ y;
0151   return x;
0152 }
0153 
0154 } // namespace asio
0155 } // namespace boost
0156 
0157 #include <boost/asio/detail/pop_options.hpp>
0158 
0159 #endif // BOOST_ASIO_CANCELLATION_TYPE_HPP