Lines Matching defs:observer

27 /* Print an "observer" debug statement.  */
30 debug_prefixed_printf_cond (observer_debug, "observer", fmt, ##__VA_ARGS__)
32 /* Print "observer" start/end debug statements. */
35 scoped_debug_start_end (observer_debug, "observer", fmt, ##__VA_ARGS__)
45 /* An observer is an entity which is interested in being notified
48 notifications, the observer attaches a callback to the observable.
51 The observer implementation is also currently not reentrant. In
71 /* Use for sorting algorithm, to indicate which observer we have
88 struct observer
90 observer (const struct token *token, func_type func, const char *name,
109 /* Attach F as an observer to this observable. F cannot be detached or
115 NAME is the name of the observer, used for debug output purposes. Its
116 lifetime must be at least as long as the observer is attached. */
123 /* Attach F as an observer to this observable.
126 as a dependency of another observer.
131 NAME is the name of the observer, used for debug output purposes. Its
132 lifetime must be at least as long as the observer is attached. */
146 [&] (const observer &o)
151 observer_debug_printf ("Detaching observable %s from observer %s",
164 OBSERVER_SCOPED_DEBUG_START_END ("calling observer %s of observable %s",
172 std::vector<observer> m_observers;
177 Visit all dependencies of observer at INDEX in M_OBSERVERS (later referred
178 to as "the observer"). Then append the observer to SORTED_OBSERVERS.
180 If the observer is already visited, do nothing. */
181 void visit_for_sorting (std::vector<observer> &sorted_observers,
188 /* If we are already visiting this observer, it means there's a cycle. */
193 /* For each dependency of this observer... */
196 /* ... find the observer that has token DEP. If found, visit it. */
199 [&] (observer o) { return o.token == dep; });
218 std::vector<observer> sorted_observers;
232 observer_debug_printf ("Attaching observable %s to observer %s",
237 /* The observer has been inserted at the end of the vector, so it will be
239 observer has a token, it means that other observers can specify it as
241 newly inserted observer afterwards. */