std::vector<ThreadIdxCache::ThreadID> ThreadIdxCache::get_deleted_ids(
const boost::unordered_map<ThreadID, ThreadIdxCache>& caches,
- const boost::unordered_set<ThreadID>& exist_ids) {
+ const boost::unordered_set<ThreadID>& exist_ids,
+ const std::string& prefix) {
typedef std::pair<ThreadID, ThreadIdxCache> PairType;
std::vector<ThreadID> deleted_ids;
BOOST_FOREACH(const PairType& pair, caches) {
const std::string& cached = pair.first;
+ if (prefix != cached.substr(0, 3)) continue;
if (exist_ids.find(cached) == exist_ids.end())
deleted_ids.push_back(cached);
}
directories[filename] = last_modified;
const boost::unordered_set<ThreadID> exist_ids = get_exist_ids(sub_dir);
- // TODO remove deleted ids.
-// const std::vector<ThreadID> deleted_ids =
-// get_deleted_ids(caches, exist_ids);
-// remove_deleted_ids(caches, deleted_ids);
+ const std::vector<ThreadID> deleted_ids =
+ get_deleted_ids(caches, exist_ids, sub_dir.filename());
+ remove_deleted_ids(caches, deleted_ids);
merge_idx(sub_dir, exist_ids, caches);
}
const std::vector<ThreadID>& deleted_ids);
static std::vector<ThreadID> get_deleted_ids(
const boost::unordered_map<ThreadID, ThreadIdxCache>&,
- const boost::unordered_set<ThreadID>& exist_ids);
+ const boost::unordered_set<ThreadID>& exist_ids,
+ const std::string& prefix);
static boost::unordered_set<ThreadID> get_exist_ids(
const boost::filesystem::path&);
static std::vector<DirectoryTimeStamp> directory_timestamp_from_xml(