Soprano  2.9.4
mutexmodel.h
Go to the documentation of this file.
1 /*
2  * This file is part of Soprano Project.
3  *
4  * Copyright (C) 2007-2008 Sebastian Trueg <trueg@kde.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef _SOPRANO_MUTEX_MODEL_H_
23 #define _SOPRANO_MUTEX_MODEL_H_
24 
25 #include "filtermodel.h"
26 #include "soprano_export.h"
27 
28 namespace Soprano {
29  namespace Util {
30  class MutexIteratorBase;
31 
45  {
46  Q_OBJECT
47 
48  public:
57 
68 
73  ReadWriteSingleThreading
74  };
75 
83  MutexModel( ProtectionMode mode, Model* parent = 0 );
84 
89 
93  StatementIterator listStatements( const Statement &partial ) const;
97  const QString& userQueryLanguage = QString() ) const;
98  bool containsStatement( const Statement &statement ) const;
99  bool containsAnyStatement( const Statement &statement ) const;
100  bool isEmpty() const;
101  int statementCount() const;
102 
109 
110  private:
111  void removeIterator( MutexIteratorBase* it ) const;
112 
113  class Private;
114  Private* const d;
115 
116  friend class MutexIteratorBase;
117  };
118  }
119 }
120 
121 #endif
Soprano::FilterModel::listStatements
virtual StatementIterator listStatements(const Statement &partial) const=0
soprano_export.h
Soprano::Util::MutexModel::removeAllStatements
Error::ErrorCode removeAllStatements(const Statement &statement)
Soprano::Util::MutexModel::executeQuery
QueryResultIterator executeQuery(const QString &query, Query::QueryLanguage language, const QString &userQueryLanguage=QString()) const
Soprano::Util::MutexModel::isEmpty
bool isEmpty() const
Soprano::FilterModel::containsAnyStatement
virtual bool containsAnyStatement(const Statement &statement) const=0
Soprano::Query::QueryLanguage
QueryLanguage
Definition: sopranotypes.h:129
Soprano::FilterModel::addStatement
virtual Error::ErrorCode addStatement(const Statement &statement)=0
SOPRANO_EXPORT
#define SOPRANO_EXPORT
Definition: soprano_export.h:37
Soprano::FilterModel
A FilterModel is a virtual model that wraps another Model.
Definition: filtermodel.h:49
Soprano::Util::MutexModel::PlainMultiThreading
@ PlainMultiThreading
Definition: mutexmodel.h:56
Soprano::FilterModel::containsStatement
virtual bool containsStatement(const Statement &statement) const=0
Soprano::Statement
A Statement instance represents one RDF quadruple.
Definition: statement.h:48
Soprano::Util::MutexModel::~MutexModel
~MutexModel()
Soprano::QueryResultIterator
An iterator for query results.
Definition: queryresultiterator.h:109
filtermodel.h
Soprano::Util::MutexModel::ReadWriteMultiThreading
@ ReadWriteMultiThreading
Definition: mutexmodel.h:67
Soprano::Util::MutexModel::MutexModel
MutexModel(ProtectionMode mode, Model *parent=0)
Soprano::FilterModel::removeStatement
virtual Error::ErrorCode removeStatement(const Statement &statement)=0
Soprano::Util::MutexModel::containsStatement
bool containsStatement(const Statement &statement) const
Soprano::Model
A Model is the central class in Soprano. It is a queryable collection of RDF quadruples,...
Definition: model.h:95
Soprano::Util::MutexModel::containsAnyStatement
bool containsAnyStatement(const Statement &statement) const
Soprano::Util::MutexModel::statementCount
int statementCount() const
Soprano::Util::MutexModel::ProtectionMode
ProtectionMode
Definition: mutexmodel.h:49
Soprano::StatementIterator
An iterator that provides a stream of Statements.
Definition: statementiterator.h:76
Soprano::Util::MutexModel::removeStatement
Error::ErrorCode removeStatement(const Statement &statement)
Soprano
Definition: backend.h:36
Soprano::Util::MutexModel::listStatements
StatementIterator listStatements(const Statement &partial) const
Soprano::Util::MutexModel
Protect a Model for multiple calls in multi-threaded applications.
Definition: mutexmodel.h:45
Soprano::NodeIterator
An iterator that provides a stream of Nodes.
Definition: nodeiterator.h:73
Soprano::Util::MutexModel::addStatement
Error::ErrorCode addStatement(const Statement &statement)
Soprano::Error::ErrorCode
ErrorCode
Definition: error.h:40
Soprano::FilterModel::removeAllStatements
virtual Error::ErrorCode removeAllStatements(const Statement &statement)=0
QString
Soprano::Vocabulary::Xesam::language
SOPRANO_EXPORT QUrl language()
Soprano::Util::MutexModel::listContexts
NodeIterator listContexts() const