clipp::detail::action_provider< Derived > Class Template Reference

mixin that provides action definition and execution More...

#include <clipp.h>

Public Member Functions

Derived & call (arg_action a)
 adds an action that has an operator() that is callable with a 'const char*' argument More...
 
Derived & call (simple_action a)
 adds an action that has an operator()() More...
 
Derived & operator() (arg_action a)
 adds an action that has an operator() that is callable with a 'const char*' argument More...
 
Derived & operator() (simple_action a)
 adds an action that has an operator()() More...
 
template<class Target >
Derived & set (Target &t)
 adds an action that will set the value of 't' from a 'const char*' arg More...
 
template<class Target , class Value >
Derived & set (Target &t, Value &&v)
 adds an action that will set the value of 't' to 'v' More...
 
Derived & if_repeated (simple_action a)
 adds an action that will be called if a parameter matches an argument for the 2nd, 3rd, 4th, ... More...
 
Derived & if_repeated (index_action a)
 adds an action that will be called with the argument's index if a parameter matches an argument for the 2nd, 3rd, 4th, ... More...
 
Derived & if_missing (simple_action a)
 adds an action that will be called if a required parameter is missing More...
 
Derived & if_missing (index_action a)
 adds an action that will be called if a required parameter is missing; the action will get called with the index of the command line argument where the missing event occured first More...
 
Derived & if_blocked (simple_action a)
 adds an action that will be called if a parameter was matched, but was unreachable in the current scope More...
 
Derived & if_blocked (index_action a)
 adds an action that will be called if a parameter was matched, but was unreachable in the current scope; the action will be called with the index of the command line argument where the problem occured More...
 
Derived & if_conflicted (simple_action a)
 adds an action that will be called if a parameter match was in conflict with a different alternative parameter More...
 
Derived & if_conflicted (index_action a)
 adds an action that will be called if a parameter match was in conflict with a different alternative paramete; the action will be called with the index of the command line argument where the problem occuredr More...
 
template<class T , class... Ts>
Derived & target (T &&t, Ts &&... ts)
 adds targets = either objects whose values should be set by command line arguments or actions that should be called in case of a match More...
 
template<class T , class = typename std::enable_if< !std::is_fundamental<typename std::decay<T>::type>() && (traits::is_callable<T,void()>() || traits::is_callable<T,void(const char*)>() ) >::type>
Derived & target (T &&t)
 adds action that should be called in case of a match More...
 
template<class T , class = typename std::enable_if< std::is_fundamental<typename std::decay<T>::type>() || (!traits::is_callable<T,void()>() && !traits::is_callable<T,void(const char*)>() ) >::type>
Derived & target (T &t)
 adds object whose value should be set by command line arguments More...
 
Derived & target ()
 
void execute_actions (const arg_string &arg) const
 executes all argument actions More...
 
void notify_repeated (arg_index idx) const
 executes repeat actions More...
 
void notify_missing (arg_index idx) const
 executes missing error actions More...
 
void notify_blocked (arg_index idx) const
 executes blocked error actions More...
 
void notify_conflict (arg_index idx) const
 executes conflict error actions More...
 

Friends

template<class Target >
Derived & operator<< (Target &&t, Derived &p)
 adds target, see member function 'target' More...
 
template<class Target >
Derived && operator<< (Target &&t, Derived &&p)
 adds target, see member function 'target' More...
 
template<class Target >
Derived & operator>> (Derived &p, Target &&t)
 adds target, see member function 'target' More...
 
template<class Target >
Derived && operator>> (Derived &&p, Target &&t)
 adds target, see member function 'target' More...
 

Detailed Description

template<class Derived>
class clipp::detail::action_provider< Derived >

mixin that provides action definition and execution

Definition at line 1164 of file clipp.h.

Member Function Documentation

◆ call() [1/2]

template<class Derived >
Derived& clipp::detail::action_provider< Derived >::call ( arg_action  a)
inline

adds an action that has an operator() that is callable with a 'const char*' argument

Definition at line 1190 of file clipp.h.

◆ call() [2/2]

template<class Derived >
Derived& clipp::detail::action_provider< Derived >::call ( simple_action  a)
inline

adds an action that has an operator()()

Definition at line 1197 of file clipp.h.

◆ execute_actions()

template<class Derived >
void clipp::detail::action_provider< Derived >::execute_actions ( const arg_string arg) const
inline

executes all argument actions

Definition at line 1388 of file clipp.h.

◆ if_blocked() [1/2]

template<class Derived >
Derived& clipp::detail::action_provider< Derived >::if_blocked ( index_action  a)
inline

adds an action that will be called if a parameter was matched, but was unreachable in the current scope; the action will be called with the index of the command line argument where the problem occured

Definition at line 1282 of file clipp.h.

◆ if_blocked() [2/2]

template<class Derived >
Derived& clipp::detail::action_provider< Derived >::if_blocked ( simple_action  a)
inline

adds an action that will be called if a parameter was matched, but was unreachable in the current scope

Definition at line 1272 of file clipp.h.

◆ if_conflicted() [1/2]

template<class Derived >
Derived& clipp::detail::action_provider< Derived >::if_conflicted ( index_action  a)
inline

adds an action that will be called if a parameter match was in conflict with a different alternative paramete; the action will be called with the index of the command line argument where the problem occuredr

Definition at line 1303 of file clipp.h.

◆ if_conflicted() [2/2]

