Sha256: 998a6499cf44db7bf117eb72f1b733bd1d47c163e16166bf186eca9f7b77f448

Contents?: true

Size: 1.91 KB

Versions: 6

Compression:

Stored size: 1.91 KB

Contents

//
// experimental/channel_error.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef ASIO_EXPERIMENTAL_CHANNEL_ERROR_HPP
#define ASIO_EXPERIMENTAL_CHANNEL_ERROR_HPP

#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)

#include "asio/detail/config.hpp"
#include "asio/error_code.hpp"

#include "asio/detail/push_options.hpp"

namespace asio {
namespace experimental {
namespace error {

enum channel_errors
{
  /// The channel was closed.
  channel_closed = 1,

  /// The channel was cancelled.
  channel_cancelled = 2
};

extern ASIO_DECL
const asio::error_category& get_channel_category();

static const asio::error_category&
  channel_category ASIO_UNUSED_VARIABLE
  = asio::experimental::error::get_channel_category();

} // namespace error
namespace channel_errc {
  // Simulates a scoped enum.
  using error::channel_closed;
  using error::channel_cancelled;
} // namespace channel_errc
} // namespace experimental
} // namespace asio

#if defined(ASIO_HAS_STD_SYSTEM_ERROR)
namespace std {

template<> struct is_error_code_enum<
    asio::experimental::error::channel_errors>
{
  static const bool value = true;
};

} // namespace std
#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR)

namespace asio {
namespace experimental {
namespace error {

inline asio::error_code make_error_code(channel_errors e)
{
  return asio::error_code(
      static_cast<int>(e), get_channel_category());
}

} // namespace error
} // namespace experimental
} // namespace asio

#include "asio/detail/pop_options.hpp"

#if defined(ASIO_HEADER_ONLY)
# include "asio/experimental/impl/channel_error.ipp"
#endif // defined(ASIO_HEADER_ONLY)

#endif // ASIO_EXPERIMENTAL_CHANNEL_ERROR_HPP

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
couchbase-3.4.5 ext/couchbase/third_party/asio/asio/include/asio/experimental/channel_error.hpp
couchbase-3.4.4 ext/couchbase/third_party/asio/asio/include/asio/experimental/channel_error.hpp
couchbase-3.4.3 ext/couchbase/third_party/asio/asio/include/asio/experimental/channel_error.hpp
couchbase-3.4.2 ext/couchbase/third_party/asio/asio/include/asio/experimental/channel_error.hpp
couchbase-3.4.1 ext/couchbase/third_party/asio/asio/include/asio/experimental/channel_error.hpp
couchbase-3.4.0 ext/couchbase/third_party/asio/asio/include/asio/experimental/channel_error.hpp