virthttp  0.0
libvirt http interface
Functions | Variables
async_handler.hpp File Reference
#include <string_view>
#include <boost/beast/http.hpp>
#include <ctre.hpp>
#include "wrapper/general_store.hpp"
#include "wrapper/protocol_support/protocols.hpp"

Go to the source code of this file.

Functions

constexpr auto numeric_id_match (std::string_view id) noexcept
 
constexpr std::uint32_t hex_decode_id (std::string_view sv) noexcept
 
constexpr std::array< char, sizeof(std::uint32_t)*2 > hex_encode_id (std::uint32_t id) noexcept
 
template<TransportProto proto>
auto handle_async_retrieve (GeneralStore &gstore, std::string_view str_id)
 

Variables

static constexpr ctll::fixed_string numeric_id_pattern = "[0-9A-Fa-f]{1,8}"
 

Function Documentation

template<TransportProto proto>
auto handle_async_retrieve ( GeneralStore gstore,
std::string_view  str_id 
)

Handles a asynchronous retrieval request

Template Parameters
protothe transport protocol the request came over
Parameters
[in]gstorethe global store, where the AsyncStore instance is located
[in]str_idthe string representation of id
constexpr std::uint32_t hex_decode_id ( std::string_view  sv)
noexcept

Decodes an AsyncStore key from its string form

Parameters
[in]svthe string representation of the id
Returns
the numerical form of the id
constexpr std::array<char, sizeof(std::uint32_t) * 2> hex_encode_id ( std::uint32_t  id)
noexcept

Encodes an AsyncStore key into its string form

Parameters
[in]idthe numerical form of the id
Returns
the string representation of the id, in an array
constexpr auto numeric_id_match ( std::string_view  id)
noexcept

Matching function for the encoded version of AsyncStore::IndexType

Parameters
[in]idthe potential string form of an AsyncStore key
Returns
the match result object

Variable Documentation

constexpr ctll::fixed_string numeric_id_pattern = "[0-9A-Fa-f]{1,8}"
static

Regex pattern matching the encoded version of AsyncStore::IndexType