LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
fhicl::Sequence< T, N > Class Template Reference

#include "type_traits.h"

Inheritance diagram for fhicl::Sequence< T, N >:
fhicl::detail::SequenceBase fhicl::detail::RegisterIfTableMember fhicl::detail::ParameterBase

Public Types

using default_type = sequence_detail::ValueHolder< typename tt::fhicl_type< T >::default_type >
 
using ftype = std::array< std::shared_ptr< tt::fhicl_type< T >>, N >
 
using value_type = std::array< tt::return_type< T >, N >
 

Public Member Functions

 Sequence (Name &&name)
 
 Sequence (Name &&name, Comment &&comment)
 
 Sequence (Name &&name, Comment &&comment, std::function< bool()> maybeUse)
 
 Sequence (Name &&name, default_type const &defaults)
 
 Sequence (Name &&name, Comment &&comment, default_type const &defaults)
 
 Sequence (Name &&name, Comment &&comment, std::function< bool()> maybeUse, default_type const &defaults)
 
auto operator() () const
 
auto operator() (std::size_t i) const
 
bool empty () const
 
std::size_t size () const
 
void prepare_elements_for_validation (std::size_t const n)
 
void walk_elements (ParameterWalker< tt::const_flavor::require_non_const > &pw)
 
void walk_elements (ParameterWalker< tt::const_flavor::require_const > &pw) const
 
std::string key () const
 
std::string name () const
 
std::string comment () const
 
bool has_default () const
 
bool is_optional () const
 
bool is_conditional () const
 
par_type parameter_type () const
 
bool should_use () const
 
void set_value (fhicl::ParameterSet const &ps, bool trimParents)
 
void set_par_style (par_style const vt)
 
void set_key (std::string const &key)
 

Private Member Functions

std::size_t get_size () const override
 
void do_prepare_elements_for_validation (std::size_t const n) override
 
void do_walk_elements (detail::ParameterWalker< tt::const_flavor::require_non_const > &pw) override
 
void do_walk_elements (detail::ParameterWalker< tt::const_flavor::require_const > &pw) const override
 
void do_set_value (fhicl::ParameterSet const &, bool) override
 

Private Attributes

ftype value_
 

Detailed Description

template<typename T, std::size_t N = -1ull>
class fhicl::Sequence< T, N >

Definition at line 43 of file type_traits.h.

Member Typedef Documentation

template<typename T, std::size_t N = -1ull>
using fhicl::Sequence< T, N >::default_type = sequence_detail::ValueHolder<typename tt::fhicl_type<T>::default_type>

Definition at line 83 of file Sequence.h.

template<typename T, std::size_t N = -1ull>
using fhicl::Sequence< T, N >::ftype = std::array<std::shared_ptr<tt::fhicl_type<T>>, N>

Definition at line 84 of file Sequence.h.

template<typename T, std::size_t N = -1ull>
using fhicl::Sequence< T, N >::value_type = std::array<tt::return_type<T>, N>

Definition at line 85 of file Sequence.h.

Constructor & Destructor Documentation

template<typename T, std::size_t N = -1ull>
fhicl::Sequence< T, N >::Sequence ( Name &&  name)
explicit
template<typename T, std::size_t N = -1ull>
fhicl::Sequence< T, N >::Sequence ( Name &&  name,
Comment &&  comment 
)
explicit
template<typename T, std::size_t N = -1ull>
fhicl::Sequence< T, N >::Sequence ( Name &&  name,
Comment &&  comment,
std::function< bool()>  maybeUse 
)
explicit
template<typename T, std::size_t N = -1ull>
fhicl::Sequence< T, N >::Sequence ( Name &&  name,
default_type const &  defaults 
)
explicit
template<typename T, std::size_t N = -1ull>
fhicl::Sequence< T, N >::Sequence ( Name &&  name,
Comment &&  comment,
default_type const &  defaults 
)
explicit
template<typename T, std::size_t N = -1ull>
fhicl::Sequence< T, N >::Sequence ( Name &&  name,
Comment &&  comment,
std::function< bool()>  maybeUse,
default_type const &  defaults 
)
explicit

