예제 #1
0
    void DependencyTracker::removeDependency(const FieldPath &rFieldPath) {
        const size_t nErased = map.erase(rFieldPath);

        DEV {
            (log() << "\n---- DependencyTracker::removeDependency(" <<
             rFieldPath.getPath(false) << ") -> " << nErased << "\n").flush();
        }
    }
예제 #2
0
    void DependencyTracker::reportUnsatisfied(
        const FieldPath &rPath,
        const DocumentSource *pNeeds,
        const DocumentSource *pExcludes) {

        uassert(15984, str::stream() <<
                "unable to satisfy dependency on " <<
                rPath.getPath(true) << " in pipeline[" <<
                pNeeds->getPipelineStep() << "]." <<
                pNeeds->getSourceName() << ", because pipeline[" <<
                pExcludes->getPipelineStep() << "]." <<
                pExcludes->getSourceName() << "] doesn't include it",
                false); // printf() is way easier to read than this crap
    }
예제 #3
0
    void DependencyTracker::addDependency(
        const FieldPath &rFieldPath, const DocumentSource *pSource) {
        Tracker tracker(rFieldPath, pSource);
        std::pair<MapType::iterator, bool> p(
            map.insert(std::pair<FieldPath, Tracker>(rFieldPath, tracker)));

        /*
          If there was already an entry, update the dependency to be the more
          recent source.
        */
        if (!p.second)
            (*p.first).second.pSource = pSource;

        DEV {
            (log() << "\n---- DependencyTracker::addDependency(" <<
             rFieldPath.getPath(false) << ", pipeline[" <<
             pSource->getPipelineStep() << "]." <<
             pSource->getSourceName() << ")").flush();
        }
    }
예제 #4
0
 void run() {
     FieldPath path = FieldPath("foo.bar.baz").tail();
     ASSERT_EQUALS(2U, path.getPathLength());
     ASSERT_EQUALS("bar.baz", path.getPath(false));
 }