1 #ifndef fhiclcpp_types_OptionalTuple_h 2 #define fhiclcpp_types_OptionalTuple_h 27 template <
typename... T>
28 class OptionalTuple final :
public detail::SequenceBase,
29 private detail::RegisterIfTableMember {
31 using ftype = std::tuple<std::shared_ptr<tt::fhicl_type<T>>...>;
48 std::function<
bool()> maybeUse);
51 auto operator()(value_type&) const ->
bool;
66 return std::tuple_size<ftype>();
75 template <std::size_t... I>
79 (pw.
walk_over(*std::get<I>(value_)), ...);
94 template <std::size_t... I>
98 (pw.
walk_over(*std::get<I>(value_)), ...);
109 template <std::
size_t I>
113 using elem_ftype =
typename std::tuple_element_t<I, ftype>::element_type;
118 template <std::size_t... I>
122 (finalize_element<I>(), ...);
127 template <std::size_t... I>
149 template <
typename... T>
154 template <
typename... T>
167 template <
typename... T>
170 std::function<
bool()> maybeUse)
182 template <
typename... T>
188 return std::make_optional(
192 template <
typename... T>
200 return result.has_value();
void iterate_over_tuple(PW_non_const &pw, std::index_sequence< I... >)
OptionalTuple(Name &&name)
void do_set_value(fhicl::ParameterSet const &) override
#define NO_DELEGATED_PARAMETERS
value_type get_rtype_result(std::index_sequence< I... >) const
void check_nargs_for_bounded_sequences(std::string const &key, std::size_t expected, std::size_t provided)
#define NO_OPTIONAL_TYPES
static void end_of_ctor()
std::function< bool()> AlwaysUse()
SequenceBase(Name &&name, Comment &&comment, par_style const vt, par_type const type, std::function< bool()> maybeUse)
void do_walk_elements(PW_non_const &pw) override
void do_prepare_elements_for_validation(std::size_t const n) override
void walk_over(tt::maybe_const_t< ParameterBase, C > &)
RegisterIfTableMember(ParameterBase *pb)
std::string const & name() const
std::string const & key() const
void finalize_elements(std::index_sequence< I... >)
std::tuple< std::shared_ptr< tt::fhicl_type< T >>... > ftype
#define NO_NESTED_TABLE_FRAGMENTS
std::size_t get_size() const noexcept override
std::tuple< tt::return_type< T >... > value_type
static Name sequence_element(std::size_t const i)
void iterate_over_tuple(PW_const &pw, std::index_sequence< I... >) const
auto operator()() const -> std::optional< value_type >
typename return_type_impl< ARGS... >::value_type return_type
std::string const & comment() const
void do_walk_elements(PW_const &pw) const override