Overview
Features
Download
Documentation
Community
Add-Ons & Services

void Event

General discussion regarding the development of POCO for contributors.

void Event

Postby arturo » 13 Jul 2012, 14:28

Hi

I use Poco Events a lot but always miss a feature where i can declare a void event with a listener with no arguments, such as:

Code: Select all

class Notifier{
public:
        Poco::BasicEvent<void> event;
        void someMethod(){
               event.notify();
        }
}


class Listener{
public:
        Notifier notifier;
        void setup(){
               notifier.event += Poco::delegate(this,&Listener::listenerMethod);
        }
        void listenerMethod(){
               // do something
        }
}



Here's a patch that adds the posibility for such an event, let me know if this is of any interest, i'm one of the developers of the open source tool openFrameworks: http://openframeworks.cc and several people in our community have expressed interest for such a feature so would be good to know if this has any posibility of being accepted before patching our own code

thanks!
Attachments
pocoVoidEvents.patch.zip
(5.54 KiB) Downloaded 163 times
arturo
 
Posts: 2
Joined: 03 Mar 2011, 16:45

Re: void Event

Postby guenter » 13 Jul 2012, 15:22

Thanks, looks good.
guenter
 
Posts: 1134
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: void Event

Postby arturo » 13 Jul 2012, 17:32

great, thanks
arturo
 
Posts: 2
Joined: 03 Mar 2011, 16:45

Re: void Event

Postby alex » 24 Jul 2012, 04:26

alex
 
Posts: 1130
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to Contributors

Who is online

Users browsing this forum: No registered users and 0 guests