12 return on ?
"1" :
"0";
15WriteCache::Sent* WriteCache::For(
int slot)
26 std::optional<Sent>& sent = _slots[slot];
35 std::string_view value)
37 Sent* sent = For(slot);
43 const std::string& key = BuildKey(kind, elementId, name);
44 if (
auto it = sent->Values.find(key); it != sent->Values.end())
46 if (it->second == value)
55 sent->Values.emplace(key, value);
66 Sent* sent = For(slot);
72 const auto it = sent->Values.find(BuildKey(
WriteKind::Class, elementId, className));
73 return it != sent->Values.end() && it->second ==
ClassValue(
true);
78 Sent* sent = For(slot);
79 if (!sent || sent->Cursor == shown)
90 Sent* sent = For(slot);
91 if (!sent || sent->Failed)
102 Sent* sent = For(slot);
108 sent->Values.clear();
109 sent->Cursor.reset();
119 if (Sent* sent = For(slot))
121 sent->Cursor.reset();
131const std::string& WriteCache::BuildKey(
WriteKind kind, std::string_view elementId, std::string_view name)
133 _key.assign(1,
static_cast<char>(kind));
void Invalidate(int slot)
bool IsFirstFailure(int slot)
bool Changed(int slot, WriteKind kind, std::string_view elementId, std::string_view name, std::string_view value)
void ResetCursor(int slot)
bool CursorChanged(int slot, bool shown)
void RemoveSlot(int slot)
bool IsClassOn(int slot, std::string_view elementId, std::string_view className)
bool ClassChanged(int slot, std::string_view elementId, std::string_view className, bool on)
static std::string_view ClassValue(bool on)
constexpr bool IsValidSlot(int slot)
constexpr int EveryoneSlot
static constexpr char KeySeparator