载入中...
搜索中...
未找到
WatchIndex.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
9#include <cstdint>
10#include <string>
11#include <string_view>
12#include <unordered_map>
13#include <vector>
14
15namespace eve::emergence {
16
24public:
26 void clear();
27
33 void addRule(std::uint32_t ruleIndex, const std::vector<std::string>& keys);
34
41 [[nodiscard]] std::size_t collect(std::string_view key, std::vector<std::uint32_t>& out) const;
42
44 [[nodiscard]] std::size_t keyCount() const noexcept { return index_.size(); }
45
46private:
47 std::unordered_map<std::string, std::vector<std::uint32_t>> index_;
48};
49
50} // namespace eve::emergence
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
std::uint32_t key
Dense, sorted multi-map used to wake O(watchers) rules on a fact change.
Definition WatchIndex.h:23
std::size_t keyCount() const noexcept
Number of distinct keys with at least one subscriber.
Definition WatchIndex.h:44