|
| template<class F , class = std::enable_if_t<!std::is_same_v<F, Empty>>> |
| constexpr auto | target_get_composable_flag (const TargetParser &target, std::string_view tag) noexcept-> std::optional< F > |
| | Extracts a flag from the HTTP target. More...
|
| |
| template<class... Fcns> |
| constexpr auto | parameterized_depends_scope (Fcns &&...depends) noexcept((std::is_nothrow_move_constructible_v< Fcns > &&...)) |
| |
| template<class T , class A > |
| decltype(auto) constexpr | subq_impl::auto_serialize (T &&v, A &al) |
| |
| template<class TI , class F , class VC , class TJ > |
| auto | subq_impl::subquery (std::string_view name, std::string_view opt_tag, [[maybe_unused]] TI ti, F &&lifted, VC &&valid_check, TJ &&to_json) noexcept(std::is_nothrow_move_constructible_v< F > &&std::is_nothrow_move_constructible_v< VC > &&std::is_nothrow_move_constructible_v< TJ >) |
| | subquery overload for functions taking a single flag and without automatically deduced JSON serialization More...
|
| |
| template<class F , class VC , class TI > |
| auto | subq_impl::subquery (std::string_view name, std::string_view opt_tag, TI ti, F &&lifted, VC &&valid_check) noexcept(std::is_nothrow_move_constructible_v< F > &&std::is_nothrow_move_constructible_v< VC >) -> decltype(auto) |
| | subquery overload for functions taking no flag and with automatically deduced JSON serialization More...
|
| |
| template<class F , class VC , class TJ , class = std::enable_if_t<!std::is_same_v<F, std::string_view>>> |
| auto | subq_impl::subquery (std::string_view name, F &&lifted, VC &&valid_check, TJ &&to_json) noexcept(std::is_nothrow_move_constructible_v< F > &&std::is_nothrow_move_constructible_v< VC > &&std::is_nothrow_move_constructible_v< TJ >) |
| | subquery overload for functions taking no flag and without automatically deduced JSON serialization More...
|
| |
| template<class F , class VC , class = std::enable_if_t<!std::is_same_v<F, std::string_view>>> |
| auto | subq_impl::subquery (std::string_view name, F &&lifted, VC &&valid_check) noexcept(std::is_nothrow_move_constructible_v< F > &&std::is_nothrow_move_constructible_v< VC >) -> decltype(auto) |
| | subquery overload for functions taking no flag and with automatically deduced JSON serialization More...
|
| |
Utilities for making subqueries work and have as many parameters as possible be deduced
template<class F , class = std::enable_if_t<!std::is_same_v<F, Empty>>>
| constexpr auto target_get_composable_flag |
( |
const TargetParser & |
target, |
|
|
std::string_view |
tag |
|
) |
| -> std::optional<F> |
|
noexcept |
Extracts a flag from the HTTP target.
Extracts by tag a flag from a TargetParser. The flag values must be comma-separated and only the first appearance of tag within the target is considered. If the flag is not composable (i.e. F{} | F{} is ill-formed), only the first value is considered.
- Template Parameters
-
| F | the type of flag; value Empty SFINAE'ed out |
- Parameters
-
| [in] | target | the target to read the query from |
| [in] | tag | the key of the query where the flag values are |
- Returns
- (
std::optional<F>) the flag, or std::nullopt if an error occurred when reading the flag values. Note that if F is not composable, only the first flag value will be read
Initial value:= [](
auto&&... args) noexcept(noexcept(
subq_impl::subquery(std::forward<decltype(args)>(args)...)))
auto subquery(std::string_view name, std::string_view opt_tag, [[maybe_unused]] TI ti, F &&lifted, VC &&valid_check, TJ &&to_json) noexcept(std::is_nothrow_move_constructible_v< F > &&std::is_nothrow_move_constructible_v< VC > &&std::is_nothrow_move_constructible_v< TJ >)
subquery overload for functions taking a single flag and without automatically deduced JSON serializa...
Definition: flagwork.hpp:136
Perfect-forwarding lifted subq_impl::subquery.
Lifts a set of closure factories, where said closures process the subquery described by args. The resulting closure upon invocation of this lifting lambda must be of the signature DependsOutcome(int sq_lev, const TargetParser& target, auto& res_val, auto& allocator, auto&& error), where:
- [in]
sq_lev is the target path part index where the subquery to look for is located
- [in]
target is the target parser object containing the currently parsed URI target
- [out]
res_val is the place where to put the JSON result to be sent back to the client
- [in]
allocator is the JSON allocator to be used when serializing
- [in]
error is a callable used for error reporting
- Parameters
-
| args | the subquery description; see the different versions of subq_impl::subquery to know the possible description formats |