Accessor for list of settings that skips negated values when iterated over. The last boolean `false` value in the list and all earlier values are considered negated.
| 81 | //! The last boolean `false` value in the list and all earlier values are |
| 82 | //! considered negated. |
| 83 | struct SettingsSpan { |
| 84 | explicit SettingsSpan() = default; |
| 85 | explicit SettingsSpan(const SettingsValue& value) noexcept : SettingsSpan(&value, 1) {} |
| 86 | explicit SettingsSpan(const SettingsValue* data, size_t size) noexcept : data(data), size(size) {} |
| 87 | explicit SettingsSpan(const std::vector<SettingsValue>& vec) noexcept; |
| 88 | const SettingsValue* begin() const; //!< Pointer to first non-negated value. |
| 89 | const SettingsValue* end() const; //!< Pointer to end of values. |
| 90 | bool empty() const; //!< True if there are any non-negated values. |
| 91 | bool last_negated() const; //!< True if the last value is negated. |
| 92 | size_t negated() const; //!< Number of negated values. |
| 93 | |
| 94 | const SettingsValue* data = nullptr; |
| 95 | size_t size = 0; |
| 96 | }; |
| 97 | |
| 98 | //! Map lookup helper. |
| 99 | template <typename Map, typename Key> |
no outgoing calls
no test coverage detected