NAWA  0.8
Web Application Framework for C++
AppInit.cpp
Go to the documentation of this file.
1 
6 /*
7  * Copyright (C) 2019-2021 Tobias Flaig.
8  *
9  * This file is part of nawa.
10  *
11  * nawa is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License,
13  * version 3, as published by the Free Software Foundation.
14  *
15  * nawa is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with nawa. If not, see <https://www.gnu.org/licenses/>.
22  */
23 
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(move(config)), numThreads(numThreads) {}
35 };
36 
38 
39 AppInit::AppInit(Config config, size_t numThreads) {
40  data = make_unique<Data>(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