15 RouteEventBus::RouteEventBus() {
32 if (recv == NULL || subscriber->subscription_id != recv->subscription_id) {
33 if (subscriber->handleRouteEvent(ev)) n++;
48 recv->subscription_id = ++subscription_id;
49 subscribers.push_back(recv);
61 for (
auto it = subscribers.begin(); it != subscribers.end(); it++) {
62 if ((*it)->subscription_id == recv->subscription_id) {
63 subscribers.erase(it);
int publish(RouteEventReceiver *recv, const RouteEvent &ev)
Publish a route event.
bool subscribe(RouteEventReceiver *recv)
Subscribe from this event bus.
bool unsubscribe(RouteEventReceiver *recv)
Unsubscribe to this event bus.
The RouteEventReceiver interface.