// clang-format off
// DO NOT EDIT: this file is auto-generated by caf-generate-enum-strings.
// Run the target update-enum-strings if this file is out of sync.
#include "caf/config.hpp"
#include "caf/string_view.hpp"

CAF_PUSH_DEPRECATED_WARNING

#include "caf/intrusive/inbox_result.hpp"

#include <string>

namespace caf {
namespace intrusive {

std::string to_string(inbox_result x) {
  switch(x) {
    default:
      return "???";
    case inbox_result::success:
      return "success";
    case inbox_result::unblocked_reader:
      return "unblocked_reader";
    case inbox_result::queue_closed:
      return "queue_closed";
  };
}

bool from_string(string_view in, inbox_result& out) {
  if (in == "success") {
    out = inbox_result::success;
    return true;
  } else if (in == "unblocked_reader") {
    out = inbox_result::unblocked_reader;
    return true;
  } else if (in == "queue_closed") {
    out = inbox_result::queue_closed;
    return true;
  } else {
    return false;
  }
}

bool from_integer(std::underlying_type_t<inbox_result> in,
                  inbox_result& out) {
  auto result = static_cast<inbox_result>(in);
  switch(result) {
    default:
      return false;
    case inbox_result::success:
    case inbox_result::unblocked_reader:
    case inbox_result::queue_closed:
      out = result;
      return true;
  };
}

} // namespace intrusive
} // namespace caf

CAF_POP_WARNINGS
