-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCDWEnvironment.h
More file actions
45 lines (38 loc) · 1.16 KB
/
CDWEnvironment.h
File metadata and controls
45 lines (38 loc) · 1.16 KB
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
/*
* Wapplication.h
*
* Created on: 01-dec.-2014
* Author: Thomas Weyn
*/
#include <Wt/WApplication>
#include "CDWObject.h"
namespace Wt {
class CDWApplication : public CDWObject{
public:
static CDWApplication* instance = nullptr;
CDWApplication(WApplication* object = 0): CDWObject(object) {}
WApplication* getObject() const {
return static_cast<WApplication*>(wobject);
}
};
/*! \brief Creates a new application instance.
*
* The \p environment provides information on the initial request,
* user agent, and deployment-related information.
*/
inline CDWApplication* constructWApplication(const WEnvironment& environment){
return new CDWApplication(new WApplication(environment));
}
/*! \brief Returns the current application instance.
*
* \if cpp
* This is the same as the global define #wApp. In a multi-threaded server,
* this method uses thread-specific storage to fetch the current session.
* \elseif java
* This method uses thread-specific storage to fetch the current session.
* \endif
*/
static CDWApplication* getCDWApplicationInstance(){
return CDWApplication::instance;
}
}