blob: 1d0352581a23780438275d500641250beb07e8b8 (
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 {
public:
virtual void attach(Observer* obs);
virtual void detach(Observer*);
//! Get number of attached observers
virtual int size();
virtual void notify();
private:
std::vector<Observer*> observers;
};
|