blob: 53c23c7dc298feb34c646da6b2a924c891241341 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#pragma once
#include <vector>
class Observer {
public:
virtual void update() = 0;
};
class Subject {
private:
std::vector<Observer*> observers;
public:
virtual void attach(Observer* obs);
virtual void detach(Observer*);
//! Get number of attached observers
virtual int size();
virtual void notify();
};
|