PluginRDFIndexer.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Sonic Visualiser
5  An audio file viewer and annotation editor.
6  Centre for Digital Music, Queen Mary, University of London.
7  This file copyright 2008 QMUL.
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version. See the file
13  COPYING included with this distribution for more information.
14 */
15 
16 #ifndef SV_PLUGIN_RDF_INDEXER_H
17 #define SV_PLUGIN_RDF_INDEXER_H
18 
19 #include <QString>
20 #include <QStringList>
21 #include <QMutex>
22 #include <map>
23 #include <set>
24 
25 namespace Dataquay {
26  class BasicStore;
27 }
28 
30 {
31 public:
32  static PluginRDFIndexer *getInstance();
33 
46  bool indexConfiguredURLs();
47 
48  bool indexURL(QString url); // in addition to "installed" URLs
49 
50  QString getURIForPluginId(QString pluginId);
51  QString getIdForPluginURI(QString uri);
52 
53  QStringList getIndexedPluginIds();
54 
59  void performConsistencyChecks();
60 
61  const Dataquay::BasicStore *getIndex();
62 
64 
65 protected:
67  QMutex m_mutex;
68 
69  typedef std::map<QString, QString> StringMap;
70  StringMap m_uriToIdMap;
71  StringMap m_idToUriMap;
72 
73  void indexInstalledURLs();
74 
75  bool pullFile(QString path);
76  bool pullURL(QString urlString);
77  bool reindex();
78 
79  Dataquay::BasicStore *m_index;
80 
82 };
83 
84 #endif
85 
Dataquay::BasicStore * m_index
StringMap m_idToUriMap
StringMap m_uriToIdMap
std::map< QString, QString > StringMap
static PluginRDFIndexer * m_instance