Listener-style Interface in C++

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

formatting link
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!

Reply to
like2learn
Loading thread data ...

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.

Reply to
Clifford Heath

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.