Molybden API
Loading...
Searching...
No Matches
observable.hpp
1// Copyright (c) 2000-2024 TeamDev. All rights reserved.
2// TeamDev PROPRIETARY and CONFIDENTIAL.
3// Use is subject to license terms.
4
5#ifndef MOLYBDEN_OBSERVABLE_HPP
6#define MOLYBDEN_OBSERVABLE_HPP
7
8#include <string>
9
10namespace molybden {
11
20template <typename T>
22 public:
23 virtual ~Observable() = default;
24
32 virtual void addObserver(T* observer) = 0;
33
41 virtual void removeObserver(T* observer) = 0;
42};
43
44} // namespace molybden
45
46#endif // MOLYBDEN_OBSERVABLE_HPP
A common class that all classes providing an observer must inherit.
Definition observable.hpp:21
virtual void addObserver(T *observer)=0
Adds the given observer instance.
virtual void removeObserver(T *observer)=0
Unregisters the given observer.