Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
The Observer Design Pattern allows to 'define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically' [1].
Note that this version is shorter than the one below using the hand-crafted slot management.
#include <iostream> |
Screen output:
I will be echoed |
The name of this example is misleading: this version uses hand-crafted slot management, instead of using Boost.Signals2.
#include <iostream> |
Screen output:
I will be echoed |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.