SNode.C
Loading...
Searching...
No Matches
WebApp.h
Go to the documentation of this file.
1/*
2 * SNode.C - a slim toolkit for network communication
3 * Copyright (C) Volker Christian <me@vchrist.at>
4 * 2020, 2021, 2022, 2023, 2024, 2025
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef EXPRESS_WEBAPP_H
21#define EXPRESS_WEBAPP_H
22
23#include "core/State.h"
24#include "core/TickStatus.h"
25#include "express/Router.h" // IWYU pragma: export
26
27#ifndef DOXYGEN_SHOULD_SKIP_THIS
28
29#include "utils/Timeval.h"
30
31#include <climits>
32
33#endif /* DOXYGEN_SHOULD_SKIP_THIS */
34
35namespace express {
36
37 class WebApp : public Router {
38 protected:
39 explicit WebApp(const Router& router);
40
41 public:
42 static void init(int argc, char* argv[]);
43 static int start(const utils::Timeval& timeOut = {LONG_MAX, 0});
44 static void stop();
45 static core::TickStatus tick(const utils::Timeval& timeOut = 0);
46 static void free();
47
48 static core::State state();
49 };
50
51} // namespace express
52
53#endif // EXPRESS_WEBAPP_H
#define APPLICATION(req, res)
Definition Router.h:45
WebAppT(const std::string &name, const Router &router)
Definition WebAppT.h:58
WebAppT(const std::string &name)
Definition WebAppT.h:54
static void free()
Definition WebApp.cpp:50
static void init(int argc, char *argv[])
Definition WebApp.cpp:34
static void stop()
Definition WebApp.cpp:42
static core::TickStatus tick(const utils::Timeval &timeOut=0)
Definition WebApp.cpp:46
static core::State state()
Definition WebApp.cpp:54
static int start(const utils::Timeval &timeOut={LONG_MAX, 0})
Definition WebApp.cpp:38
WebApp(const Router &router)
Definition WebApp.cpp:30
int main(int argc, char *argv[])
Definition Config.h:37