aboutsummaryrefslogtreecommitdiff
path: root/Observer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Observer.cpp')
-rw-r--r--Observer.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/Observer.cpp b/Observer.cpp
index 1d96ed4..8d9823b 100644
--- a/Observer.cpp
+++ b/Observer.cpp
@@ -1,20 +1,21 @@
-#include "Observer.h"
#include <iostream>
+#include "Observer.h"
+
void Observer::update(){
std::cout << 'a' << std::endl;
}
-void Subject::attach(Observer* obs){
+void Subject::attach(Observer * obs){
std::cout << "added" << std::endl;
this->observers.push_back(obs);
}
-void Subject::detach(Observer*){
+void Subject::detach(Observer *){
}
-// TODO possibly add foo input as update value?
+// TODO: possibly add foo input as update value?
void Subject::notify() {
for (int i = 0; i < this->observers.size(); i++)
this->observers[i]->update();