Member Function Documentation

template<typename T, std::size_t N = -1ull>
void fhicl::Sequence< T, N >::do_prepare_elements_for_validation ( std::size_t const  n)
inlineoverrideprivatevirtual

Implements fhicl::detail::SequenceBase.

Definition at line 128 of file Sequence.h.

129  {
131  }
std::size_t get_size() const override
Definition: Sequence.h:122
void check_nargs_for_bounded_sequences(std::string const &key, std::size_t expected, std::size_t provided)
Char_t n[5]
std::string key() const
Definition: ParameterBase.h:44
template<typename T, std::size_t N = -1ull>
void fhicl::Sequence< T, N >::do_set_value ( fhicl::ParameterSet const &  ,
bool   
)
inlineoverrideprivatevirtual

Implements fhicl::detail::ParameterBase.

Definition at line 148 of file Sequence.h.

149  {}
template<typename T, std::size_t N = -1ull>
void fhicl::Sequence< T, N >::do_walk_elements ( detail::ParameterWalker< tt::const_flavor::require_non_const > &  pw)
inlineoverrideprivatevirtual

Implements fhicl::detail::SequenceBase.

Definition at line 134 of file Sequence.h.

136  {
137  cet::for_all(value_, [&pw](auto& e) { pw.walk_over(*e); });
138  }
Float_t e
Definition: plot.C:34
template<typename T, std::size_t N = -1ull>
void fhicl::Sequence< T, N >::do_walk_elements ( detail::ParameterWalker< tt::const_flavor::require_const > &  pw) const
inlineoverrideprivatevirtual

Implements fhicl::detail::SequenceBase.

Definition at line 141 of file Sequence.h.

143  {
144  cet::for_all(value_, [&pw](auto const& e) { pw.walk_over(*e); });
145  }
Float_t e
Definition: plot.C:34
bool fhicl::detail::SequenceBase::empty ( void  ) const
inlineinherited

Definition at line 29 of file SequenceBase.h.

References fhicl::detail::SequenceBase::size().

Referenced by fhicl::detail::PrintAllowedConfiguration::enter_sequence().

30  {
31  return size() == 0;
32  }
std::size_t size() const
Definition: SequenceBase.h:34
template<typename T, std::size_t N = -1ull>
std::size_t fhicl::Sequence< T, N >::get_size ( ) const
inlineoverrideprivatevirtual

Implements fhicl::detail::SequenceBase.

Definition at line 122 of file Sequence.h.

123  {
124  return value_.size();
125  }
bool fhicl::detail::ParameterBase::is_conditional ( ) const
inlineinherited
std::string fhicl::detail::ParameterBase::key ( ) const
inlineinherited

Definition at line 44 of file ParameterBase.h.

References fhicl::detail::ParameterMetadata::key(), and fhicl::detail::ParameterBase::mdata_.

Referenced by fhicl::detail::PrintAllowedConfiguration::after_action(), fhicl::detail::ValidateThenSet::before_action(), fhicl::detail::PrintAllowedConfiguration::before_action(), fhicl::detail::SearchAllowedConfiguration::before_action(), fhicl::detail::PrintAllowedConfiguration::cacheTopLevelParameter(), detinfo::LArPropertiesStandard::Configure(), fhicl::OptionalSequence< Table< T >< art::RootInputFileSequence::Config::SecondaryFile > >::do_prepare_elements_for_validation(), fhicl::OptionalTuple< ARGS... >::do_prepare_elements_for_validation(), fhicl::OptionalSequence< T,-1ull >::do_prepare_elements_for_validation(), fhicl::detail::ValidateThenSet::enter_sequence(), fhicl::detail::PrintAllowedConfiguration::enter_sequence(), evgen::MARLEYHelper::fhicl_parameter_to_json(), fhicl::detail::SearchAllowedConfiguration::form_absolute(), fhicl::DelegatedParameter::get(), fhicl::OptionalDelegatedParameter::get_if_present(), fhicl::OptionalDelegatedParameter::hasValue(), fhicl::detail::MaybeDisplayParent::is_sequence_element(), fhicl::detail::PrintAllowedConfiguration::maybeReleaseTopLevelParameter(), fhicl::detail::RegisterIfTableMember::RegisterIfTableMember(), and fhicl::detail::PrintAllowedConfiguration::suppressFormat().

