SUMO - Simulation of Urban MObility
SystemFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 // A set of actions common to all applications
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "SystemFrame.h"
34 #include <string>
35 #include <utils/xml/XMLSubSys.h>
39 #include "RandHelper.h"
40 
41 #ifdef CHECK_MEMORY_LEAKS
42 #include <foreign/nvwa/debug_new.h>
43 #endif // CHECK_MEMORY_LEAKS
44 
45 
46 // ===========================================================================
47 // method definitions
48 // ===========================================================================
49 void
51  oc.addOptionSubTopic("Configuration");
52 
53  oc.doRegister("configuration-file", 'c', new Option_FileName());
54  oc.addSynonyme("configuration-file", "configuration");
55  oc.addDescription("configuration-file", "Configuration", "Loads the named config on startup");
56 
57  oc.doRegister("save-configuration", new Option_FileName());
58  oc.addSynonyme("save-config", "save-configuration");
59  oc.addDescription("save-configuration", "Configuration", "Saves current configuration into FILE");
60 
61  oc.doRegister("save-template", new Option_FileName());
62  oc.addDescription("save-template", "Configuration", "Saves a configuration template (empty) into FILE");
63 
64  oc.doRegister("save-schema", new Option_FileName());
65  oc.addDescription("save-schema", "Configuration", "Saves the configuration schema into FILE");
66 
67  oc.doRegister("save-commented", new Option_Bool(false));
68  oc.addSynonyme("save-commented", "save-template.commented");
69  oc.addDescription("save-commented", "Configuration", "Adds comments to saved template, configuration, or schema");
70 }
71 
72 
73 void
75  oc.addOptionSubTopic("Report");
76 
77  oc.doRegister("verbose", 'v', new Option_Bool(false));
78  oc.addDescription("verbose", "Report", "Switches to verbose output");
79 
80  oc.doRegister("print-options", new Option_Bool(false));
81  oc.addDescription("print-options", "Report", "Prints option values before processing");
82 
83  oc.doRegister("help", '?', new Option_Bool(false));
84  oc.addDescription("help", "Report", "Prints this screen");
85 
86  oc.doRegister("version", 'V', new Option_Bool(false));
87  oc.addDescription("version", "Report", "Prints the current version");
88 
89  oc.doRegister("xml-validation", 'X', new Option_String("auto"));
90  oc.addDescription("xml-validation", "Report", "Set schema validation scheme of XML inputs (\"never\", \"auto\" or \"always\")");
91 
92  oc.doRegister("xml-validation.net", new Option_String("never"));
93  oc.addDescription("xml-validation.net", "Report", "Set schema validation scheme of SUMO network inputs (\"never\", \"auto\" or \"always\")");
94 
95  oc.doRegister("no-warnings", 'W', new Option_Bool(false));
96  oc.addSynonyme("no-warnings", "suppress-warnings", true);
97  oc.addDescription("no-warnings", "Report", "Disables output of warnings");
98 
99  oc.doRegister("log", 'l', new Option_FileName());
100  oc.addSynonyme("log", "log-file");
101  oc.addDescription("log", "Report", "Writes all messages to FILE (implies verbose)");
102 
103  oc.doRegister("message-log", new Option_FileName());
104  oc.addDescription("message-log", "Report", "Writes all non-error messages to FILE (implies verbose)");
105 
106  oc.doRegister("error-log", new Option_FileName());
107  oc.addDescription("error-log", "Report", "Writes all warnings and errors to FILE");
108 
109  oc.doRegister("output-prefix", new Option_String());
110  oc.addDescription("output-prefix", "Output", "Prefix which is applied to all output files. The special string 'TIME' is replaced by the current time.");
111 }
112 
113 
114 void
116  // close all output devices
118  // close the xml-subsystem
120  // delete build program options
122  // delete messages
124 }
125 
126 
127 /****************************************************************************/
128 
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
Definition: OptionsCont.cpp:86
static void close()
Closes the xml-subsystem.
Definition: XMLSubSys.cpp:92
static void addReportOptions(OptionsCont &oc)
Adds reporting options to the given container.
Definition: SystemFrame.cpp:74
static void close()
Closes all of an applications subsystems.
static void addConfigurationOptions(OptionsCont &oc)
Adds configuration options to the given container.
Definition: SystemFrame.cpp:50
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:69
void addSynonyme(const std::string &name1, const std::string &name2, bool isDeprecated=false)
Adds a synonyme for an options name (any order)
void clear()
Removes all information from the container.
static void cleanupOnEnd()
Removes pending handler.
Definition: MsgHandler.cpp:242
static void closeAll()
void addOptionSubTopic(const std::string &topic)
Adds an option subtopic.
A storage for options typed value containers)
Definition: OptionsCont.h:108
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.