2021-03-26 17:20:17 +03:00
2021-03-26 17:20:17 +03:00
2020-04-26 15:21:01 +03:00
2021-03-26 17:20:17 +03:00
2021-01-24 14:09:31 +03:00
2021-01-31 20:00:51 +03:00
2020-04-26 15:22:20 +03:00
2020-04-17 11:24:01 +03:00
2020-05-09 13:43:35 +03:00

Patronum

This is extension libraries for control your daemons based on QtServices from qt-solutions.

Why is Patronum?

Becouse This library offers easy interface to control your demons likewise the magic of Harry Potter controls dementors

Main features

  • Support Windows API services, and Linux systemd daemons.
  • Auto create a Service from your server or yor daemon utility.
  • Auto create a Controller of your Service.

Include

For cmake projects

  • cd yourRepo
  • git submodule add https://github.com/QuasarApp/Patronum.git # add the repository of Patronum into your repo like submodule
  • git submodule update --init --recursive
  • Include in your CMakeLists.txt file the main CMakeLists.txt file of Patronum library
  include(Patronum)
  • Rebuild yuor project

Use

Service

#include <patronum.h>

class MyserviceApp : public Patronum::Service<QCoreApplication>
{

public:
    MyserviceApp(int argc, char **argv):
        Patronum::Service<QCoreApplication>(argc, argv, "MyService") {

    }

    void start() {
        // call on server started 
    }

    void stop() {
        // call on server stoped 
    }

    void handleReceive(const QList<Feature> &data) {
        for (auto i : data) {
            if (i.cmd == "Ping") {
                sendResuylt(QVariantMap{{"Pong", "From server"}})
            }
        }
    };


    QList<Feature> supportedFeatures() {

        QList<Feature> res;
        Feature Ping = {"Ping", ""}
        return res << Ping;
    }
};


int main(int argc, char **argv) {
    MyserviceApp app;
    return app.exec();
}

Controller

#include <patronum.h>

class MyControllerApp : public Patronum::Controller
{
public:

    MyControllerApp():
        Patronum::Controller("MyService") {

    }
};

int main(int argc, char **argv) {
    QCoreApplcication app
    MyControllerApp controller;
    controller.send(argc, argv);
    return app.exec();
}
Description
No description provided
Readme GPL-3.0 3.1 MiB
Languages
C++ 95.9%
CMake 4%