comparison Framework/Messages/MessageBroker.h @ 828:28f99af358fa

Merge + FusionMprSdl
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 29 May 2019 16:15:04 +0200
parents b70e9be013e4
children d492c3b71c65
comparison
equal deleted inserted replaced
827:2fd96a637a59 828:28f99af358fa
16 * 16 *
17 * You should have received a copy of the GNU Affero General Public License 17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 **/ 19 **/
20 20
21 #pragma once
21 22
22 #pragma once 23 #include "../StoneException.h"
23 24
24 #include "boost/noncopyable.hpp" 25 #include "boost/noncopyable.hpp"
25 26
26 #include <set> 27 #include <set>
27 28
38 { 39 {
39 private: 40 private:
40 std::set<const IObserver*> activeObservers_; // the list of observers that are currently alive (that have not been deleted) 41 std::set<const IObserver*> activeObservers_; // the list of observers that are currently alive (that have not been deleted)
41 42
42 public: 43 public:
44 MessageBroker()
45 {
46 static bool created = false;
47 ORTHANC_ASSERT(!created, "One broker to rule them all!");
48 created = true;
49 }
50
43 void Register(const IObserver& observer) 51 void Register(const IObserver& observer)
44 { 52 {
45 activeObservers_.insert(&observer); 53 activeObservers_.insert(&observer);
46 } 54 }
47 55