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