-
Notifications
You must be signed in to change notification settings - Fork 1
paraka/template_observer
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
= How this works = This is old stuff I have rescued from my hard disk: observer pattern implemented using templates. There are two generic classes Observer and Subject with generic implementation of the pattern. These are implemented in Subject.h and Oberver.h files. There are one more file test_observer.cpp where are defined two concrete implementations of Subject and Observer called ConcreteSubject and ConcreteObserver. The way of use is simple. You have to derive from Subject making a template of the ConcreteSubject class and then call notify() when you want to say your observers that something has changed. For be able to do this you have to register your ConcreteObserver with the subject with register_observer() method. ConcreteObserver class must derive from Observer and must implement its update() method which will be called when something in ConcrteSubject changes. For details take a look to the code. = Compile = $ mkdir build $ cd build $ cmake .. $ make
About
Observer pattern with templates
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published