2 #include "boost/algorithm/string.hpp" 3 #include "cetlib/container_algorithms.h" 4 #include "cetlib/split_by_regex.h" 12 std::regex
const reBrackets{R
"((\]\[|\[|\]))"}; 20 Keys::Keys(std::vector<std::string>
const& keys, std::string
const& last)
25 std::vector<std::string>
const&
40 std::vector<std::string> keys;
41 boost::algorithm::split(keys, key, boost::algorithm::is_any_of(
"."));
44 keys.erase(std::remove(keys.begin(), keys.end(),
""), keys.end());
49 std::string
const last = keys.back();
52 return Keys{keys, last};
59 std::vector<std::size_t>
const&
indices)
71 std::vector<std::size_t>
const&
82 auto tokens = cet::split_by_regex(key, reBrackets);
84 auto const name = tokens.front();
85 tokens.erase(tokens.begin());
87 std::vector<std::size_t>
indices;
89 tokens, std::back_inserter(indices), [](std::string
const& index) {
90 return std::stoul(index);
108 if (*it >= seq.size())
111 a = std::move(seq[*it]);
decltype(auto) constexpr cend(T &&obj)
ADL-aware version of std::cend.
Keys get_names(std::string const &key)
std::string const & name() const noexcept
std::vector< std::size_t > const & indices() const noexcept
std::vector< std::any > ps_sequence_t
std::vector< std::string > const & tables() const noexcept
std::vector< std::string > tables_
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.
bool find_an_any(std::vector< std::size_t >::const_iterator it, std::vector< std::size_t >::const_iterator const cend, std::any &a)
SequenceKey get_sequence_indices(std::string const &key)
SequenceKey(std::string const &name, std::vector< std::size_t > const &indices)
Keys(std::vector< std::string > const &keys, std::string const &last)
std::string const & last() const noexcept
cet::coded_exception< error, detail::translate > exception