2
This file is part of the Nepomuk KDE project.
3
Copyright (C) 2010 Vishesh Handa <handa.vish@gmail.com>
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Lesser General Public
7
License as published by the Free Software Foundation; either
8
version 2.1 of the License, or (at your option) version 3, or any
9
later version accepted by the membership of KDE e.V. (or its
10
successor approved by the membership of KDE e.V.), which shall
11
act as a proxy defined in Section 6 of version 3 of the license.
13
This library is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
Lesser General Public License for more details.
18
You should have received a copy of the GNU Lesser General Public
19
License along with this library. If not, see <http://www.gnu.org/licenses/>.
23
#ifndef DIFFGENERATOR_H
24
#define DIFFGENERATOR_H
26
#include <QtCore/QThread>
27
#include <QtCore/QMutex>
28
#include <QtCore/QWaitCondition>
29
#include <QtCore/QQueue>
30
#include "changelogrecord.h"
43
class DiffGenerator : public QThread
47
DiffGenerator( QObject* parent = 0 );
48
virtual ~DiffGenerator();
53
void statementAdded( const Soprano::Statement & st );
54
void statementRemoved( const Soprano::Statement & st );
56
//void removeOldRecords();
58
Soprano::Model *m_model;
60
QQueue<ChangeLogRecord> m_recordQueue;
64
QWaitCondition m_queueWaiter;
69
* Returns true if the statement should be backed up
70
* A statement will be backed up if it can not be regenerated or is a part of the
71
* InstanceBase OR if the property is a sub property of nao:identifyingProperty.
72
* This is done to help to the identification.
74
bool backupStatement( const Soprano::Statement & st );
76
/// A cache of the discardable graphs to speed up backupStatement()
77
QHash<QUrl, bool> m_discardableGraphs;
81
#endif // DIFFGENERATOR_H