16 auto& queries = _slots[slot];
27 auto& queries = _slots[slot];
29 return found != queries.end() ? &*found :
nullptr;
44 const auto& queries = _slots[slot];
53 const int cookie =
static_cast<int>(_cookieCounter);
54 if (std::none_of(queries.begin(), queries.end(),
71 _slots[slot].push_back(
72 {.Name = std::move(name), .Callback = std::move(callback), .SentAtSec = now, .Cookie = cookie});
82 auto& queries = _slots[slot];
83 auto it = std::find_if(queries.begin(), queries.end(),
85 if (it == queries.end() || it->Name != name)
105 for (
auto& queries : _slots)
113 return IsValidSlot(slot) ? _slots[slot].size() : 0;
std::function< void(int slot, ClientConVarStatus status, std::string_view name, std::string_view value)> QueryCallback
static constexpr double TimeoutSec
size_t Count(int slot) const
void Add(int slot, int cookie, std::string name, ClientConVars::QueryCallback callback, double now)
static constexpr size_t MaxPendingPerSlot
std::optional< PendingConVarQuery > Take(int slot, int cookie, std::string_view name)
void Prune(int slot, double now)
static constexpr uint32_t MaxCookie
bool Full(int slot) const
PendingConVarQuery * Find(int slot, std::string_view name)
constexpr bool IsValidSlot(int slot)
One outstanding client convar query, identified by the cookie sent to the client.
std::string Name
Convar name the query asked for.
double SentAtSec
Caller-supplied monotonic timestamp of the send.