1 #ifndef fhiclcpp_types_Tuple_h 2 #define fhiclcpp_types_Tuple_h 19 namespace tuple_detail {
28 template <
typename... Defaults>
32 :
holder_{std::forward_as_tuple(defaults...)}
37 template <std::
size_t I>
55 template <
typename... T>
62 using ftype = std::tuple<std::shared_ptr<tt::fhicl_type<T>>...>;
78 std::function<
bool()> maybeUse);
87 std::function<
bool()> maybeUse,
90 auto operator()()
const;
92 template <std::
size_t I>
96 return (*std::get<I>(value_))();
105 return std::tuple_size<ftype>();
118 template <std::size_t... I>
122 (pw.
walk_over(*std::get<I>(value_)), ...);
134 iterate_over_tuple(pw, std::index_sequence_for<T...>{});
137 template <std::size_t... I>
141 (pw.
walk_over(*std::get<I>(value_)), ...);
147 iterate_over_tuple(pw, std::index_sequence_for<T...>{});
152 template <std::
size_t I>
156 using elem_ftype =
typename std::tuple_element_t<I, ftype>::element_type;
157 std::get<I>(value_) =
161 template <std::size_t... I>
165 (finalize_element<I>(), ...);
174 using elem_ftype =
typename std::tuple_element_t<I, ftype>::element_type;
175 std::get<I>(value_) = std::make_shared<elem_ftype>(
179 template <std::size_t... I>
182 std::index_sequence<I...>)
184 (fill_tuple_element<I>(default_values), ...);
189 template <std::size_t... I>
193 return value_type{(*std::get<I>(value_))()...};
200 template <
typename... T>
204 template <
typename... T>
217 template <
typename... T>
220 std::function<
bool()> maybeUse)
234 template <
typename... T>
239 template <
typename... T>
254 template <
typename... T>
257 std::function<
bool()> maybeUse,
270 template <
typename... T>
value_type get_rtype_result(std::index_sequence< I... >) const
void do_walk_elements(PW_non_const &pw) override
#define NO_DELEGATED_PARAMETERS
std::tuple< tt::return_type< T >... > value_type
void check_nargs_for_bounded_sequences(std::string const &key, std::size_t expected, std::size_t provided)
void do_walk_elements(PW_const &pw) const override
#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 walk_over(tt::maybe_const_t< ParameterBase, C > &)
ValueHolder(std::tuple< Defaults... > const &tup)
std::tuple< std::shared_ptr< tt::fhicl_type< T >>... > ftype
RegisterIfTableMember(ParameterBase *pb)
std::tuple< Defaults... > const holder_
std::string const & name() const
void iterate_over_tuple(PW_const &pw, std::index_sequence< I... >) const
void fill_tuple_elements(default_type const &default_values, std::index_sequence< I... >)
void finalize_elements(std::index_sequence< I... >)
#define NO_NESTED_TABLE_FRAGMENTS
static Name sequence_element(std::size_t const i)
ValueHolder(Defaults...defaults)
void do_prepare_elements_for_validation(std::size_t const n) override
void do_set_value(ParameterSet const &) override
void iterate_over_tuple(PW_non_const &pw, std::index_sequence< I... >)
std::size_t get_size() const noexcept override
typename return_type_impl< ARGS... >::value_type return_type
std::string const & comment() const
void fill_tuple_element(default_type const &defaults)