Soprano 2.9.4
Soprano::Util::ReadOnlyModel Class Reference

Simple filter model preventing any write operations. More...

#include <Soprano/Util/ReadOnlyModel>

Inheritance diagram for Soprano::Util::ReadOnlyModel:

Public Member Functions

 ReadOnlyModel (Model *parentModel=0)
 ~ReadOnlyModel ()
void setParentModel (Model *model)
StatementIterator listStatements (const Statement &partial) const
NodeIterator listContexts () const
QueryResultIterator executeQuery (const QString &query, Query::QueryLanguage language, const QString &userQueryLanguage=QString()) const
bool containsStatement (const Statement &statement) const
bool containsAnyStatement (const Statement &statement) const
bool isEmpty () const
int statementCount () const
Error::ErrorCode addStatement (const Statement &statement)
Error::ErrorCode removeStatement (const Statement &statement)
Error::ErrorCode removeAllStatements (const Statement &statement)
Node createBlankNode ()
Error::ErrorCode addStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
Error::ErrorCode removeStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
Error::ErrorCode removeAllStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
Error::ErrorCode removeAllStatements ()
StatementIterator listStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
StatementIterator listStatements () const
bool containsStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
bool containsAnyStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
Public Member Functions inherited from Soprano::Model
virtual ~Model ()
Error::ErrorCode addStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
Error::ErrorCode addStatements (const QList< Statement > &statements)
Error::ErrorCode removeStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
Error::ErrorCode removeAllStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
Error::ErrorCode removeStatements (const QList< Statement > &statements)
Error::ErrorCode removeContext (const Node &)
Error::ErrorCode removeAllStatements ()
StatementIterator listStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
StatementIterator listStatements () const
StatementIterator listStatementsInContext (const Node &context) const
bool containsAnyStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
bool containsStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
bool containsContext (const Node &context) const
virtual Error::ErrorCode write (QTextStream &os) const
Public Member Functions inherited from QObject
 QObject (QObject *parent=0)
 blockSignals (bool block)
 childEvent (QChildEvent *event)
 children ()
 connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type=Qt::AutoCompatConnection)
 connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type=Qt::AutoCompatConnection)
 connectNotify (const char *signal)
 customEvent (QEvent *event)
 deleteLater ()
 destroyed (QObject *obj=0)
 disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 disconnect (const char *signal=0, const QObject *receiver=0, const char *method=0)
 disconnect (const QObject *receiver, const char *method=0)
 disconnectNotify (const char *signal)
 dumpObjectInfo ()
 dumpObjectTree ()
 dynamicPropertyNames ()
 event (QEvent *e)
 eventFilter (QObject *watched, QEvent *event)
 findChild (const QString &name=QString()
 findChildren (const QString &name=QString()
 findChildren (const QRegExp &regExp)
 inherits (const char *className)
 installEventFilter (QObject *filterObj)
 isWidgetType ()
 killTimer (int id)
 metaObject ()
 moveToThread (QThread *targetThread)
 parent ()
 property (const char *name)
 receivers (const char *signal)
 removeEventFilter (QObject *obj)
 sender ()
 setParent (QObject *parent)
 setProperty (const char *name, const QVariant &value)
 signalsBlocked ()
 startTimer (int interval)
 thread ()
 timerEvent (QTimerEvent *event)
 tr (const char *sourceText, const char *comment=0, int n=-1)
 trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 staticMetaObject
 QObject (QObject *parent, const char *name)
 checkConnectArgs (const char *signal, const QObject *object, const char *method)
 child (const char *objName, const char *inheritsClass=0, bool recursiveSearch=true)
 className ()
 insertChild (QObject *object)
 isA (const char *className)
 name ()
 name (const char *defaultName)
 normalizeSignalSlot (const char *signalSlot)
 removeChild (QObject *object)
 setName (const char *name)
Public Member Functions inherited from Soprano::Error::ErrorCache
virtual ~ErrorCache ()
virtual Error lastError () const

Additional Inherited Members

Signals inherited from Soprano::Model
void statementsAdded ()
void statementsRemoved ()
void statementAdded (const Soprano::Statement &statement)
void statementRemoved (const Soprano::Statement &statement)
Protected Member Functions inherited from Soprano::Model
 Model ()
Protected Member Functions inherited from Soprano::Error::ErrorCache
 ErrorCache ()
void clearError () const
void setError (const Error &) const
void setError (const QString &errorMessage, int code=ErrorUnknown) const

Detailed Description

Simple filter model preventing any write operations.

Stacking a ReadOnlyModel on top of another model will prevent any write operation to be performed. All calls to non-const methods are terminated by Error::ErrorPermissionDenied.

Author
Sebastian Trueg trueg.nosp@m.@kde.nosp@m..org
Since
2.1

Definition at line 43 of file readonlymodel.h.

Constructor & Destructor Documentation

◆ ReadOnlyModel()

Soprano::Util::ReadOnlyModel::ReadOnlyModel ( Model * parentModel = 0)

Create a new read-only-model

Parameters
parentModelThe parent Model.

◆ ~ReadOnlyModel()

Soprano::Util::ReadOnlyModel::~ReadOnlyModel ( )

Destructor

Member Function Documentation

◆ setParentModel()

void Soprano::Util::ReadOnlyModel::setParentModel ( Model * model)

Set the parent Model.

Parameters
modelThe Model that this filter will forward any commands to.

◆ listStatements() [1/3]

StatementIterator Soprano::Util::ReadOnlyModel::listStatements ( const Statement & partial) const
virtual

Default implementation simply pipes the call through to the parent model.

Implements Soprano::Model.

◆ listContexts()

NodeIterator Soprano::Util::ReadOnlyModel::listContexts ( ) const
virtual

Simply pipes the call through to the parent model.

Implements Soprano::Model.

◆ executeQuery()

QueryResultIterator Soprano::Util::ReadOnlyModel::executeQuery ( const QString & query,
Query::QueryLanguage language,
const QString & userQueryLanguage = QString() ) const
virtual

Simply pipes the call through to the parent model.

Implements Soprano::Model.

◆ containsStatement() [1/2]

bool Soprano::Util::ReadOnlyModel::containsStatement ( const Statement & statement) const
virtual

Simply pipes the call through to the parent model.

Implements Soprano::Model.

◆ containsAnyStatement() [1/2]

bool Soprano::Util::ReadOnlyModel::containsAnyStatement ( const Statement & statement) const
virtual

Simply pipes the call through to the parent model.

Implements Soprano::Model.

◆ isEmpty()

bool Soprano::Util::ReadOnlyModel::isEmpty ( ) const
virtual

Simply pipes the call through to the parent model.

Implements Soprano::Model.

◆ statementCount()

int Soprano::Util::ReadOnlyModel::statementCount ( ) const
virtual

Simply pipes the call through to the parent model.

Implements Soprano::Model.

◆ addStatement() [1/2]

Error::ErrorCode Soprano::Util::ReadOnlyModel::addStatement ( const Statement & statement)
virtual

Will do nothing but set an Error::ErrorPermissionDenied error.

Implements Soprano::Model.

◆ removeStatement() [1/2]

Error::ErrorCode Soprano::Util::ReadOnlyModel::removeStatement ( const Statement & statement)
virtual

Will do nothing but set an Error::ErrorPermissionDenied error.

Implements Soprano::Model.

◆ removeAllStatements() [1/3]

Error::ErrorCode Soprano::Util::ReadOnlyModel::removeAllStatements ( const Statement & statement)
virtual

Will do nothing but set an Error::ErrorPermissionDenied error.

Implements Soprano::Model.

◆ createBlankNode()

Node Soprano::Util::ReadOnlyModel::createBlankNode ( )
virtual

Will do nothing but set an Error::ErrorPermissionDenied error.

Implements Soprano::Model.

◆ addStatement() [2/2]

Error::ErrorCode Soprano::Model::addStatement ( const Node & subject,
const Node & predicate,
const Node & object,
const Node & context = Node() )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ removeStatement() [2/2]

Error::ErrorCode Soprano::Model::removeStatement ( const Node & subject,
const Node & predicate,
const Node & object,
const Node & context = Node() )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ removeAllStatements() [2/3]

Error::ErrorCode Soprano::Model::removeAllStatements ( const Node & subject,
const Node & predicate,
const Node & object,
const Node & context = Node() )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
subjectThe subject node to match. Can be empty as a wildcard.
predicateThe predicate node to match. Can be empty as a wildcard.
objectThe object node to match. Can be empty as a wildcard.
contextThe context node to match. Can be empty as a wildcard.

◆ removeAllStatements() [3/3]

Error::ErrorCode Soprano::Model::removeAllStatements ( )

Convenience method that clear the Model of all statements

◆ listStatements() [2/3]

StatementIterator Soprano::Model::listStatements ( const Node & subject,
const Node & predicate,
const Node & object,
const Node & context = Node() ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
subjectThe subject node to match. Can be empty as a wildcard.
predicateThe predicate node to match. Can be empty as a wildcard.
objectThe object node to match. Can be empty as a wildcard.
contextThe context node to match. Can be empty as a wildcard.
Returns
An iterator for all the matched Statements, on error an invalid iterator is returned.

◆ listStatements() [3/3]

StatementIterator Soprano::Model::listStatements ( ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Returns
An iterator for all statements in the model, on error an invalid iterator is returned.

◆ containsStatement() [2/2]

bool Soprano::Model::containsStatement ( const Node & subject,
const Node & predicate,
const Node & object,
const Node & context = Node() ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ containsAnyStatement() [2/2]

bool Soprano::Model::containsAnyStatement ( const Node & subject,
const Node & predicate,
const Node & object,
const Node & context = Node() ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
subjectThe subject node to match. Can be empty as a wildcard.
predicateThe predicate node to match. Can be empty as a wildcard.
objectThe object node to match. Can be empty as a wildcard.
contextThe context node to match. Can be empty as a wildcard.

The documentation for this class was generated from the following file: