Project

General

Profile

Actions

Task #1118

closed

lightweight event emitter

Added by Junxiao Shi almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Core
Target version:
Start date:
01/22/2014
Due date:
01/23/2014
% Done:

100%

Estimated time:
5.00 h

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.

Actions #1

Updated by Junxiao Shi almost 11 years ago

  • % Done changed from 0 to 50
Actions #2

Updated by Junxiao Shi almost 11 years ago

  • Status changed from New to In Progress
Actions #3

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.

Actions #4

Updated by Junxiao Shi almost 11 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100
Actions #5

Updated by Alex Afanasyev almost 11 years ago

  • Target version set to Mock
Actions #6

Updated by Junxiao Shi almost 11 years ago

  • Status changed from Resolved to Closed
Actions #7

Updated by Junxiao Shi almost 11 years ago

  • Category set to Core
Actions

Also available in: Atom PDF