SUMO - Simulation of Urban MObility

SystemFrame.cpp

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // A set of actions common to all applications
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright (C) 2001-2011 DLR (http://www.dlr.de/) and contributors
00011 /****************************************************************************/
00012 //
00013 //   This program is free software; you can redistribute it and/or modify
00014 //   it under the terms of the GNU General Public License as published by
00015 //   the Free Software Foundation; either version 2 of the License, or
00016 //   (at your option) any later version.
00017 //
00018 /****************************************************************************/
00019 
00020 
00021 // ===========================================================================
00022 // included modules
00023 // ===========================================================================
00024 #ifdef _MSC_VER
00025 #include <windows_config.h>
00026 #else
00027 #include <config.h>
00028 #endif
00029 
00030 #include "SystemFrame.h"
00031 #include <string>
00032 #include <utils/xml/XMLSubSys.h>
00033 #include <utils/common/MsgHandler.h>
00034 #include <utils/options/OptionsCont.h>
00035 #include "RandHelper.h"
00036 
00037 #ifdef CHECK_MEMORY_LEAKS
00038 #include <foreign/nvwa/debug_new.h>
00039 #endif // CHECK_MEMORY_LEAKS
00040 
00041 
00042 // ===========================================================================
00043 // method definitions
00044 // ===========================================================================
00045 void
00046 SystemFrame::addConfigurationOptions(OptionsCont& oc) {
00047     oc.addOptionSubTopic("Configuration");
00048 
00049     oc.doRegister("configuration-file", 'c', new Option_FileName());
00050     oc.addSynonyme("configuration-file", "configuration");
00051     oc.addDescription("configuration-file", "Configuration", "Loads the named config on startup");
00052 
00053     oc.doRegister("save-configuration", new Option_FileName());
00054     oc.addSynonyme("save-config", "save-configuration");
00055     oc.addDescription("save-configuration", "Configuration", "Saves current configuration into FILE");
00056 
00057     oc.doRegister("save-template", new Option_FileName());
00058     oc.addDescription("save-template", "Configuration", "Saves a configuration template (empty) into FILE");
00059 
00060     oc.doRegister("save-schema", new Option_FileName());
00061     oc.addDescription("save-schema", "Configuration", "Saves the configuration schema into FILE");
00062 
00063     oc.doRegister("save-commented", new Option_Bool(false));
00064     oc.addSynonyme("save-commented", "save-template.commented");
00065     oc.addDescription("save-commented", "Configuration", "Adds comments to saved template, configuration, or schema");
00066 }
00067 
00068 
00069 void
00070 SystemFrame::addReportOptions(OptionsCont& oc) {
00071     oc.addOptionSubTopic("Report");
00072 
00073     oc.doRegister("verbose", 'v', new Option_Bool(false));
00074     oc.addDescription("verbose", "Report", "Switches to verbose output");
00075 
00076     oc.doRegister("print-options", 'p', new Option_Bool(false));
00077     oc.addDescription("print-options", "Report", "Prints option values before processing");
00078 
00079     oc.doRegister("help", '?', new Option_Bool(false));
00080     oc.addDescription("help", "Report", "Prints this screen");
00081 
00082     oc.doRegister("version", 'V', new Option_Bool(false));
00083     oc.addDescription("version", "Report", "Prints the current version");
00084 
00085     oc.doRegister("no-warnings", 'W', new Option_Bool(false));
00086     oc.addSynonyme("no-warnings", "suppress-warnings", true);
00087     oc.addDescription("no-warnings", "Report", "Disables output of warnings");
00088 
00089     oc.doRegister("log", 'l', new Option_FileName());
00090     oc.addSynonyme("log", "log-file");
00091     oc.addDescription("log", "Report", "Writes all messages to FILE");
00092 
00093     oc.doRegister("message-log", new Option_FileName());
00094     oc.addDescription("message-log", "Report", "Writes all non-error messages to FILE");
00095 
00096     oc.doRegister("error-log", new Option_FileName());
00097     oc.addDescription("error-log", "Report", "Writes all warnings and errors to FILE");
00098 }
00099 
00100 
00101 void
00102 SystemFrame::close() {
00103     // close the xml-subsystem
00104     XMLSubSys::close();
00105     // delete build program options
00106     OptionsCont::getOptions().clear();
00107     // delete messages
00108     MsgHandler::cleanupOnEnd();
00109 }
00110 
00111 
00112 /****************************************************************************/
00113 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines