void DatabaseTracker::notifyDatabasesChanged() { // Note that if DatabaseTracker ever becomes non-singleton, we'll have to amend this notification // mechanism to include which tracker the notification goes out on as well. DatabaseTracker& theTracker(tracker()); NotificationQueue notifications; { LockHolder locker(notificationMutex()); notifications.swap(notificationQueue()); notificationScheduled = false; } if (!theTracker.m_client) return; for (unsigned i = 0; i < notifications.size(); ++i) theTracker.m_client->dispatchDidModifyDatabase(notifications[i].first.get(), notifications[i].second); }
/** * Removes a reference count object from the global list. * This method should be called just before the reference * count object is finally released, after reaching zero * references (ie: not each time RELEASEREF is called!). * * \param refCount CqRefCount object to remove. */ static void removeRefCountObj(CqRefCount *refCount) { theTracker()->_removeRefCountObj(refCount); }
/** * Reports on the list of un-released CqRefCount objects. * Ideally, don't call this method directly - use the * global-scope function report_refcounts() instead. */ static void report() { theTracker()->_report(); }
/** * Adds a reference count object to the global list. * This method should be called when the object is first * created (ie: not each time ADDREF is called!). * * \param refCount CqRefCount object to add. */ static void addRefCountObj(CqRefCount *refCount) { theTracker()->_addRefCountObj(refCount); }