aboutsummaryrefslogtreecommitdiff
path: root/Observer.cpp
blob: cd8589f916423102c7b2bca7b112e10c8a7eedd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "Observer.h"

void Subject::attach(Observer * obs) {
	this->observers.push_back(obs);
}

void Subject::detach(Observer *) { }

int Subject::size() {
	return this->observers.size();
}

void Subject::notify() {
	for (auto observer : this->observers)
		observer->update();
}