This is a powerful templated Observer Pattern using pointers.
The goal of the this test is to simply notify the observers of the observable's state and update accordingly.
- Author
- Sagun Khosla <sagun.nosp@m.xp@g.nosp@m.mail..nosp@m.com
86{
90
93
94 BOOST_CHECK_NE(a->
_a, b->
_a);
95 BOOST_CHECK_NE(a->
_a, c->
_a);
96
98
99 BOOST_CHECK_EQUAL(a->
_a, b->
_a);
100 BOOST_CHECK_EQUAL(a->
_a, c->
_a);
101
102 delete a;
103 delete b;
104 delete c;
105}
Definition: ObservableStatusTest.cpp:52
Definition: ObservableStatusTest.cpp:69
Definition: ObservableStatusTest.cpp:58
int _a
Definition: ObservableStatusTest.cpp:48
void register_observable(OBSERVABLE obs)
Definition: ObservableStatus.hpp:61
void register_observers(HAS_OBSERVERS... obs)
Definition: ObservableStatus.hpp:62
void notify_observers()
Definition: ObservableStatus.hpp:59
References D::_a, ObservableStatus< OBSERVABLE, HAS_OBSERVERS >::notify_observers(), ObservableStatus< OBSERVABLE, HAS_OBSERVERS >::register_observable(), and ObservableStatus< OBSERVABLE, HAS_OBSERVERS >::register_observers().