1 #ifndef fhiclcpp_types_OptionalTuple_h 2 #define fhiclcpp_types_OptionalTuple_h 26 template <
typename... TYPES>
27 class OptionalTuple final :
public detail::SequenceBase,
28 private detail::RegisterIfTableMember {
30 using ftype = std::tuple<std::shared_ptr<tt::fhicl_type<TYPES>>...>;
31 using value_type = std::tuple<tt::return_type<TYPES>...>;
37 std::function<
bool()> maybeUse);
54 return std::tuple_size<ftype>();
67 template <
typename E,
typename... T>
71 using elem_ftype =
typename E::element_type;
82 template <std::size_t... I>
105 template <
typename E,
typename... T>
109 using elem_ftype =
typename E::element_type;
120 template <std::size_t... I>
138 template <
typename E,
typename... T>
142 using elem_ftype =
typename E::element_type;
153 template <std::size_t... I>
163 using TUPLE = std::tuple<tt::fhicl_type<TYPES>...>;
165 template <
size_t I,
typename value_type>
170 template <
size_t I,
typename value_type>
174 std::get<I>(result) = (*std::get<I>(value_))();
175 fill_return_element<I + 1>(result);
181 fill_return_element<0>(result);
186 bool const )
override 200 template <
typename... TYPES>
205 template <
typename... TYPES>
218 template <
typename... TYPES>
221 std::function<
bool()> maybeUse)
233 template <
typename... TYPES>
241 std::swap(result, r);
bool operator()(value_type &) const
std::tuple< std::shared_ptr< tt::fhicl_type< TYPES >>... > ftype
std::tuple< tt::fhicl_type< TYPES >... > TUPLE
void assemble_rtype(value_type &result) const
#define NO_DELEGATED_PARAMETERS
void iterate_over_tuple(PW_non_const &pw, std::index_sequence< I... >)
void check_nargs_for_bounded_sequences(std::string const &key, std::size_t expected, std::size_t provided)
std::enable_if_t<(I >=std::tuple_size< TUPLE >::value)> fill_return_element(value_type &) const
void do_prepare_elements_for_validation(std::size_t const n) override
#define NO_OPTIONAL_TYPES
void do_walk_elements(PW_const &pw) const override
void iterate_over_tuple(PW_const &pw, std::index_sequence< I... >) const
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)
std::tuple< tt::return_type< TYPES >... > value_type
void visit_element(PW_non_const &)
void walk_over(tt::maybe_const_t< ParameterBase, C > &)
RegisterIfTableMember(ParameterBase *pb)
void finalize_tuple_elements(std::size_t i, E &elem, T &...others)
OptionalTuple(Name &&name)
void visit_element(PW_non_const &pw, E &elem, T &...others)
std::size_t get_size() const override
std::enable_if_t<(I< std::tuple_size< TUPLE >::value)> fill_return_element(value_type &result) const
void finalize_elements(std::index_sequence< I... >)
#define NO_NESTED_TABLE_FRAGMENTS
static Name sequence_element(std::size_t const i)
std::string value(boost::any const &)
void finalize_tuple_elements(std::size_t)
void do_set_value(fhicl::ParameterSet const &, bool const ) override
void visit_element(PW_const &pw, E const &elem, T const &...others) const
void do_walk_elements(PW_non_const &pw) override
void visit_element(PW_const &) const
std::string comment() const