Soprano  2.9.2
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 
88  ~MutexModel();
89 
90  Error::ErrorCode addStatement( const Statement &statement );
91  Error::ErrorCode removeStatement( const Statement &statement );
92  Error::ErrorCode removeAllStatements( const Statement &statement );
93  StatementIterator listStatements( const Statement &partial ) const;
94  NodeIterator listContexts() const;
95  QueryResultIterator executeQuery( const QString& query,
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
StatementIterator listStatements() const
virtual Error::ErrorCode addStatement(const Statement &statement)
A Statement instance represents one RDF quadruple.
Definition: statement.h:47
SOPRANO_EXPORT QUrl language()
virtual Error::ErrorCode removeStatement(const Statement &statement)
Error::ErrorCode removeAllStatements()
A FilterModel is a virtual model that wraps another Model.
Definition: filtermodel.h:48
An iterator for query results.
virtual bool containsAnyStatement(const Statement &statement) const
An iterator that provides a stream of Statements.
Protect a Model for multiple calls in multi-threaded applications.
Definition: mutexmodel.h:44
#define SOPRANO_EXPORT
A Model is the central class in Soprano. It is a queryable collection of RDF quadruples, i.e statements.
Definition: model.h:94
virtual bool containsStatement(const Statement &statement) const
An iterator that provides a stream of Nodes.
Definition: nodeiterator.h:72