Version: 0.6.0
serverapp.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Server)
3  * Purpose: Main server application class.
4  * Author: Bishop (aka Barishnikov Dmitriy), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2010-2012 Bishop
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  ****************************************************************************/
21 /*#pragma once
22 
23 #include "wxgis/base.h"
24 
25 #include <wx/app.h>
26 #include <wx/defs.h>
27 #include <wx/cmdline.h>
28 #include <wx/string.h>
29 
30 //#include "wxgis/core/config.h"
31 //#include "wx/file.h"
32 //#include <wx/ffile.h>
33 //
35 //#include "wx/apptrait.h"
36 //#include "wx/platinfo.h"
37 //#include <wx/dir.h>
38 //#include <wx/log.h>
39 //#include <wx/xml/xml.h>
40 //#include <wx/stdpaths.h>
41 //#include <wx/filename.h>
42 //#include <wx/dynload.h>
43 //#include <wx/dynlib.h>
44 //#include <wx/intl.h>
45 
46 //#include <iostream>
47 //#include <stdio.h>
48 //#include <ctime>
49 //#include <vector>
50 *//*
51 // without this pragma, the stupid compiler precompiles #defines below so that
52 // changing them doesn't "take place" later!
53 #ifdef __VISUALC__
54  #pragma hdrstop
55 #endif
56 
57 #if !wxUSE_THREADS
58  #error "This program requires thread support!"
59 #endif // wxUSE_THREADS
60 
61 
62 //bool parse_commandline_parameters( int argc, char** argv );
63 //int main(int argc, char** argv);
64 
65 DECLARE_APP(Server);
66 */
67 
68 #pragma once
69 
70 #include "wxgis/base.h"
71 #include "wxgis/core/init.h"
72 #include "wxgis/core/config.h"
73 #include "wxgissrv/srv_framework/server.h"
74 
75 #include <wx/app.h>
76 #include <wx/snglinst.h>
77 #include <wx/thread.h>
78 
83  public wxAppConsole,
84  public wxGISAppWithLibs,
85  public wxThreadHelper
86 {
87 public:
88  wxGISServerApp(void);
89  virtual ~wxGISServerApp(void);
90  virtual bool OnInit();
91  virtual int OnExit();
92  //virtual int OnRun();
93  //virtual void ProcessPendingEvents(void);
94 
95 
96  void OnInitCmdLine(wxCmdLineParser& pParser);
97  bool OnCmdLineParsed(wxCmdLineParser& pParser);
98 protected:
99  virtual wxThread::ExitCode Entry();
100  bool CreateAndRunExitThread(void);
101  void DestroyExitThread(void);
102 private:
103  wxGISAppConfig m_oConfig;
104  wxGISServer* m_pServer;
105 #ifdef wxUSE_SNGLINST_CHECKER
106  wxSingleInstanceChecker *m_pChecker;
107 #endif
108  wxCriticalSection m_ExitLock;
109 };
110 
111 DECLARE_APP(wxGISServerApp)
Main Server class.
Definition: serverapp.h:82
Definition: init.h:44
Definition: config.h:123
The main Server class.
Definition: server.h:34