Soprano  2.9.4
Public Member Functions | List of all members
Soprano::Client::DBusModel Class Reference

Interface to a DBus server model. More...

#include <Soprano/Client/DBusModel>

+ Inheritance diagram for Soprano::Client::DBusModel:

Public Member Functions

 DBusModel (const QString &serviceName, const QString &dbusObject, const Backend *backend=0)
 
 ~DBusModel ()
 
void setAsyncCalls (bool b)
 
bool asyncCalls () const
 
Error::ErrorCode addStatement (const Statement &statement)
 
NodeIterator listContexts () const
 
QueryResultIterator executeQuery (const QString &query, Query::QueryLanguage language, const QString &userQueryLanguage=QString()) const
 
StatementIterator listStatements (const Statement &partial) const
 
Error::ErrorCode removeStatement (const Statement &statement)
 
Error::ErrorCode removeAllStatements (const Statement &statement)
 
int statementCount () const
 
bool isEmpty () const
 
bool containsStatement (const Statement &statement) const
 
bool containsAnyStatement (const Statement &statement) const
 
Node createBlankNode ()
 
- Public Member Functions inherited from Soprano::StorageModel
virtual ~StorageModel ()
 
const Backendbackend () 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::StorageModel
 StorageModel (const Backend *backend)
 
- 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

Interface to a DBus server model.

The DBusModel provides a fully functional interface to a Model provided through a Soprano DBus server. It can thus, be seen as the counterpart to Server::DBusExportModel.

Given the DBus service name and the object path of the Model in question it handles all DBus communication transparently.

Normally there is no need to use this class directly as DBusClient does create instances of it on request.

Warning
DBusModel is not thread-safe by default and has to be protected if is is to be used from different threads (This can be done via Soprano::Util::MutexModel in Soprano::Util::MutexModel::ReadWriteMultiThreading mode or via setting the model to async mode via setAsyncCalls()).
Author
Sebastian Trueg trueg.nosp@m.@kde.nosp@m..org
See also
Soprano D-Bus Interface

Definition at line 56 of file dbusmodel.h.

Constructor & Destructor Documentation

Soprano::Client::DBusModel::DBusModel ( const QString serviceName,
const QString dbusObject,
const Backend backend = 0 
)

Create a new DBus Model interface.

Parameters
serviceNameThe name of the DBus service that provides the Model.
dbusObjectThe path to the Model object in the DBus service.
backendThe backend that created this model. Should always be set to 0.
Soprano::Client::DBusModel::~DBusModel ( )

Member Function Documentation

void Soprano::Client::DBusModel::setAsyncCalls ( bool  b)

Configure DBusModel to use asyncronous calls over DBus. With asyncronous calls DBusModel will enter local event loops while waiting for the reply. This way multiple calls can be performed interweaved. However, the application does not block, i.e. events (such as signals and slots) are handled which might not be wanted. If that is the case it is better to use Util::MutexModel instead.

Parameters
bIf true asyncronous calls are enabled.

Per default asyncronous calls are disabled.

Warning
Asyncronous calls only work in combination with a QCoreApplication instance.
See also
QDBus::BlockWithGui
bool Soprano::Client::DBusModel::asyncCalls ( ) const
Returns
true if asyncronous calls are enabled.
Error::ErrorCode Soprano::Client::DBusModel::addStatement ( const Statement statement)
virtual

Add the Statement to the Model.

Parameters
statementThe Statement to add.

Implements Soprano::Model.

NodeIterator Soprano::Client::DBusModel::listContexts ( ) const
virtual

List all contexts in the model, i.e. all named graphs.

Returns
An iterator over context Nodes, on error an invalid iterator is returned.

Implements Soprano::Model.

QueryResultIterator Soprano::Client::DBusModel::executeQuery ( const QString query,
Query::QueryLanguage  language,
const QString userQueryLanguage = QString() 
) const
virtual

query_api_disabled Execute the given query over the Model.

This is a const read-only method. As such Model implementations should not support SPARQL extensions such as INSERT or UPDATE through this method. A future version of Soprano will provide an additional API for queries that change the Model.

Parameters
queryThe query to evaluate.
languageThe query language used to encode query.
userQueryLanguageIf language equals Query::QueryLanguageUser userQueryLanguage defines the language to use.
Returns
An iterator over all results matching the query, on error an invalid iterator is returned.

Implements Soprano::Model.

StatementIterator Soprano::Client::DBusModel::listStatements ( const Statement partial) const
virtual

Return an iterator over Model Statements that "partial" match the input Statement.

Parameters
partialThe partial Statement to match.
Returns
An iterator for all the matched Statements, on error an invalid iterator is returned.

Implements Soprano::Model.

Error::ErrorCode Soprano::Client::DBusModel::removeStatement ( const Statement statement)
virtual

Remove one statement. For removing statements with wildward matching see removeAllStatements().

Parameters
statementThe statement that should be removed. This has to be a valid statement.
Returns
Error::ErrorNone on success and an error code if statement was invalid or an error occured.

Implements Soprano::Model.

Error::ErrorCode Soprano::Client::DBusModel::removeAllStatements ( const Statement statement)
virtual

Default implementation is based on listStatements() and removeStatement().

Reimplemented from Soprano::StorageModel.

int Soprano::Client::DBusModel::statementCount ( ) const
virtual

The number of statements stored in this Model.

Returns
The size of the Model, or -1 on error.

Implements Soprano::Model.

bool Soprano::Client::DBusModel::isEmpty ( ) const
virtual

Default implementation is based on Model::statementCount

Reimplemented from Soprano::StorageModel.

bool Soprano::Client::DBusModel::containsStatement ( const Statement statement) const
virtual

Default implementation is based on Model::listStatements

Reimplemented from Soprano::StorageModel.

bool Soprano::Client::DBusModel::containsAnyStatement ( const Statement statement) const
virtual

Default implementation is based on Model::listStatements

Reimplemented from Soprano::StorageModel.

Node Soprano::Client::DBusModel::createBlankNode ( )
virtual

Creates a new blank node with a unique identifier.

Returns
A blank node that can be used to create new statements.

Implements Soprano::Model.


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