Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _SOPRANO_SERVER_CORE_H_
00023 #define _SOPRANO_SERVER_CORE_H_
00024
00025 #include <QtCore/QObject>
00026
00027 #include "error.h"
00028 #include "soprano_export.h"
00029
00030 namespace Soprano {
00031
00032 class Backend;
00033 class Model;
00034 class BackendSetting;
00035
00036 namespace Server {
00037
00038 class ServerCorePrivate;
00039
00074 class SOPRANO_SERVER_EXPORT ServerCore : public QObject, public Error::ErrorCache
00075 {
00076 Q_OBJECT
00077
00078 public:
00079 ServerCore( QObject* parent = 0 );
00080 virtual ~ServerCore();
00081
00085 static const quint16 DEFAULT_PORT;
00086
00090 void setBackend( const Backend* backend );
00091
00095 const Backend* backend() const;
00096
00104 void setBackendSettings( const QList<BackendSetting>& settings );
00105
00111 QList<BackendSetting> backendSettings() const;
00112
00126 void setMaximumConnectionCount( int max );
00127
00138 int maximumConnectionCount() const;
00139
00148 virtual Model* model( const QString& name );
00149
00163 virtual void removeModel( const QString& name );
00164
00170 virtual QStringList allModels() const;
00171
00183 bool start( const QString& socketPath = QString() );
00184
00201 bool listen( quint16 port = DEFAULT_PORT );
00202
00209 quint16 serverPort() const;
00210
00224 void registerAsDBusObject( const QString& objectPath = QString() );
00225
00226 private Q_SLOTS:
00227 void serverConnectionFinished();
00228
00229 protected:
00241
00242 virtual Model* createModel( const QList<BackendSetting>& settings );
00243
00244 private:
00245 ServerCorePrivate* const d;
00246 };
00247 }
00248 }
00249
00250 #endif