virthttp  0.0
libvirt http interface
Classes | Macros | Functions | Variables
actions_table.hpp File Reference
#include <array>
#include <functional>
#include <string_view>
#include <gsl/gsl>
#include "cexpr_algs.hpp"
#include "depends.hpp"
#include "json2virt.hpp"
#include "json_utils.hpp"
#include "utils.hpp"

Go to the source code of this file.

Classes

class  NamedCallTable< CRTP, Hdl >
 

Macros

#define PM_LIFT(mem_fn)   [&](auto... args) { return mem_fn(args...); }
 
#define PM_PREREQ(...)   [&] { __VA_ARGS__ return DependsOutcome::SUCCESS; }
 

Functions

template<class F >
auto getCombinedFlags (const rapidjson::Value &json_flag, JsonRes &json_res) noexcept-> std::optional< F >
 

Variables

template<typename Flag >
constexpr const auto getFlag
 
constexpr auto action_scope
 

Macro Definition Documentation

#define PM_LIFT (   mem_fn)    [&](auto... args) { return mem_fn(args...); }
#define PM_PREREQ (   ...)    [&] { __VA_ARGS__ return DependsOutcome::SUCCESS; }

Function Documentation

template<class F >
auto getCombinedFlags ( const rapidjson::Value &  json_flag,
JsonRes json_res 
) -> std::optional<F>
noexcept

Variable Documentation

constexpr auto action_scope
Initial value:
= [](auto&&... actions) {
using Arr = std::array<std::function<DependsOutcome()>, sizeof...(actions)>;
for (auto&& action : Arr{actions...}) {
if (const auto ao = action(); ao != DependsOutcome::SKIPPED)
return ao;
}
}
template<typename Flag >
constexpr const auto getFlag
Initial value:
= [](const rapidjson::Value& json_flag, auto error) {
if (auto v = Flag::from_string({json_flag.GetString(), json_flag.GetStringLength()}); v)
return std::optional{*v};
return error(301), std::optional<Flag>{std::nullopt};
}