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; }
115 std::string
str()
const;
121 const std::string &
operator[](
size_t i)
const;
162 void validate_item_name(
const std::string &)
const;
164 std::vector<std::string> _item_names;
168bool operator==(
const LabeledAxisAccessor & a,
const LabeledAxisAccessor & b);
171bool operator!=(
const LabeledAxisAccessor & a,
const LabeledAxisAccessor & b);
177bool operator<(
const LabeledAxisAccessor & a,
const LabeledAxisAccessor & b);
183std::ostream &
operator<<(std::ostream & os,
const LabeledAxisAccessor & accessor);
The accessor containing all the information needed to access an item in a LabeledAxis.
Definition LabeledAxisAccessor.h:56
bool is_old_force() const
Definition LabeledAxisAccessor.cxx:142
LabeledAxisAccessor(const std::string &name, S &&... names)
Definition LabeledAxisAccessor.h:71
size_t size() const
Definition LabeledAxisAccessor.cxx:58
bool is_parameter() const
Definition LabeledAxisAccessor.cxx:154
bool is_state() const
Definition LabeledAxisAccessor.cxx:124
const_iterator begin() const
Definition LabeledAxisAccessor.h:107
std::vector< std::string >::iterator iterator
Definition LabeledAxisAccessor.h:96
LabeledAxisAccessor append(const LabeledAxisAccessor &axis) const
Append another accessor.
Definition LabeledAxisAccessor.cxx:78
LabeledAxisAccessor current() const
Returns the "current" counterpart.
Definition LabeledAxisAccessor.cxx:160
LabeledAxisAccessor prepend(const LabeledAxisAccessor &axis) const
Prepend another accessor.
Definition LabeledAxisAccessor.cxx:84
LabeledAxisAccessor(const char *name, S &&... names)
Definition LabeledAxisAccessor.h:61
bool empty() const
Definition LabeledAxisAccessor.cxx:52
bool start_with(const LabeledAxisAccessor &axis) const
Check if this accessor begins with another accessor.
Definition LabeledAxisAccessor.cxx:118
LabeledAxisAccessor with_suffix(const std::string &suffix) const
Append a suffix to the final item name.
Definition LabeledAxisAccessor.cxx:70
LabeledAxisAccessor remount(const LabeledAxisAccessor &axis, int64_t n=1) const
A combination of slice and prepend.
Definition LabeledAxisAccessor.cxx:112
LabeledAxisAccessor old() const
Returns the "old" counterpart.
Definition LabeledAxisAccessor.cxx:172
LabeledAxisAccessor(const Container &c)
Definition LabeledAxisAccessor.h:89
bool is_residual() const
Definition LabeledAxisAccessor.cxx:148
iterator end()
Definition LabeledAxisAccessor.h:106
bool is_force() const
Definition LabeledAxisAccessor.cxx:136
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
LabeledAxisAccessor slice(int64_t n) const
Remove the leading n items from the labels.
Definition LabeledAxisAccessor.cxx:92
std::string str() const
Definition LabeledAxisAccessor.cxx:46
bool is_old_state() const
Definition LabeledAxisAccessor.cxx:130
const std::vector< std::string > & vec() const
Definition LabeledAxisAccessor.h:113
const std::string & operator[](size_t i) const
Definition LabeledAxisAccessor.cxx:64
Definition DiagnosticsInterface.cxx:30
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)
Definition ElasticityConverter.cxx:30
bool operator==(const LabeledAxis &a, const LabeledAxis &b)
Definition LabeledAxis.cxx:503
const std::string OLD_FORCES
Definition LabeledAxisAccessor.h:37
bool operator!=(const LabeledAxis &a, const LabeledAxis &b)
Definition LabeledAxis.cxx:509
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
std::ostream & operator<<(std::ostream &os, const EnumSelection &es)
Definition EnumSelection.cxx:32
bool operator<(const LabeledAxisAccessor &a, const LabeledAxisAccessor &b)
The (strict) smaller than operator is created so as to use LabeledAxisAccessor in sorted data structu...
Definition LabeledAxisAccessor.cxx:207
std::vector< std::string > reserved_subaxis_names()
Definition LabeledAxisAccessor.cxx:34