Add test utilities for C++ and Java
Summary: @public Test utility on top of the new event system that maintains a counter of instantiated nodes. Meant to replace the global node counter. Reviewed By: SidharthGuglani Differential Revision: D15174855 fbshipit-source-id: 6998472f95a09b8da652257a26596164bdcf43d6
This commit is contained in:
committed by
Facebook Github Bot
parent
88b23ebb3d
commit
6e04631862
@@ -24,6 +24,10 @@ std::function<Event::Subscriber>& globalEventSubscriber() {
|
||||
|
||||
} // namespace
|
||||
|
||||
void Event::reset() {
|
||||
globalEventSubscriber() = nullptr;
|
||||
}
|
||||
|
||||
void Event::subscribe(std::function<Subscriber>&& subscriber) {
|
||||
if (globalEventSubscriber() != nullptr) {
|
||||
throw std::logic_error(
|
||||
|
@@ -35,6 +35,8 @@ struct Event {
|
||||
};
|
||||
};
|
||||
|
||||
static void reset();
|
||||
|
||||
static void subscribe(std::function<Subscriber>&& subscriber);
|
||||
|
||||
template <Type E>
|
||||
|
Reference in New Issue
Block a user