MCPcopy Create free account
hub / github.com/ElementsProject/elements / SettingsSpan

Class SettingsSpan

src/util/settings.h:83–96  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

81//! The last boolean `false` value in the list and all earlier values are
82//! considered negated.
83struct 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.
99template <typename Map, typename Key>

Callers 2

MergeSettingsFunction · 0.85
ReadConfigFilesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected