Lines Matching refs:watcher

37 	A watcher is represented by an object of the Watcher or a derived class.
39 more than one watcher with the same target BMessenger at a time.
56 For each registered watcher \code Watcher *watcher \endcode, the map
57 contains an entry \code (watcher->Target(), watcher) \endcode.
87 /*! \brief Registers a new watcher to the watching service.
89 The ownership of \a watcher is transfered to the watching service, that
93 (Watcher::Target()), the old watcher is removed and deleted before the
96 \param watcher The watcher to be registered.
97 \return \c true, if \a watcher is not \c NULL and adding was successfully,
101 WatchingService::AddWatcher(Watcher *watcher)
103 bool result = (watcher);
105 RemoveWatcher(watcher->Target(), true);
106 fWatchers[watcher->Target()] = watcher;
112 /*! \brief Registers a new watcher to the watching service.
119 (Watcher::Target()), the old watcher is removed and deleted before the
133 /*! \brief Unregisters a watcher from the watching service and optionally
136 If \a deleteWatcher is \c false, the ownership of \a watcher is transfered
139 \param watcher The watcher to be unregistered.
140 \param deleteWatcher If \c true, the watcher is deleted after being
142 \return \c true, if \a watcher was not \c NULL and registered to the
146 WatchingService::RemoveWatcher(Watcher *watcher, bool deleteWatcher)
148 watcher_map::iterator it = fWatchers.find(watcher->Target());
149 bool result = (it != fWatchers.end() && it->second == watcher);
159 /*! \brief Unregisters a watcher from the watching service and optionally
162 The watcher is identified by its target BMessenger.
164 If \a deleteWatcher is \c false, the ownership of the concerned watcher is
167 \param target The target BMessenger identifying the watcher to be
169 \param deleteWatcher If \c true, the watcher is deleted after being
171 \return \c true, if a watcher with the specified target was registered to
188 /*! \brief Sends a notification message to all watcher targets selected by a
192 each watcher (and the notification message) is passed to its
196 If a sending a message to a watcher's target failed, because it became
197 invalid, the watcher is unregistered and deleted.
199 \param message The message to be sent to the watcher targets.
212 Watcher *watcher = it->second;
213 // TODO: If a watcher is invalid, but the filter never selects it, it will
215 if (!filter || filter->Filter(watcher, message)) {
216 status_t error = watcher->SendMessage(message);
217 if (error != B_OK && !watcher->Target().IsValid())
218 staleWatchers.AddItem(watcher);
223 Watcher *watcher = (Watcher*)staleWatchers.ItemAt(i);
225 RemoveWatcher(watcher, true);