Example #1
0
void StoreClient::queueNotification(class_id_t class_id, const URI& uri,
                                    notif_t& notifs) {
    if (notifs.find(uri) != notifs.end())
        return;
    // walk up the tree to the root and queue notifications along the
    // path.
    try {
        Region* r = store->getRegion(class_id);
        const std::pair<URI, prop_id_t>& parent = r->getParent(class_id, uri);
        queueNotification(store->prop_map.at(parent.second)->getId(), 
                          parent.first, notifs);
    } catch (std::out_of_range e) {
        // no parent
    }
    notifs[uri] = class_id;
}
Example #2
0
void StoreClient::queueNotification(class_id_t class_id, const URI& uri,
                                    notif_t& notifs) {
    if (notifs.find(uri) != notifs.end())
        return;
    // walk up the tree to the root and queue notifications along the
    // path.
    try {
        Region* r = store->getRegion(class_id);
        std::pair<URI, prop_id_t> parent(URI::ROOT, 0);
        if (r->getParent(class_id, uri, parent)) {
            queueNotification(store->prop_map.at(parent.second)->getId(),
                              parent.first, notifs);
        }
    } catch (const std::out_of_range&) {
        // region not found
    }
    notifs[uri] = class_id;
}
Example #3
0
void StoreClient::deliverNotifications(const notif_t& notifs) {
    notif_t::const_iterator nit;
    for (nit = notifs.begin(); nit != notifs.end(); ++nit) {
        store->queueNotification(nit->second, nit->first);
    }
}