载入中...
搜索中...
未找到
eve::emergence::WatchIndex类 参考

Dense, sorted multi-map used to wake O(watchers) rules on a fact change. 更多...

#include <WatchIndex.h>

Public 成员函数

void clear ()
 Remove every subscription.
 
void addRule (std::uint32_t ruleIndex, const std::vector< std::string > &keys)
 Index one rule under each of its watch keys.
 
std::size_t collect (std::string_view key, std::vector< std::uint32_t > &out) const
 Collect unique rule indexes that watch a key into out.
 
std::size_t keyCount () const noexcept
 Number of distinct keys with at least one subscriber.
 

详细描述

Dense, sorted multi-map used to wake O(watchers) rules on a fact change.

Rule ids are stored as dense integers assigned by RuleEngine. String ids are resolved by the engine; this index never owns string storage.

在文件 WatchIndex.h 第 23 行定义.

成员函数说明

◆ addRule()

void eve::emergence::WatchIndex::addRule ( std::uint32_t  ruleIndex,
const std::vector< std::string > &  keys 
)

Index one rule under each of its watch keys.

参数
ruleIndexDense rule slot owned by the catalogue.
keysCanonical fact keys; duplicates are ignored.

在文件 WatchIndex.cpp 第 9 行定义.

引用了 key.

◆ clear()

void eve::emergence::WatchIndex::clear ( )

Remove every subscription.

在文件 WatchIndex.cpp 第 7 行定义.

◆ collect()

std::size_t eve::emergence::WatchIndex::collect ( std::string_view  key,
std::vector< std::uint32_t > &  out 
) const

Collect unique rule indexes that watch a key into out.

参数
keyCanonical fact key.
outAppended dense indexes; caller clears or uses a set for uniqueness.
返回
Number of subscribers appended (including duplicates across calls).

在文件 WatchIndex.cpp 第 18 行定义.

引用了 key.

◆ keyCount()

std::size_t eve::emergence::WatchIndex::keyCount ( ) const
inlinenoexcept

Number of distinct keys with at least one subscriber.

在文件 WatchIndex.h 第 44 行定义.


该类的文档由以下文件生成: