You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.0 KiB

  1. #pragma once
  2. #include <cppargs/options/member/member_option.h>
  3. namespace cppargs
  4. {
  5. template<typename T_instance, typename T_predicate>
  6. struct member_predicate_option
  7. : public member_option<T_instance>
  8. {
  9. public:
  10. using instance_type = T_instance;
  11. using predicate_type = T_predicate;
  12. using base_type = member_option<instance_type>;
  13. private:
  14. predicate_type _predicate;
  15. public:
  16. /**
  17. * @brief Constructor.
  18. *
  19. * @param[in] p_meta Meta data of the option.
  20. * @param[in] args Arguments to pass to the predicate constructor.
  21. */
  22. template<typename... T_args>
  23. inline member_predicate_option(
  24. const option_meta& p_meta,
  25. T_args&&... args);
  26. /**
  27. * @brief Parse the option using the current context.
  28. *
  29. * @param[in|out] c Context to use for parsing.
  30. */
  31. virtual void parse(context& c) const override;
  32. };
  33. }