cutelyst  4.4.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
systemdnotify.h
1 /*
2  * SPDX-FileCopyrightText: (C) 2017 Daniel Nicoletti <dantti12@gmail.com>
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 #ifndef SYSTEMDNOTIFY_H
6 #define SYSTEMDNOTIFY_H
7 
8 #include <QByteArray>
9 #include <QObject>
10 
11 namespace Cutelyst {
12 
13 class systemdNotifyPrivate;
14 class systemdNotify : public QObject
15 {
16  Q_OBJECT
17  Q_DECLARE_PRIVATE(systemdNotify)
18 public:
19  explicit systemdNotify(QObject *parent = nullptr);
20  ~systemdNotify();
21 
22  int watchdogUSec() const;
23 
24  bool setWatchdog(bool enable, int usec = 0);
25 
26  void sendStatus(const QByteArray &data);
27  void sendWatchdog(const QByteArray &data);
28  void sendReady(const QByteArray &data);
29 
30  // Returns the usec if > 0 else it is disabled
31  // Set unset to true before forking
32  static int sd_watchdog_enabled(bool unset);
33 
34  static bool is_systemd_notify_available();
35 
36  static std::vector<int> listenFds(bool unsetEnvironment = true);
37 
38 private:
39  systemdNotifyPrivate *d_ptr;
40 };
41 
42 } // namespace Cutelyst
43 
44 #endif // SYSTEMDNOTIFY_H
The Cutelyst namespace holds all public Cutelyst API.
Q_OBJECTQ_OBJECT
QObject * parent() const const