-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSubject.hpp
More file actions
33 lines (24 loc) · 764 Bytes
/
Subject.hpp
File metadata and controls
33 lines (24 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef OBSERVER_DP_SUBJECT_HPP_
#define OBSERVER_DP_SUBJECT_HPP_
#include "Observer.hpp"
#include <memory>
//Subject/Publisher Interface for Observer DP
class Subject
{
public:
/**
* Register an Observer
* @param Observer - the Observer object to be registered
*/
virtual void registerObserver(Observer* Observer) = 0;
/**
* De-register (remove) an Observer
* @param Observer - the Observer object to be unregistered
*/
virtual void deregisterObserver(Observer* Observer) = 0;
//Notify all the registered Observers when status is changed
virtual void notifyObservers() = 0;
//Interface should always declare destructor to be virtual
virtual ~Subject(){}
};
#endif // OBSERVER_DP_SUBJECT_HPP_