• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • KDE Support
  • Sitemap
  • Contact Us
 

soprano

Soprano::Server::DBusExportIterator

Soprano::Server::DBusExportIterator Class Reference

Exports a Soprano Iterator via D-Bus. More...

#include <Soprano/Server/DBusExportIterator>

Inheritance diagram for Soprano::Server::DBusExportIterator:
Inheritance graph
[legend]

List of all members.

Public Slots

bool registerIterator (const QString &dbusObjectPath, const QString &dbusClient=QString())
void setDeleteOnClose (bool deleteOnClose)
void unregisterIterator ()

Public Member Functions

 DBusExportIterator (QueryResultIterator it, QObject *parent=0)
 DBusExportIterator (NodeIterator it, QObject *parent=0)
 DBusExportIterator (StatementIterator it, QObject *parent=0)
 ~DBusExportIterator ()
QString dbusObjectPath () const
bool deleteOnClose () const
NodeIterator nodeIterator () const
QueryResultIterator queryResultIterator () const
StatementIterator statementIterator () const

Detailed Description

Exports a Soprano Iterator via D-Bus.

The DBusExportIterator can be used to export a single iterator via D-Bus. This may be useful in case one does not want to expose the complete Model API but restrict access via custom methods that return Soprano Iterators.

The most common usage is probably as a fire-and-forget class:

 void myDbusMethod( const QDBusMessage& m ) {
    Soprano::StatementIterator it = model->listStatements();
    Soprano::Server::DBusExportIterator* dbusIt = new Soprano::Server::DBusExportIterator( it, this );
    dbusIt->setDeleteOnClose( true );
    dbusIt->registerIterator( myFancyDBusObjectPath, m.service() );
    return myFancyDBusObjectPath;
 }

This is a class for advanced usage. In most situations using DBusExportModel or even ServerCore::registerAsDBusObject is probably enough.

Author:
Sebastian Trueg <trueg@kde.org>
See also:
Soprano D-Bus Interface
Since:
2.1

Definition at line 67 of file dbusexportiterator.h.


Constructor & Destructor Documentation

Soprano::Server::DBusExportIterator::DBusExportIterator ( StatementIterator  it,
QObject *  parent = 0 
)

Create a new instance to export a StatementIterator.

Soprano::Server::DBusExportIterator::DBusExportIterator ( NodeIterator  it,
QObject *  parent = 0 
)

Create a new instance to export a NodeIterator.

Soprano::Server::DBusExportIterator::DBusExportIterator ( QueryResultIterator  it,
QObject *  parent = 0 
)

Create a new instance to export a QueryResultIterator.

Soprano::Server::DBusExportIterator::~DBusExportIterator (  ) 

Destructor.


Member Function Documentation

QString Soprano::Server::DBusExportIterator::dbusObjectPath (  )  const

The path this iterator is exported on.

This is an empty string if the iterator is not exported.

bool Soprano::Server::DBusExportIterator::deleteOnClose (  )  const

The DBusExportIterator instance can delete itself once the iterator is closed.

The default value is false, i.e. the creator has to delete the instance.

See also:
setDeleteOnClose, Iterator::close
NodeIterator Soprano::Server::DBusExportIterator::nodeIterator (  )  const
Returns:
The used NodeIterator or an invalid one if this DBusExportIterator does not export a NodeIterator.
QueryResultIterator Soprano::Server::DBusExportIterator::queryResultIterator (  )  const
Returns:
The used QueryResultIterator or an invalid one if this DBusExportIterator does not export a QueryResultIterator.
bool Soprano::Server::DBusExportIterator::registerIterator ( const QString &  dbusObjectPath,
const QString &  dbusClient = QString() 
) [slot]

Register the iterator under the given D-Bus object path.

See also:
QDBusConnection::registerObject
Parameters:
dbusObjectPath The D-Bus object path to register the iterator under.
dbusClient The optional D-Bus client which uses the iterator, i.e. which called the method that triggered the creation of the iterator. If set, the iterator will be closed once the client dies. In combination with setDeleteOnClose this class can thus be used in a fire-and-forget manner.
void Soprano::Server::DBusExportIterator::setDeleteOnClose ( bool  deleteOnClose  )  [slot]

Set if the iterator should delete itself once it has been closed.

The default value is false, i.e. the creator has to delete the instance.

Warning:
This only works if the iterator is closed from the outside, i.e. by the D-Bus client.
See also:
deleteOnClose
StatementIterator Soprano::Server::DBusExportIterator::statementIterator (  )  const
Returns:
The used StatementIterator or an invalid one if this DBusExportIterator does not export a StatementIterator.
void Soprano::Server::DBusExportIterator::unregisterIterator (  )  [slot]

Unregister the iterator from D-Bus.

See also:
QDBusConnection::unregisterObject

The documentation for this class was generated from the following file:
  • dbusexportiterator.h

soprano

Skip menu "soprano"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE Support

Skip menu "KDE Support"
  • akonadi
  • Decibel
  • grantlee
  • kdewin
  • phonon
  •     Backend
  • polkit-qt
  • qca
  • qimageblitz
  • soprano
  • strigi
  •     searchclient
  •     streamanalyzer
  •     streams
Generated for KDE Support by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal