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 2001-2010 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     /*
00061     oc.doRegister("save-template.mandatory-only", new Option_Bool(false));
00062     oc.addDescription("save-template.mandatory-only", "Configuration", "Saves only mandatory values into template");
00063     */
00064 
00065     oc.doRegister("save-template.commented", new Option_Bool(false));
00066     oc.addDescription("save-template.commented", "Configuration", "Adds comments to saved template");
00067 }
00068 
00069 
00070 void
00071 SystemFrame::addReportOptions(OptionsCont &oc) {
00072     oc.addOptionSubTopic("Report");
00073 
00074     oc.doRegister("verbose", 'v', new Option_Bool(false));
00075     oc.addDescription("verbose", "Report", "Switches to verbose output");
00076 
00077     oc.doRegister("print-options", 'p', new Option_Bool(false));
00078     oc.addDescription("print-options", "Report", "Prints option values before processing");
00079 
00080     oc.doRegister("help", '?', new Option_Bool(false));
00081     oc.addDescription("help", "Report", "Prints this screen");
00082 
00083     oc.doRegister("suppress-warnings", 'W', new Option_Bool(false));
00084     oc.addDescription("suppress-warnings", "Report", "Disables output of warnings");
00085 
00086     oc.doRegister("log-file", 'l', new Option_FileName());
00087     oc.addDescription("log-file", "Report", "Writes all messages to FILE");
00088 }
00089 
00090 
00091 void
00092 SystemFrame::close() {
00093     // close the xml-subsystem
00094     XMLSubSys::close();
00095     // delete build program options
00096     OptionsCont::getOptions().clear();
00097     // delete messages
00098     MsgHandler::cleanupOnEnd();
00099 }
00100 
00101 
00102 /****************************************************************************/
00103 

Generated on Wed May 5 00:06:37 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6