cutelyst 3.9.1
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
server.h
1/*
2 * SPDX-FileCopyrightText: (C) 2016-2022 Daniel Nicoletti <dantti12@gmail.com>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef CUTELYSTSERVER_H
6#define CUTELYSTSERVER_H
7
8#include <Cutelyst/cutelyst_global.h>
9
10#include <QObject>
11
13
14namespace Cutelyst {
15
16class Application;
17class ServerPrivate;
22class CUTELYST_SERVER_EXPORT Server : public QObject
23{
25 Q_DECLARE_PRIVATE(Server)
26public:
35 explicit Server(QObject *parent = nullptr);
36 virtual ~Server();
37
38 void parseCommandLine(const QStringList &args);
39
58 int exec(Cutelyst::Application *app = nullptr);
59
75 bool start(Cutelyst::Application *app = nullptr);
76
81 void stop();
82
88 Q_PROPERTY(QString application READ application WRITE setApplication NOTIFY changed)
89 void setApplication(const QString &application);
90 QString application() const;
91
104 Q_PROPERTY(QString threads READ threads WRITE setThreads NOTIFY changed)
105 void setThreads(const QString &threads);
106 QString threads() const;
107
113 Q_PROPERTY(QString processes READ processes WRITE setProcesses NOTIFY changed)
114 void setProcesses(const QString &process);
115 QString processes() const;
116
121 Q_PROPERTY(QString chdir READ chdir WRITE setChdir NOTIFY changed)
122 void setChdir(const QString &chdir);
123 QString chdir() const;
124
129 Q_PROPERTY(QStringList http_socket READ httpSocket WRITE setHttpSocket NOTIFY changed)
130 void setHttpSocket(const QStringList &httpSocket);
131 QStringList httpSocket() const;
132
137 Q_PROPERTY(QStringList http2_socket READ http2Socket WRITE setHttp2Socket NOTIFY changed)
138 void setHttp2Socket(const QStringList &http2Socket);
139 QStringList http2Socket() const;
140
145 Q_PROPERTY(quint32 http2_header_table_size READ http2HeaderTableSize WRITE
146 setHttp2HeaderTableSize NOTIFY changed)
147 void setHttp2HeaderTableSize(quint32 headerTableSize);
148 quint32 http2HeaderTableSize() const;
149
155 Q_PROPERTY(bool upgrade_h2c READ upgradeH2c WRITE setUpgradeH2c NOTIFY changed)
156 void setUpgradeH2c(bool enable);
157 bool upgradeH2c() const;
158
164 Q_PROPERTY(bool https_h2 READ httpsH2 WRITE setHttpsH2 NOTIFY changed)
165 void setHttpsH2(bool enable);
166 bool httpsH2() const;
167
172 Q_PROPERTY(QStringList https_socket READ httpsSocket WRITE setHttpsSocket NOTIFY changed)
173 void setHttpsSocket(const QStringList &httpsSocket);
174 QStringList httpsSocket() const;
175
180 Q_PROPERTY(QStringList fastcgi_socket READ fastcgiSocket WRITE setFastcgiSocket NOTIFY changed)
181 void setFastcgiSocket(const QStringList &fastcgiSocket);
182 QStringList fastcgiSocket() const;
183
188 Q_PROPERTY(QString socket_access READ socketAccess WRITE setSocketAccess NOTIFY changed)
189 void setSocketAccess(const QString &socketAccess);
190 QString socketAccess() const;
191
196 Q_PROPERTY(int socket_timeout READ socketTimeout WRITE setSocketTimeout NOTIFY changed)
197 void setSocketTimeout(int timeout);
198 int socketTimeout() const;
199
204 Q_PROPERTY(QString chdir2 READ chdir2 WRITE setChdir2 NOTIFY changed)
205 void setChdir2(const QString &chdir2);
206 QString chdir2() const;
207
212 Q_PROPERTY(QStringList ini READ ini WRITE setIni NOTIFY changed)
213 void setIni(const QStringList &files);
214 QStringList ini() const;
215
220 Q_PROPERTY(QStringList json READ json WRITE setJson NOTIFY changed)
221 void setJson(const QStringList &files);
222 QStringList json() const;
223
228 Q_PROPERTY(QStringList static_map READ staticMap WRITE setStaticMap NOTIFY changed)
229 void setStaticMap(const QStringList &staticMap);
230 QStringList staticMap() const;
231
237 Q_PROPERTY(QStringList static_map2 READ staticMap2 WRITE setStaticMap2 NOTIFY changed)
238 void setStaticMap2(const QStringList &staticMap);
239 QStringList staticMap2() const;
240
246 Q_PROPERTY(bool master READ master WRITE setMaster NOTIFY changed)
247 void setMaster(bool enable);
248 bool master() const;
249
254 Q_PROPERTY(bool auto_reload READ autoReload WRITE setAutoReload NOTIFY changed)
255 void setAutoReload(bool enable);
256 bool autoReload() const;
257
262 Q_PROPERTY(QStringList touch_reload READ touchReload WRITE setTouchReload NOTIFY changed)
263 void setTouchReload(const QStringList &files);
264 QStringList touchReload() const;
265
272 Q_PROPERTY(int listen READ listenQueue WRITE setListenQueue NOTIFY changed)
273 void setListenQueue(int size);
274 int listenQueue() const;
275
280 Q_PROPERTY(int buffer_size READ bufferSize WRITE setBufferSize NOTIFY changed)
281 void setBufferSize(int size);
282 int bufferSize() const;
283
289 Q_PROPERTY(qint64 post_buffering READ postBuffering WRITE setPostBuffering NOTIFY changed)
290 void setPostBuffering(qint64 size);
291 qint64 postBuffering() const;
292
297 Q_PROPERTY(qint64 post_buffering_bufsize READ postBufferingBufsize WRITE setPostBufferingBufsize
298 NOTIFY changed)
299 void setPostBufferingBufsize(qint64 size);
300 qint64 postBufferingBufsize() const;
301
306 Q_PROPERTY(bool tcp_nodelay READ tcpNodelay WRITE setTcpNodelay NOTIFY changed)
307 void setTcpNodelay(bool enable);
308 bool tcpNodelay() const;
309
314 Q_PROPERTY(bool so_keepalive READ soKeepalive WRITE setSoKeepalive NOTIFY changed)
315 void setSoKeepalive(bool enable);
316 bool soKeepalive() const;
317
323 Q_PROPERTY(int socket_sndbuf READ socketSndbuf WRITE setSocketSndbuf NOTIFY changed)
324 void setSocketSndbuf(int value);
325 int socketSndbuf() const;
326
332 Q_PROPERTY(int socket_rcvbuf READ socketRcvbuf WRITE setSocketRcvbuf NOTIFY changed)
333 void setSocketRcvbuf(int value);
334 int socketRcvbuf() const;
335
341 int websocket_max_size READ websocketMaxSize WRITE setWebsocketMaxSize NOTIFY changed)
342 void setWebsocketMaxSize(int value);
343 int websocketMaxSize() const;
344
349 Q_PROPERTY(QString pidfile READ pidfile WRITE setPidfile NOTIFY changed)
350 void setPidfile(const QString &file);
351 QString pidfile() const;
352
357 Q_PROPERTY(QString pidfile2 READ pidfile2 WRITE setPidfile2 NOTIFY changed)
358 void setPidfile2(const QString &file);
359 QString pidfile2() const;
360
366 Q_PROPERTY(QString uid READ uid WRITE setUid NOTIFY changed)
367 void setUid(const QString &uid);
368 QString uid() const;
369
375 Q_PROPERTY(QString gid READ gid WRITE setGid NOTIFY changed)
376 void setGid(const QString &gid);
377 QString gid() const;
378
384 Q_PROPERTY(bool no_initgroups READ noInitgroups WRITE setNoInitgroups NOTIFY changed)
385 void setNoInitgroups(bool enable);
386 bool noInitgroups() const;
387
393 Q_PROPERTY(QString chown_socket READ chownSocket WRITE setChownSocket NOTIFY changed)
394 void setChownSocket(const QString &chownSocket);
395 QString chownSocket() const;
396
402 Q_PROPERTY(QString umask READ umask WRITE setUmask NOTIFY changed)
403 void setUmask(const QString &value);
404 QString umask() const;
405
411 Q_PROPERTY(int cpu_affinity READ cpuAffinity WRITE setCpuAffinity NOTIFY changed)
412 void setCpuAffinity(int value);
413 int cpuAffinity() const;
414
420 Q_PROPERTY(bool reuse_port READ reusePort WRITE setReusePort NOTIFY changed)
421 void setReusePort(bool enable);
422 bool reusePort() const;
423
428 Q_PROPERTY(bool lazy READ lazy WRITE setLazy NOTIFY changed)
429 void setLazy(bool enable);
430 bool lazy() const;
431
438 Q_PROPERTY(bool using_frontend_proxy READ usingFrontendProxy WRITE setUsingFrontendProxy NOTIFY
439 changed)
440 void setUsingFrontendProxy(bool enable);
441 bool usingFrontendProxy() const;
442
447 void ready();
452 void stopped();
453
454 void changed();
459 void errorOccured(const QString &error);
460
461protected:
462 ServerPrivate *d_ptr;
463};
464
465} // namespace Cutelyst
466
467#endif // CUTELYSTSERVER_H
The Cutelyst Application.
Definition application.h:43
QString application
Definition server.h:88
quint32 http2_header_table_size
Definition server.h:145
QString pidfile2
Definition server.h:354
void errorOccured(const QString &error)
QStringList https_socket
Definition server.h:171
QString chdir
Definition server.h:121
QStringList http_socket
Definition server.h:129
QString gid
Definition server.h:372
qint64 post_buffering
Definition server.h:288
qint64 post_buffering_bufsize
Definition server.h:296
bool start(Cutelyst::Application *app=nullptr)
This function will start the Cutelyst::Server in user application mode.
QString threads
Definition server.h:104
QStringList static_map
Definition server.h:227
QStringList touch_reload
Definition server.h:261
bool so_keepalive
Definition server.h:312
QString pidfile
Definition server.h:346
void stop()
Terminates the server execution, when started with start(), it does nothing when started by exec().
QStringList fastcgi_socket
Definition server.h:179
Server(QObject *parent=nullptr)
Server.
QString processes
Definition server.h:113
QStringList json
Definition server.h:219
int websocket_max_size
Definition server.h:338
bool using_frontend_proxy
Definition server.h:435
int exec(Cutelyst::Application *app=nullptr)
QString chdir2
Definition server.h:203
bool no_initgroups
Definition server.h:381
QStringList static_map2
Definition server.h:236
QString umask
Definition server.h:399
QString uid
Definition server.h:363
QStringList ini
Definition server.h:211
QString socket_access
Definition server.h:187
QString chown_socket
Definition server.h:390
QStringList http2_socket
Definition server.h:137
The Cutelyst namespace holds all public Cutelyst API.
Definition Mainpage.dox:8
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
QObject * parent() const const