命名空间 | |
| namespace | detail |
类 | |
| struct | OwnedProviderHandle |
| Generation-qualified id for one owned capability provider. 更多... | |
| class | OwnedProviderLease |
Owning lease that keeps a shared_ptr provider alive while borrowed. 更多... | |
| class | OwnedProviderRegistry |
| Thread-safe owned-provider table keyed by capability name + provider id. 更多... | |
| class | ProviderRef |
| One-shot borrowed capability pointer for composition roots and hot paths. 更多... | |
函数 | |
| template<class I > | |
| void | provide (I *impl) |
| Provides . | |
| template<class I > | |
| I * | query () |
| Queries . | |
| template<class I > | |
| void | revoke (I *impl) |
| Revoke. | |
| template<class I > | |
| void | addListener (I *impl, int priority=0) |
| Adds listener. | |
| template<class I > | |
| void | removeListener (I *impl) |
| Removes listener. | |
| template<class I > | |
| size_t | listenerCount () |
| Listener count. | |
| template<class I > | |
| I * | listenerAt (size_t index) |
| Listener at. | |
| template<class I , class F > | |
| void | forEach (F &&fn) |
Call fn for every implementation of I in priority order. | |
| template<class I , class F > | |
| bool | forEachUntil (F &&fn) |
Call fn for each snapshotted implementation until one returns true. | |
函数说明
◆ addListener()
| void eve::cap::addListener | ( | I * | impl, |
| int | priority = 0 |
||
| ) |
Adds listener.
Add one of possibly many implementations. Lower priority runs first.
Adds listener raw.
在文件 Capability.h 第 151 行定义.
引用了 eve::cap::detail::addListenerRaw(), impl , 以及 priority.
◆ forEach()
| void eve::cap::forEach | ( | F && | fn | ) |
Call fn for every implementation of I in priority order.
Dispatch uses a snapshot of the listener pointers taken before the first callback. Registrations and withdrawals made by a callback affect later dispatches, but not the dispatch already in progress. A withdrawn listener must therefore remain alive until the current dispatch returns.
For each.
在文件 Capability.h 第 186 行定义.
引用了 fn, impl, eve::cap::detail::listenerAtRaw(), eve::cap::detail::listenerCountRaw() , 以及 n.
◆ forEachUntil()
| bool eve::cap::forEachUntil | ( | F && | fn | ) |
Call fn for each snapshotted implementation until one returns true.
Listener mutations have the same next-dispatch semantics as forEach().
- 返回
- Whether any implementation returned true.
For each until.
在文件 Capability.h 第 205 行定义.
引用了 fn, impl, eve::cap::detail::listenerAtRaw(), eve::cap::detail::listenerCountRaw() , 以及 n.
◆ listenerAt()
| I * eve::cap::listenerAt | ( | size_t | index | ) |
◆ listenerCount()
| size_t eve::cap::listenerCount | ( | ) |
◆ provide()
| void eve::cap::provide | ( | I * | impl | ) |
Provides .
Register the single implementation of I, replacing any previous one.
Provides raw.
在文件 Capability.h 第 80 行定义.
引用了 impl , 以及 eve::cap::detail::provideRaw().
◆ query()
| I * eve::cap::query | ( | ) |
Queries .
The implementation of I, or nullptr when no module provides it.
在文件 Capability.h 第 88 行定义.
◆ removeListener()
| void eve::cap::removeListener | ( | I * | impl | ) |
Removes listener.
Removes listener raw.
在文件 Capability.h 第 158 行定义.
引用了 impl , 以及 eve::cap::detail::removeListenerRaw().
◆ revoke()
| void eve::cap::revoke | ( | I * | impl | ) |
Revoke.
Withdraw impl; a no-op when something else has since taken the slot.
Revoke raw.
在文件 Capability.h 第 143 行定义.
引用了 impl , 以及 eve::cap::detail::revokeRaw().