arg_router
1.4.0
C++ command line argument parsing and routing
|
#include <arg_router/policy/runtime_enable.hpp>
Public Member Functions | |
runtime_enable (bool enable) noexcept | |
bool | runtime_enabled () const noexcept |
template<typename ProcessedTarget , typename... Parents> | |
parsing::pre_parse_result | pre_parse_phase ([[maybe_unused]] parsing::dynamic_token_adapter &tokens, [[maybe_unused]] utility::compile_time_optional< ProcessedTarget > processed_target, [[maybe_unused]] parsing::parse_target &target, [[maybe_unused]] const Parents &... parents) const |
Static Public Attributes | |
constexpr static auto | priority = std::size_t{800} |
Policy that allows a node to be ignored during the parse phase depending upon it's runtime constructor argument.
This policy allows nodes or entire modes of a parse tree to be disabled, for example a feature may not be available on a particular application license type - this policy can hide the feature from the user.
This policy does not affect the arguments dispatched to appropriate router, so values associated with disabled nodes come from an attached policy::default_value or a default constructed instance if no policy::default_value is attached.
Definition at line 24 of file runtime_enable.hpp.
|
inlineexplicitnoexcept |
Constructor.
enable | True to enable the node |
Definition at line 34 of file runtime_enable.hpp.
|
inline |
Calls the enabled_type function object and skips further processing for the token parsing if disabled.
ProcessedTarget | processed_target payload type |
Parents | Pack of parent tree nodes in ascending ancestry order |
tokens | Currently processed tokens |
processed_target | Previously processed parse_target of parent node, or empty is there is no non-root parent |
target | Pre-parse generated target |
parents | Parent node instances |
Definition at line 53 of file runtime_enable.hpp.
|
inlinenoexcept |
Definition at line 37 of file runtime_enable.hpp.
|
staticconstexpr |
Policy priority.
Definition at line 28 of file runtime_enable.hpp.