34inline const std::string
STATE =
"state";
36inline const std::string
FORCES =
"forces";
60 template <
typename... S>
63 validate_item_name(
name);
64 _item_names.emplace_back(
name);
66 (validate_item_name(names), ...);
67 (_item_names.emplace_back(std::forward<S>(names)), ...);
70 template <
typename... S>
73 validate_item_name(
name);
74 _item_names.emplace_back(
name);
76 (validate_item_name(names), ...);
77 (_item_names.emplace_back(std::forward<S>(names)), ...);
80 template <
typename Container,
81 typename =
typename std::enable_if_t<
82 !std::is_convertible_v<Container, std::string> &&
83 std::is_convertible_v<
typename std::iterator_traits<
84 decltype(std::declval<Container>().begin())>::value_type,
86 std::is_convertible_v<
typename std::iterator_traits<
87 decltype(std::declval<Container>().
end())>::value_type,
91 _item_names = std::vector<std::string>(c.begin(), c.end());
92 for (
const auto &
name : _item_names)
93 validate_item_name(
name);
96 using iterator = std::vector<std::string>::iterator;
111 explicit operator std::vector<std::string>()
const;
113 const std::vector<std::string> &
vec()
const {
return _item_names; }
162 void validate_item_name(
const std::string &)
const;
164 std::vector<std::string> _item_names;
The accessor containing all the information needed to access an item in a LabeledAxis.
Definition LabeledAxisAccessor.h:56
LabeledAxisAccessor slice(std::size_t N, std::size_t M) const
Extract M labels staring at N.
bool is_old_force() const
LabeledAxisAccessor slice(std::size_t N) const
Remove the leading N items from the labels.
LabeledAxisAccessor(const std::string &name, S &&... names)
Definition LabeledAxisAccessor.h:71
bool is_parameter() const
const_iterator begin() const
Definition LabeledAxisAccessor.h:107
std::vector< std::string >::iterator iterator
Definition LabeledAxisAccessor.h:96
LabeledAxisAccessor current() const
Returns the "current" counterpart.
LabeledAxisAccessor append(const LabeledAxisAccessor &other) const
Append another accessor.
LabeledAxisAccessor prepend(const LabeledAxisAccessor &other) const
Prepend another accessor.
LabeledAxisAccessor(const char *name, S &&... names)
Definition LabeledAxisAccessor.h:61
LabeledAxisAccessor with_suffix(const std::string &suffix) const
Append a suffix to the final item name.
LabeledAxisAccessor old() const
Returns the "old" counterpart.
LabeledAxisAccessor(const Container &c)
Definition LabeledAxisAccessor.h:89
const std::string & operator[](std::size_t i) const
bool start_with(const LabeledAxisAccessor &other) const
Check if this accessor begins with another accessor.
iterator end()
Definition LabeledAxisAccessor.h:106
const_iterator end() const
Definition LabeledAxisAccessor.h:108
LabeledAxisAccessor()=default
iterator begin()
Definition LabeledAxisAccessor.h:105
std::vector< std::string >::const_iterator const_iterator
Definition LabeledAxisAccessor.h:97
bool is_old_state() const
LabeledAxisAccessor remount(const LabeledAxisAccessor &other, int64_t n=1) const
A combination of slice and prepend.
const std::vector< std::string > & vec() const
Definition LabeledAxisAccessor.h:113
Definition DiagnosticsInterface.h:31
std::ostream & operator<<(std::ostream &, const EnumSelection &)
const std::string OLD_STATE
Definition LabeledAxisAccessor.h:35
LabeledAxisAccessor SubaxisName
Definition LabeledAxisAccessor.h:186
const std::string STATE
Definition LabeledAxisAccessor.h:34
std::string name(ElasticConstant p)
bool operator==(const LabeledAxis &a, const LabeledAxis &b)
const std::string OLD_FORCES
Definition LabeledAxisAccessor.h:37
bool operator!=(const LabeledAxis &a, const LabeledAxis &b)
const std::string RESIDUAL
Definition LabeledAxisAccessor.h:38
const std::string FORCES
Definition LabeledAxisAccessor.h:36
LabeledAxisAccessor VariableName
Definition LabeledAxisAccessor.h:185
const std::string PARAMETERS
Definition LabeledAxisAccessor.h:39
bool operator<(const LabeledAxisAccessor &a, const LabeledAxisAccessor &b)
The (strict) smaller than operator is created so as to use LabeledAxisAccessor in sorted data structu...
std::vector< std::string > reserved_subaxis_names()