class SubEntry { public: /** * @brief Represents an entry in the cache. */ /** The cached information about this entry. */ EntryInfo entry; /** * @brief The number of entries in the cache below and including * this one. * * @return the size of the tree rooted at this node */ int32_t count() const; /** Constructor */ SubEntry() { } /** Destructor */ virtual ~SubEntry() {} };/** * @brief Represents a top-level entry in the cache */ class RootSubEntry : public SubEntry { public: /** Constructor */ RootSubEntry() :SubEntry() {} /** Whether this entry and its subentries have been indexed yet */ bool indexed; }; /** * @brief A cache for entries that have already been found. * @internal * * The cache is stored in a tree, sorted on the path in the URL * (with @c / as the delimiter). */ class ArchiveEntryCache { public: /** * @brief The cache itself. * * Contains all the root entries in the cache. */ std::map<std::string, RootSubEntry> cache; /** A list of subentries of this entry. */ std::map<std::string, SubEntry> entries; vector<EntryInfo> entries(const std::string& url); /** * @brief Find an entry in the cache by its URL * * @param url the url of the entry * @return a pointer to the entry, if it is in the cache, * 0 if the entry is not in the cache */ const SubEntry* findEntry(const string& url) const; /** * @brief Finds the root subentry in the cache of the given url, * if it is in the cache * * This finds the RootSubEntry (tree root) that the SubEntry for the * given url either is or should be stored under. If there is no * suitable RootSubEntry in the cache, cache.end() is returned. * * @param url the url of the object to find the root entry for * @return an iterator to the root entry */ map<string, RootSubEntry>::const_iterator findRootEntry(const string& url) const; /** * @brief Print a text representation of the cache to stdout. * For debugging purposes. */ void print() const;};