![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /******************************************************************************* 00002 * This file is part of openWNS (open Wireless Network Simulator) 00003 * _____________________________________________________________________________ 00004 * 00005 * Copyright (C) 2004-2007 00006 * Chair of Communication Networks (ComNets) 00007 * Kopernikusstr. 16, D-52074 Aachen, Germany 00008 * phone: ++49-241-80-27910, 00009 * fax: ++49-241-80-22242 00010 * email: info@openwns.org 00011 * www: http://www.openwns.org 00012 * _____________________________________________________________________________ 00013 * 00014 * openWNS is free software; you can redistribute it and/or modify it under the 00015 * terms of the GNU Lesser General Public License version 2 as published by the 00016 * Free Software Foundation; 00017 * 00018 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY 00019 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00020 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00021 * details. 00022 * 00023 * You should have received a copy of the GNU Lesser General Public License 00024 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00025 * 00026 ******************************************************************************/ 00027 00028 #ifndef WNS_SIMULATOR_APPLICATION_HPP 00029 #define WNS_SIMULATOR_APPLICATION_HPP 00030 00031 #include <WNS/simulator/IApplication.hpp> 00032 #include <WNS/pyconfig/Parser.hpp> 00033 #include <WNS/logger/Logger.hpp> 00034 #include <WNS/events/scheduler/Monitor.hpp> 00035 #include <WNS/simulator/ISimulationModel.hpp> 00036 //#include <WNS/module/VersionInformation.hpp> 00037 #include <WNS/probe/bus/ProbeBusRegistry.hpp> 00038 #include <WNS/probe/bus/ContextCollector.hpp> 00039 #include <WNS/simulator/StatusReport.hpp> 00040 #include <WNS/simulator/ProbeWriter.hpp> 00041 00042 #include <boost/program_options/options_description.hpp> 00043 #include <boost/program_options/parsers.hpp> 00044 #include <boost/program_options/variables_map.hpp> 00045 00046 #include <vector> 00047 #include <string> 00048 #include <memory> 00049 00050 namespace wns { 00051 00052 namespace module { 00053 class Base; 00054 } 00055 } 00056 00057 namespace wns { namespace simulator { 00058 00059 class ModuleDependencyMismatchException : 00060 public wns::Exception 00061 { 00062 public: 00063 ModuleDependencyMismatchException(); 00064 ~ModuleDependencyMismatchException() throw() {} 00065 }; 00066 00067 00081 class Application : 00082 public IApplication 00083 { 00084 // needs to be vector to work with boost 00085 typedef std::vector<std::string> TestNameContainer; 00086 typedef std::vector<std::string> PyConfigPatchContainer; 00087 00088 public: 00092 Application(); 00093 00097 virtual 00098 ~Application(); 00099 00100 protected: 00104 virtual void 00105 doReadCommandLine(int argc, char* argv[]); 00106 00110 virtual void 00111 doInit(); 00112 00116 virtual void 00117 doRun(); 00118 00122 virtual void 00123 doShutdown(); 00124 00128 virtual int 00129 doStatus() const; 00130 00134 static void 00135 unexpectedHandler(); 00136 00140 static std::string 00141 getPathToPyConfig(); 00142 00146 pyconfig::View 00147 getWNSView() const; 00148 00193 static void 00194 disableX87ExtendedFloatingPointPrecision(); 00195 00196 00200 void 00201 loadModules(); 00202 00203 00208 void 00209 writeFingerprint(); 00210 00214 void 00215 stopProbes(); 00216 00217 00225 int status_; 00226 00230 std::string configFile_; 00231 00235 pyconfig::Parser configuration_; 00236 00240 bool verbose_; 00241 00245 bool testing_; 00246 00250 bool compilerTestingOutput_; 00251 00255 TestNameContainer testNames_; 00256 00260 PyConfigPatchContainer pyConfigPatches_; 00261 00265 boost::program_options::options_description options_; 00266 00270 boost::program_options::variables_map arguments_; 00271 00275 std::string programName_; 00276 00280 std::string debuggerName_; 00281 00285 bool attachDebugger_; 00286 00290 bool interactiveConfig_; 00291 00297 wns::logger::Logger logger_; 00298 00302 std::auto_ptr<wns::events::scheduler::Monitor> eventSchedulerMonitor_; 00303 00307 bool extendedPrecision_; 00308 00312 std::auto_ptr<wns::simulator::ISimulationModel> simulationModel_; 00313 00317 std::list<pyconfig::View> moduleViews_; 00318 00322 bool listLoadedModules_; 00323 00327 std::list<wns::module::Base*> loadedModules_; 00328 00329 bool lazyBinding_; 00330 00331 bool absolutePath_; 00332 00336 std::auto_ptr<wns::probe::bus::ProbeBusRegistry> probeBusRegistry; 00337 00338 StatusReport statusReport; 00339 00340 ProbeWriter probeWriter; 00341 00345 wns::probe::bus::ContextCollectorPtr cpuCyclesProbe_; 00346 }; 00347 00348 } // simulator 00349 } // wns 00350 00351 #endif // NOT defined WNS_SIMULATOR_APPLICATION_HPP 00352
1.5.5