1 #ifndef QTSERVICE_SERVICEBACKEND_H 2 #define QTSERVICE_SERVICEBACKEND_H 4 #include <QtCore/qobject.h> 5 #include <QtCore/qbytearraylist.h> 6 #include <QtCore/qscopedpointer.h> 8 #include "QtService/qtservice_global.h" 9 #include "QtService/service.h" 13 class ServiceBackendPrivate;
28 Q_ENUM(ServiceCommand)
35 virtual int runService(
int &argc,
char **argv,
int flags) = 0;
37 virtual void quitService() = 0;
39 virtual void reloadService() = 0;
46 virtual void signalTriggered(
int signal);
51 QVariant processServiceCallbackImpl(
const QByteArray &kind,
const QVariantList &args = {});
62 template <
typename TRet,
typename... TArgs>
63 TRet processServiceCallback(
const QByteArray &kind, TArgs... args);
68 template <
typename... TArgs>
69 void processServiceCallback(
const QByteArray &kind, TArgs... args);
72 bool registerForSignal(
int signal);
74 bool unregisterFromSignal(
int signal);
77 bool preStartService();
80 void onSvcStarted(
bool success);
82 void onSvcReloaded(
bool success);
83 void onSvcResumed(
bool success);
84 void onSvcPaused(
bool success);
90 template<
typename TRet,
typename... TArgs>
96 template<
typename... TArgs>
106 #endif // QTSERVICE_SERVICEBACKEND_H
ServiceCommand
The standard service commands that the library can handle.
Service should stop. Will lead to Service::onStop beeing called.
QVariant processServiceCallbackImpl(const QByteArray &kind, const QVariantList &args={})
Calls a special command as service callback synchronously.
Service should reload. Will lead to Service::onReload beeing called.
The main interface to implement to create a service.
TRet processServiceCallback(const QByteArray &kind, TArgs... args)
Calls a special command as service callback synchronously.
The primary namespace of the QtService library.
QVariant fromValue(const T &value)
The interface that needs to be implemented to provide the backend for the service engine...
Service should pause. Will lead to Service::onPause beeing called.
Service was started. Will lead to Service::onStart beeing called.