Listener-style Interface in C++

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
A common use for anonymous inner classes in Java is listeners. There
is an article about how to write event listener in Java with event
adapters
http://download.oracle.com/javase/tutorial/uiswing/events/generalrules.html
In java98 I think it is called Listener Paradigm.

There must be some equivalent listener-style interfaces to be seen in C
++, however, I am not aware of any at this moment. Could anybody
please share some

knowledge with me about listener-style interfaces in C++? Can I
implement an equivalent Listener Paradigm in C++ with event adapters?
IS there any sample

around by customerizing the OBSERVER pattern?

Thanks!

Re: Listener-style Interface in C++
Quoted text here. Click to load it

You should google for "Observer Pattern".

C++0x supports lambdas, which is one better than inner classes.
You don't need them though, you can just use interfaces
(multiply inheritable classes with no variables and no private
methods).

Now go and do your own homework ;-)

Clifford Heath.

Site Timeline