Task #1118
closedlightweight event emitter
100%
Description
Develop a lightweight event emitter, based of list of callbacks.
The event emitter is added as a field in the event source, and supports only one type of event.
Multiple events require multiple event emitters on the event source class.
Zero or more listeners can be registered on the event emitter.
The event could be triggered with zero or more arguments.
Type of arguments are determined by template arguments of the event emitter.
When the event is triggered, all listeners are invoked.
If there is zero event listener, nothing happens.
Updated by Junxiao Shi almost 11 years ago
- Status changed from New to In Progress
Updated by Junxiao Shi almost 11 years ago
- Description updated (diff)
Due to the limitation of boost::function, there is no easy way to implement "unregister a listener". I'm removing this requirement, because there's no usage scenario that needs this feature.
The implementation will have a method to unregister all listeners.
Updated by Junxiao Shi almost 11 years ago
- Status changed from In Progress to Resolved
- % Done changed from 50 to 100
Updated by Junxiao Shi almost 11 years ago
- Status changed from Resolved to Closed