1 #ifndef fhiclcpp_detail_ParameterSetImplHelpers_h 2 #define fhiclcpp_detail_ParameterSetImplHelpers_h 4 #include "boost/algorithm/string.hpp" 5 #include "cetlib/container_algorithms.h" 6 #include "cetlib/split_by_regex.h" 21 Keys(std::vector<std::string>
const& keys, std::string
const&
last)
44 std::vector<std::string> keys;
45 boost::algorithm::split(keys, key, boost::algorithm::is_any_of(
"."));
48 keys.erase(std::remove(keys.begin(), keys.end(),
""), keys.end());
53 std::string
const last = keys.back();
56 return Keys{keys, last};
65 std::vector<std::size_t>
const&
indices)
66 : name_{name}, indices_{
indices}
91 auto tokens = cet::split_by_regex(key, R
"((\]\[|\[|\]))"); 93 auto const name = tokens.front();
94 tokens.erase(tokens.begin());
96 std::vector<std::size_t>
indices;
98 tokens, std::back_inserter(indices), [](std::string
const& index) {
99 return std::stoul(index);
122 if (*it >= seq.size())
auto const & last() const
Keys get_names(std::string const &key)
std::vector< std::string > tables_
auto const & tables() const
std::vector< std::size_t > indices_
constexpr std::array< std::size_t, geo::vect::dimension< Vector >)> indices()
Returns a sequence of indices valid for a vector of the specified type.
SequenceKey get_sequence_indices(std::string const &key)
auto const & indices() const
auto const & name() const
SequenceKey(std::string const &name, std::vector< std::size_t > const &indices)
Keys(std::vector< std::string > const &keys, std::string const &last)
std::vector< std::size_t >::const_iterator cit_size_t
cet::coded_exception< error, detail::translate > exception
std::vector< boost::any > ps_sequence_t
bool find_an_any(cit_size_t it, cit_size_t const cend, boost::any &a)