-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cc
75 lines (65 loc) · 2.38 KB
/
main.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* main.cc ---
*
* Copyright (C) 2010 Alp Eren Köse
*
* Author: Alp Eren Köse <[email protected]>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3, or
* any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/*!
\file main.cc
\date Wed Jul 14 17:09:38 2010
\brief Starting point of the application.
Here we run the WApplication Server.
*/
#include <Wt/WApplication>
#include "harixApp.hpp"
//! Creates the WApplication instance.
/*!
Initiates an HarixApp instance which inherits WApplication.
The environment provides information on the client, and gives access to startup arguments.
\param env variable to access the client environment.
\return The application server instance.
*/
Wt::WApplication *createApplication(const Wt::WEnvironment& env)
{
/*
* You could read information from the environment to decide whether
* the user has permission to start a new application
*/
return new HarixApp(env);
}
//! Well here we start, everyone knows main :)
/*!
The createApplication argument is a function pointer to create new application instances
for each new user surfing to the application.
\return Success status to the OS.
*/
int main(int argc, char **argv)
{
/*
* Your main method may set up some shared resources, but should then
* start the server application (FastCGI or httpd) that starts listening
* for requests, and handles all of the application life cycles.
*
* The last argument to WRun specifies the function that will instantiate
* new application objects. That function is executed when a new user surfs
* to the Wt application, and after the library has negotiated browser
* support. The function should return a newly instantiated application
* object.
*/
return WRun(argc, argv, &createApplication);
}