EventBus Class Diagram2
2017-03-27 14:43:46 0 举报
EventBus 类是一个用于实现事件驱动编程模式的类。它允许不同的组件之间通过发布和订阅事件来进行通信,从而实现解耦和模块化。在 EventBus 类中,有两个主要的方法:publish() 和 subscribe()。publish() 方法用于发布事件,而 subscribe() 方法用于订阅事件。当有事件发生时,所有订阅了该事件的组件都会收到通知。EventBus 类还可以处理事件的类型和参数,以便更好地组织和管理事件。总之,EventBus 类是一个非常有用的工具,可以帮助开发人员更轻松地实现复杂的应用程序。
作者其他创作
大纲/内容
ConcreteEventHandlerB
- attributeA- attributeB
+ onEvent()
EventRegistration
-registrations:vector-handler:void *
+ GetHandler():void *+ Disconnect()
EventBus_
+ GetInstance():EventBus_*+ RegisterHandler(EventHandler & handler)+ SendEventSync(const Event &e)+ SendEventAsync(Event *e)- DoEventAsync()
HandlerRegistration
+ Disconnect()
EventHandler
+ onEvent()- dispatch()
ConcreteEventHandlerA
0 条评论
下一页