arg_router  1.4.0
C++ command line argument parsing and routing
arg_router::policy::dependent_t< DependsPolicies > Class Template Reference

#include <arg_router/policy/dependent.hpp>

Public Types

using depends_policies_type = std::tuple< std::decay_t< DependsPolicies >... >
 

Public Member Functions

constexpr dependent_t ([[maybe_unused]] const DependsPolicies &... policies) noexcept
 
template<typename ProcessedTarget , typename... Parents>
parsing::pre_parse_result pre_parse_phase ([[maybe_unused]] parsing::dynamic_token_adapter &tokens, utility::compile_time_optional< ProcessedTarget > processed_target, [[maybe_unused]] parsing::parse_target &target, [[maybe_unused]] const Parents &... parents) const
 

Detailed Description

template<typename... DependsPolicies>
class arg_router::policy::dependent_t< DependsPolicies >

Causes the owning node to be 'dependent' on others, i.e. that other node must also appear on the command line.

The depends targets must have long or short names.

Template Parameters
DependsPoliciesPack of name policies, referring to nodes under the same mode, to depend on

Definition at line 23 of file dependent.hpp.

Member Typedef Documentation

◆ depends_policies_type

template<typename... DependsPolicies>
using arg_router::policy::dependent_t< DependsPolicies >::depends_policies_type = std::tuple<std::decay_t<DependsPolicies>...>

Tuple of policy types.

Definition at line 27 of file dependent.hpp.

Constructor & Destructor Documentation

◆ dependent_t()

template<typename... DependsPolicies>
constexpr arg_router::policy::dependent_t< DependsPolicies >::dependent_t ( [[maybe_unused] ] const DependsPolicies &...  policies)
inlineexplicitconstexprnoexcept

Constructor.

Parameters
policiesPolicy instances

Definition at line 33 of file dependent.hpp.

Member Function Documentation

◆ pre_parse_phase()

template<typename... DependsPolicies>
template<typename ProcessedTarget , typename... Parents>
parsing::pre_parse_result arg_router::policy::dependent_t< DependsPolicies >::pre_parse_phase ( [[maybe_unused] ] parsing::dynamic_token_adapter tokens,
utility::compile_time_optional< ProcessedTarget >  processed_target,
[[maybe_unused] ] parsing::parse_target target,
[[maybe_unused] ] const Parents &...  parents 
) const
inline

Scans the processed tokens to find all the dependent node names.

Template Parameters
ProcessedTargetprocessed_target payload type
ParentsPack of parent tree nodes in ascending ancestry order
Parameters
tokensCurrently processed tokens
processed_targetPreviously processed parse_target of parent node, or empty is there is no non-root parent
targetPre-parse generated target
parentsParent node instances
Returns
Either true if successful, or a multi_lang_exception if a dependent argument is missing

Definition at line 48 of file dependent.hpp.


The documentation for this class was generated from the following file: