NAWA 0.9
Web Application Framework for C++
AppInit.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019-2022 Tobias Flaig.
3 *
4 * This file is part of nawa.
5 *
6 * nawa is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License,
8 * version 3, as published by the Free Software Foundation.
9 *
10 * nawa is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with nawa. If not, see <https://www.gnu.org/licenses/>.
17 */
18
24#include <nawa/AppInit.h>
25
26using namespace nawa;
27using namespace std;
28
29struct AppInit::Data {
30 Config config;
31 AccessFilterList accessFilters;
32 size_t numThreads;
33
34 Data(Config config, size_t numThreads) : config(std::move(config)), numThreads(numThreads) {}
35};
36
38
39AppInit::AppInit(Config config, size_t numThreads) {
40 data = make_unique<Data>(std::move(config), numThreads);
41}
42
44 return data->config;
45}
46
48 return data->accessFilters;
49}
50
52 return data->numThreads;
53}
Structure passed to the init function of nawa apps.
AccessFilterList & accessFilters()
Definition: AppInit.cpp:47
Config & config()
Definition: AppInit.cpp:43
size_t getNumThreads()
Definition: AppInit.cpp:51
#define NAWA_DEFAULT_DESTRUCTOR_IMPL(Class)
Definition: macros.h:36
Definition: AppInit.h:31