File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 11#pragma once
22
3+ #include < gtk/gtk.h>
34#include < vector>
45
56#include " StateComponent.hpp"
@@ -94,7 +95,16 @@ namespace ZooLib
9495 auto &version = m_ObservedComponentVersions[i];
9596 if (observedComponent->GetVersion () != version)
9697 {
98+ #if DEBUG_OBSERVERS
99+ g_debug (" Observed component %s changed from version %lu to %lu." , typeid (*observedComponent).name (),
100+ version, observedComponent->GetVersion ());
101+ #endif
102+
97103 UpdateImplementation ();
104+
105+ #if DEBUG_OBSERVERS
106+ g_debug (" Updated observer %s." , typeid (*this ).name ());
107+ #endif
98108 break ;
99109 }
100110 }
Original file line number Diff line number Diff line change @@ -139,15 +139,33 @@ namespace ZooLib
139139 m_NeedsSorting = false ;
140140 }
141141
142+ #if DEBUG_OBSERVER_MANAGER
143+ g_debug (" ObserverManager::NotifyObservers() notifying %zu observers" , m_SortedObservers.size ());
144+ #endif
145+
142146 for (auto observer: m_SortedObservers)
143147 {
144148 if (std::ranges::find (m_DeletedObservers, observer) != m_DeletedObservers.end ())
145149 {
146150 continue ;
147151 }
148152
153+ #if DEBUG_OBSERVER_MANAGER
154+ g_debug (" ObserverManager::NotifyObservers() calling observer %s (%p)" , typeid (*observer).name (),
155+ observer);
156+ #endif
157+
149158 observer->Update ();
159+
160+ #if DEBUG_OBSERVER_MANAGER
161+ g_debug (" ObserverManager::NotifyObservers() done calling observer %s (%p)" , typeid (*observer).name (),
162+ observer);
163+ #endif
150164 }
165+
166+ #if DEBUG_OBSERVER_MANAGER
167+ g_debug (" ObserverManager::NotifyObservers() done notifying observers\n " );
168+ #endif
151169 }
152170 };
153171}
You can’t perform that action at this time.
0 commit comments