Simple SFML GUI  0.2a
DestructionNotificationHub.hpp
1 #ifndef DESTRUCTIONNOTIFICATIONHUB_HPP
2 #define DESTRUCTIONNOTIFICATIONHUB_HPP
3 
4 #include <set>
5 #include <map>
6 #include "DestructionObserver.hpp"
7 
10 public:
11  static bool registerObserver(DestructionObserver* observer, std::set<const DestructionNotifier*>&& listenedPointers = {});
12  static bool registerObserver(DestructionObserver* observer, std::set<const DestructionNotifier*>& listenedPointers);
13 
14  static bool unregisterObserver(DestructionObserver* observer);
15 
16 protected:
17  friend DestructionNotifier;
18  static void notifyDestruction(const DestructionNotifier* ptr);
19 
20 private:
21  static std::map<DestructionObserver*, std::set<const DestructionNotifier*>> observers;
22 
24 };
25 
26 #endif // DESTRUCTIONNOTIFICATIONHUB_HPP
Definition: DestructionNotifier.hpp:6
Definition: DestructionObserver.hpp:6
Definition: DestructionNotificationHub.hpp:9