2021-04-16 11:54:58 +03:00
2021-04-01 18:30:15 +03:00
2021-01-24 14:09:31 +03:00
2021-04-01 16:59:03 +03:00
2021-04-02 09:09:10 +03:00
2021-04-17 15:52:42 +03:00
2020-04-17 11:24:01 +03:00
2021-03-30 18:30:22 +03:00
2020-09-15 18:20:51 +03:00

Patronum

This is extension libraries for control your daemons.

Why is Patronum?

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

Main features

  • Support 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
  add_subdirectory(Patronum)
  • Rebuild yuor project

Usage

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%