Is the observer design pattern already defined in STL (Like the java.util.Observer and java.util.Observable in Java) ?
No, but Boost.Signals2 gives you something similar.
As far as my knowledge goes in C++, STL doesn't have an implementation for Observer pattern. There was a proposal for Signal/Slot for standard library in TR2 though.
There are plenty of libraries which provides implementation for Observer pattern Qt library being one of the pioneers. The boost library has an implementation (see Boost::Signals & Boost::Signals2).
The Poco C++ library has a neat implementation of the observer pattern (see NotificationCenter).
libsigc++, cpp-events are some of the other libraries that provide signal/slot implementations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With