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
26
using namespace
nawa
;
27
using namespace
std;
28
29
struct
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
37
NAWA_DEFAULT_DESTRUCTOR_IMPL
(
AppInit
)
38
39
AppInit
::
AppInit
(
Config
config,
size_t
numThreads) {
40
data = make_unique<Data>(std::move(config), numThreads);
41
}
42
43
Config
&
nawa::AppInit::config
() {
44
return
data->config;
45
}
46
47
AccessFilterList
&
nawa::AppInit::accessFilters
() {
48
return
data->accessFilters;
49
}
50
51
size_t
nawa::AppInit::getNumThreads
() {
52
return
data->numThreads;
53
}
AppInit.h
Structure passed to the init function of nawa apps.
nawa::AccessFilterList
Definition:
AccessFilterList.h:40
nawa::AppInit
Definition:
AppInit.h:32
nawa::AppInit::accessFilters
AccessFilterList & accessFilters()
Definition:
AppInit.cpp:47
nawa::AppInit::config
Config & config()
Definition:
AppInit.cpp:43
nawa::AppInit::getNumThreads
size_t getNumThreads()
Definition:
AppInit.cpp:51
nawa::Config
Definition:
Config.h:35
NAWA_DEFAULT_DESTRUCTOR_IMPL
#define NAWA_DEFAULT_DESTRUCTOR_IMPL(Class)
Definition:
macros.h:36
nawa
Definition:
AppInit.h:31
src
AppInit.cpp
Generated by
1.9.2