<commit_before>/******************************************************************************
 *                       ____    _    _____                                   *
 *                      / ___|  / \  |  ___|    C++                           *
 *                     | |     / _ \ | |_       Actor                         *
 *                     | |___ / ___ \|  _|      Framework                     *
 *                      \____/_/   \_|_|                                      *
 *                                                                            *
 * Copyright (C) 2011 - 2014                                                  *
 * <NAME> <<EMAIL>ik.charousset (at) haw-hamburg.de>                *
 *                                                                            *
 * Distributed under the terms and conditions of the BSD 3-Clause License or  *
 * (at your option) under the terms and conditions of the Boost Software      *
 * License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE.       *
 *                                                                            *
 * If you did not receive a copy of the license files, see                    *
 * http://opensource.org/licenses/BSD-3-Clause and                            *
 * http://www.boost.org/LICENSE_1_0.txt.                                      *
 ******************************************************************************/

#ifndef CAF_ATOM_HPP
#define CAF_ATOM_HPP

#include <string>
#include <type_traits>

#include "caf/detail/atom_val.hpp"

namespace caf {

/**
 * The value type of atoms.
 */
enum class atom_value : uint64_t {
  /** @cond PRIVATE */
  dirty_little_hack = 31337
  /** @endcond */

};

/**
 * Creates an atom from given string literal.
 */
template <size_t Size>
constexpr atom_value atom(char const (&str)[Size]) {
  // last character is the NULL terminator
  static_assert(Size <= 11, "only 10 characters are allowed");
  return static_cast<atom_value>(detail::atom_val(str, 0xF));
}

template <atom_value Value>
using atom_constant = std::integral_constant<atom_value, Value>;

} // namespace caf

#endif // CAF_ATOM_HPP
<commit_msg>Add aliases for common atom constant types<commit_after>/******************************************************************************
 *                       ____    _    _____                                   *
 *                      / ___|  / \  |  ___|    C++                           *
 *                     | |     / _ \ | |_       Actor                         *
 *                     | |___ / ___ \|  _|      Framework                     *
 *                      \____/_/   \_|_|                                      *
 *                                                                            *
 * Copyright (C) 2011 - 2014                                                  *
 * <NAME> <dominik.charousset (at) haw-hamburg.de>                *
 *                                                                            *
 * Distributed under the terms and conditions of the BSD 3-Clause License or  *
 * (at your option) under the terms and conditions of the Boost Software      *
 * License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE.       *
 *                                                                            *
 * If you did not receive a copy of the license files, see                    *
 * http://opensource.org/licenses/BSD-3-Clause and                            *
 * http://www.boost.org/LICENSE_1_0.txt.                                      *
 ******************************************************************************/

#ifndef CAF_ATOM_HPP
#define CAF_ATOM_HPP

#include <string>
#include <type_traits>

#include "caf/detail/atom_val.hpp"

namespace caf {

/**
 * The value type of atoms.
 */
enum class atom_value : uint64_t {
  /** @cond PRIVATE */
  dirty_little_hack = 31337
  /** @endcond */
};

/**
 * Creates an atom from given string literal.
 */
template <size_t Size>
constexpr atom_value atom(char const (&str)[Size]) {
  // last character is the NULL terminator
  static_assert(Size <= 11, "only 10 characters are allowed");
  return static_cast<atom_value>(detail::atom_val(str, 0xF));
}

/**
 * Type alias for treating atom constants at compile-time
 * (cf. "Int-ToType" idiom).
 */
template <atom_value Value>
using atom_constant = std::integral_constant<atom_value, Value>;

/**
 * Generic 'GET' atom for request operations.
 */
using get_atom = atom_constant<atom("GET")>;

/**
 * Generic 'PUT' atom for request operations.
 */
using put_atom = atom_constant<atom("PUT")>;

/**
 * Generic 'OK' atom for response messages.
 */
using ok_atom = atom_constant<atom("OK")>;

/**
 * Generic 'ERROR' atom for response messages.
 */
using error_atom = atom_constant<atom("ERROR")>;

} // namespace caf

#endif // CAF_ATOM_HPP

{'fraction_non_alphanumeric': 0.15915608357230643, 'fraction_numerical': 0.010651372388365424, 'mean_word_length': 1.4006882989183873, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3185963', 'n_tokens_mistral': 1269, 'n_tokens_neox': 1164, 'n_words': 307}