SWADP/Opdracht_4/Observer/Observer.cpp
Shaquille Soekhlal f709a5c3c4 Gewerkt aan opdracht 4
Co-authored-by: Aryan Lala (19097727) <A.E.Lala@student.hhs.nl>
2023-06-08 07:28:57 +02:00

13 lines
266 B
C++

#include "Observer.h"
void Subject::notify ( ){
for ( list<Observer*>::iterator i=L.begin( ); i!=L.end( ); ++i ) (*i)->update( );
}
Observer::Observer ( Subject* s ) : S(s){
getSubject( )->insert(this);
}
Observer::~Observer ( ){
getSubject( )->remove ( this );
}