root/simulator/trunk/src/simulator/network.cpp

Revision 1449, 2.1 kB (checked in by sehenley, 7 months ago)

Clean tabs, line endings - etc.

  • Property WBS set to 1.1.4.7
  • Property svn:keywords set to
    Url
    Rev
    Author
    Date
    Id
Line 
1 //    OSRail -- a network enabled railroad operations simulator and utilities
2 //    Copyright (C) 2007,2008  Samuel E. Henley sehenley@comcast.net
3 //
4 //    This program is free software; you can redistribute it and/or modify
5 //    it under the terms of the GNU General Public License as published by
6 //    the Free Software Foundation; either version 2 of the License, or
7 //    (at your option) any later version.
8 //
9 //    This program is distributed in the hope that it will be useful,
10 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 //    GNU General Public License for more details.
13 //
14 //    You should have received a copy of the GNU General Public License along
15 //    with this program; if not, write to the Free Software Foundation, Inc.,
16 //    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 //
18 /// \file
19 /// Implementation file for Network manager of the simulator and the INetwork factory. 
20
21 // Pre-Compiled Header for Simulator
22 #include "presimulator.h"
23
24 #include "network.h"
25
26 /// \addtogroup simulator "Simulator"
27 /// @{
28     /// \addtogroup simulatorcomponent "Simulator Components"
29     /// @{
30         /// \addtogroup network "Network"
31         /// @{
32
33 extern INetwork* createNetwork( ISystem& sys )
34 {
35     return new Network( sys );
36 }
37
38 Network::Network( ISystem& sys ) : system( sys ), curl_handle(0)
39 {
40 }
41
42 Network::~Network()
43 {
44 }
45
46 //vertual
47 void Network::startup()
48 {
49     MESSAGE( "Simulator", "Network", "Startup" )
50     curl_handle = curl_easy_init();
51     if( !curl_handle )
52     {
53         MESSAGE( "Simulator", "Network", "Unable to initialize libcurl" )
54     }
55     else
56     {
57         MESSAGE( "Simulator", "Network", "Initialized libcurl" )
58     }
59
60 }
61
62 //virtual
63 void Network::operator()()
64 {
65 }
66
67 //virtual
68 void Network::shutdown()
69 {
70     MESSAGE( "Simulator", "Network", "Shutdown" )
71     curl_easy_cleanup(curl_handle);
72     MESSAGE( "Simulator", "Network", "Cleanup libcurl" )
73     curl_handle = 0;
74 }
75
76
77
78         /// @}   group network
79     /// @}   group simulatorcomponent
80 /// @} group simulator
Note: See TracBrowser for help on using the browser.