diff rdf/PluginRDFIndexer.h @ 461:2019d89ebcf9

* Some work on querying and cacheing plugin RDF from a central index
author Chris Cannam
date Fri, 17 Oct 2008 15:26:29 +0000
parents ef14acd6d102
children c9b055f84326
line wrap: on
line diff
--- a/rdf/PluginRDFIndexer.h	Fri Oct 17 13:32:55 2008 +0000
+++ b/rdf/PluginRDFIndexer.h	Fri Oct 17 15:26:29 2008 +0000
@@ -18,6 +18,7 @@
 
 #include <QString>
 #include <QStringList>
+#include <QMutex>
 #include <map>
 #include <set>
 
@@ -28,6 +29,18 @@
 public:
     static PluginRDFIndexer *getInstance();
 
+    /**
+     * Index all URLs obtained from index files defined in the current
+     * settings.  This is not done automatically because it may incur
+     * significant processing and networking effort.  It could be
+     * called from a background thread at startup, for example.
+     *
+     * Note that this class has a single mutex, so other functions
+     * will block if called from a different thread while this one is
+     * running.
+     */
+    bool indexConfiguredURLs();
+
     bool indexURL(QString url); // in addition to "installed" URLs
 
     QString getURIForPluginId(QString pluginId);
@@ -41,6 +54,7 @@
 
 protected:
     PluginRDFIndexer();
+    QMutex m_mutex;
     std::set<FileSource *> m_sources;
     typedef std::map<QString, QString> StringMap;
     StringMap m_uriToIdMap;
@@ -48,6 +62,7 @@
     StringMap m_idToDescriptionMap;
     bool indexFile(QString path);
     static PluginRDFIndexer *m_instance;
+    void expireCacheMaybe(QString);
 };
 
 #endif