3 #include <boost/beast/http.hpp> 22 constexpr
auto numeric_id_match(std::string_view
id) noexcept {
return ctre::match<numeric_id_pattern>(id); }
33 std::uint32_t ret = 0;
37 if (c >=
'0' &&
'9' >= c)
39 else if (c >=
'A' &&
'F' >= c)
41 else if (c >=
'a' &&
'f' >= c)
54 constexpr std::array<char, sizeof(std::uint32_t) * 2>
hex_encode_id(std::uint32_t
id) noexcept {
55 constexpr
auto hex =
"0123456789abcdef"sv;
56 std::array<char, sizeof(std::uint32_t)* 2> ret = {};
57 for (
auto it = ret.rbegin(); it < ret.rend(); ++it) {
74 using Ret = std::pair<boost::beast::http::status, std::string>;
77 return Ret{boost::beast::http::status::not_found, {}};
82 return Ret{boost::beast::http::status::not_found, {}};
84 return Ret{boost::beast::http::status::processing, {}};
86 return Ret{boost::beast::http::status::found, val};
std::pair< TaskStatus, std::string > value_if_ready(IndexType id)
Definition: async_store.hpp:83
#define UNREACHABLE
Definition: utility.hpp:19
task is done and its buffers are ready to be sent back
AsyncStore async_store
Definition: general_store.hpp:10
constexpr auto numeric_id_match(std::string_view id) noexcept
Definition: async_handler.hpp:22
static constexpr ctll::fixed_string numeric_id_pattern
Definition: async_handler.hpp:14
constexpr std::uint32_t hex_decode_id(std::string_view sv) noexcept
Definition: async_handler.hpp:32
constexpr std::array< char, sizeof(std::uint32_t)*2 > hex_encode_id(std::uint32_t id) noexcept
Definition: async_handler.hpp:54
task is currently being executed
Definition: general_store.hpp:5
auto handle_async_retrieve(GeneralStore &gstore, std::string_view str_id)
Definition: async_handler.hpp:72