-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
base
committed
Nov 14, 2011
1 parent
5d69282
commit 1f97489
Showing
6 changed files
with
431 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
## ofEvent ## | ||
|
||
define ofEvent as a poco FIFOEvent to create your own events use: ofEvent<argType> myEvent | ||
|
||
### ofEvent() ### | ||
|
||
### ofEvent(const ofEvent<ArgumentsType> & mom) ### | ||
allow copy of events, by copying everything except the mutex | ||
|
||
### ofEvent<ArgumentsType> & operator=(const ofEvent<ArgumentsType> & mom) ### | ||
|
||
|
||
### void ofAddListener(EventType & event, ListenerClass * listener, void (ListenerClass::*listenerMethod)(const void*, ArgumentsType&)) ## | ||
|
||
register any method of any class to an event. the method must provide one of the following | ||
signatures: | ||
void method(ArgumentsType & args) | ||
void method(const void * sender, ArgumentsType &args) | ||
ie: | ||
ofAddListener(addon.newIntEvent, this, &Class::method) | ||
|
||
### void ofAddListener(EventType & event, ListenerClass * listener, void (ListenerClass::*listenerMethod)(ArgumentsType&)) ### | ||
|
||
|
||
|
||
### void ofRemoveListener(EventType & event, ListenerClass * listener, void (ListenerClass::*listenerMethod)(const void*, ArgumentsType&)) ### | ||
|
||
unregister any method of any class to an event. | ||
the method must provide one the following | ||
signatures: | ||
void method(ArgumentsType & args) | ||
void method(const void * sender, ArgumentsType &args) | ||
ie: | ||
ofAddListener(addon.newIntEvent, this, &Class::method) | ||
|
||
### void ofRemoveListener(EventType & event, ListenerClass * listener, void (ListenerClass::*listenerMethod)(ArgumentsType&)) ### | ||
|
||
### void ofNotifyEvent(EventType & event, ArgumentsType & args, SenderType * sender) ### | ||
notifies an event so all the registered listeners | ||
get called | ||
ie: | ||
ofNotifyEvent(addon.newIntEvent, intArgument, this) | ||
or in case there's no sender: | ||
ofNotifyEvent(addon.newIntEvent, intArgument) | ||
|
||
### void ofNotifyEvent(EventType & event, ArgumentsType & args) ## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.