45  {
46  return mdata_.key();
47  }
template<typename T, std::size_t N = -1ull>
auto fhicl::Sequence< T, N >::operator() ( ) const
inline

Definition at line 104 of file Sequence.h.

105  {
106  value_type result = {{tt::return_type<T>()}};
107  cet::transform_all(
108  value_, result.begin(), [](auto const& elem) { return (*elem)(); });
109  return result;
110  }
std::array< tt::return_type< T >, N > value_type
Definition: Sequence.h:85
typename return_type_impl< ARGS... >::value_type return_type
Definition: type_traits.h:342
template<typename T, std::size_t N = -1ull>
auto fhicl::Sequence< T, N >::operator() ( std::size_t  i) const
inline

Definition at line 113 of file Sequence.h.

114  {
115  return (*value_.at(i))();
116  }
void fhicl::detail::SequenceBase::prepare_elements_for_validation ( std::size_t const  n)
inlineinherited

Definition at line 40 of file SequenceBase.h.

References fhicl::detail::SequenceBase::do_prepare_elements_for_validation().

Referenced by fhicl::detail::ValidateThenSet::enter_sequence().

41  {
43  }
virtual void do_prepare_elements_for_validation(std::size_t)=0
Char_t n[5]
void fhicl::detail::ParameterBase::set_key ( std::string const &  key)
inlineinherited
void fhicl::detail::ParameterBase::set_par_style ( par_style const  vt)
inlineinherited
void fhicl::detail::ParameterBase::set_value ( fhicl::ParameterSet const &  ps,
bool  trimParents 
)
inlineinherited

Definition at line 96 of file ParameterBase.h.

References fhicl::detail::ParameterBase::do_set_value().

Referenced by fhicl::detail::ValidateThenSet::after_action().

97  {
98  do_set_value(ps, trimParents);
99  }
virtual void do_set_value(fhicl::ParameterSet const &, bool trimParents)=0
bool fhicl::detail::ParameterBase::should_use ( ) const
inlineinherited
std::size_t fhicl::detail::SequenceBase::size ( void  ) const
inlineinherited

Definition at line 34 of file SequenceBase.h.

References fhicl::detail::SequenceBase::get_size().

Referenced by fhicl::detail::SequenceBase::empty(), and fhicl::detail::PrintAllowedConfiguration::enter_sequence().

35  {
36  return get_size();
37  }
virtual std::size_t get_size() const =0
void fhicl::detail::SequenceBase::walk_elements ( ParameterWalker< tt::const_flavor::require_non_const > &  pw)
inlineinherited

Definition at line 45 of file SequenceBase.h.

References fhicl::detail::SequenceBase::do_walk_elements().

46  {
47  do_walk_elements(pw);
48  }
virtual void do_walk_elements(ParameterWalker< tt::const_flavor::require_non_const > &)=0
void fhicl::detail::SequenceBase::walk_elements ( ParameterWalker< tt::const_flavor::require_const > &  pw) const
inlineinherited

Definition at line 50 of file SequenceBase.h.

References fhicl::detail::SequenceBase::do_prepare_elements_for_validation(), fhicl::detail::SequenceBase::do_walk_elements(), and fhicl::detail::SequenceBase::get_size().

51  {
52  do_walk_elements(pw);
53  }
virtual void do_walk_elements(ParameterWalker< tt::const_flavor::require_non_const > &)=0

Member Data Documentation

template<typename T, std::size_t N = -1ull>
ftype fhicl::Sequence< T, N >::value_
private

Definition at line 119 of file Sequence.h.


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