template<class Derived >
Derived& clipp::detail::action_provider< Derived >::if_conflicted ( simple_action  a)
inline

adds an action that will be called if a parameter match was in conflict with a different alternative parameter

Definition at line 1293 of file clipp.h.

◆ if_missing() [1/2]

template<class Derived >
Derived& clipp::detail::action_provider< Derived >::if_missing ( index_action  a)
inline

adds an action that will be called if a required parameter is missing; the action will get called with the index of the command line argument where the missing event occured first

Definition at line 1261 of file clipp.h.

◆ if_missing() [2/2]

template<class Derived >
Derived& clipp::detail::action_provider< Derived >::if_missing ( simple_action  a)
inline

adds an action that will be called if a required parameter is missing

Definition at line 1252 of file clipp.h.

◆ if_repeated() [1/2]

template<class Derived >
Derived& clipp::detail::action_provider< Derived >::if_repeated ( index_action  a)
inline

adds an action that will be called with the argument's index if a parameter matches an argument for the 2nd, 3rd, 4th, ...

time

Definition at line 1241 of file clipp.h.

◆ if_repeated() [2/2]

template<class Derived >
Derived& clipp::detail::action_provider< Derived >::if_repeated ( simple_action  a)
inline

adds an action that will be called if a parameter matches an argument for the 2nd, 3rd, 4th, ...

time

Definition at line 1232 of file clipp.h.

◆ notify_blocked()

template<class Derived >
void clipp::detail::action_provider< Derived >::notify_blocked ( arg_index  idx) const
inline

executes blocked error actions

Definition at line 1405 of file clipp.h.

◆ notify_conflict()

template<class Derived >
void clipp::detail::action_provider< Derived >::notify_conflict ( arg_index  idx) const
inline

executes conflict error actions

Definition at line 1409 of file clipp.h.

◆ notify_missing()

template<class Derived >
void clipp::detail::action_provider< Derived >::notify_missing ( arg_index  idx) const
inline

executes missing error actions

Definition at line 1401 of file clipp.h.

◆ notify_repeated()

template<class Derived >
void clipp::detail::action_provider< Derived >::notify_repeated ( arg_index  idx) const
inline

executes repeat actions

Definition at line 1397 of file clipp.h.

◆ operator()() [1/2]

template<class Derived >
Derived& clipp::detail::action_provider< Derived >::operator() ( arg_action  a)
inline

adds an action that has an operator() that is callable with a 'const char*' argument

Definition at line 1204 of file clipp.h.

◆ operator()() [2/2]

template<class Derived >
Derived& clipp::detail::action_provider< Derived >::operator() ( simple_action  a)
inline

adds an action that has an operator()()

Definition at line 1207 of file clipp.h.

◆ set() [1/2]

template<class Derived >
template<class Target >
Derived& clipp::detail::action_provider< Derived >::set ( Target &  t)
inline

adds an action that will set the value of 't' from a 'const char*' arg

Definition at line 1215 of file clipp.h.

◆ set() [2/2]

template<class Derived >
template<class Target , class Value >
Derived& clipp::detail::action_provider< Derived >::set ( Target &  t,
Value &&  v 
)
inline

adds an action that will set the value of 't' to 'v'

Definition at line 1222 of file clipp.h.

◆ target() [1/4]

template<class Derived >
Derived& clipp::detail::action_provider< Derived >::target ( )
inline

Definition at line 1348 of file clipp.h.

◆ target() [2/4]

template<class Derived >
template<class T , class = typename std::enable_if< !std::is_fundamental<typename std::decay<T>::type>() && (traits::is_callable<T,void()>() || traits::is_callable<T,void(const char*)>() ) >::type>
Derived& clipp::detail::action_provider< Derived >::target ( T &&  t)
inline

adds action that should be called in case of a match

Definition at line 1328 of file clipp.h.

◆ target() [3/4]

template<class Derived >
template<class T , class... Ts>
Derived& clipp::detail::action_provider< Derived >::target ( T &&  t,
Ts &&...  ts 
)
inline

adds targets = either objects whose values should be set by command line arguments or actions that should be called in case of a match

Definition at line 1315 of file clipp.h.

◆ target() [4/4]

template<class Derived >
template<class T , class = typename std::enable_if< std::is_fundamental<typename std::decay<T>::type>() || (!traits::is_callable<T,void()>() && !traits::is_callable<T,void(const char*)>() ) >::type>
Derived& clipp::detail::action_provider< Derived >::target ( T &  t)
inline

adds object whose value should be set by command line arguments

Definition at line 1341 of file clipp.h.

Friends And Related Function Documentation

◆ operator<< [1/2]

template<class Derived >
template<class Target >
Derived&& operator<< ( Target &&  t,
Derived &&  p 
)
friend

adds target, see member function 'target'

Definition at line 1363 of file clipp.h.

◆ operator<< [2/2]

template<class Derived >
template<class Target >
Derived& operator<< ( Target &&  t,
Derived &  p 
)
friend

adds target, see member function 'target'

Definition at line 1356 of file clipp.h.

◆ operator>> [1/2]

template<class Derived >
template<class Target >
Derived&& operator>> ( Derived &&  p,
Target &&  t 
)
friend

adds target, see member function 'target'

Definition at line 1380 of file clipp.h.

◆ operator>> [2/2]

template<class Derived >
template<class Target >
Derived& operator>> ( Derived &  p,
Target &&  t 
)
friend

adds target, see member function 'target'

Definition at line 1373 of file clipp.h.


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