Orxonox  0.0.5 Codename: Arcturus
CommandLineIncludes.h
Go to the documentation of this file.
1 /*
2  * ORXONOX - the hottest 3D action shooter ever to exist
3  * > www.orxonox.net <
4  *
5  *
6  * License notice:
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  * Author:
23  * Reto Grieder
24  * Co-authors:
25  * ...
26  *
27  */
28 
40 #ifndef _CommandLineIncludes_H__
41 #define _CommandLineIncludes_H__
42 
43 #include "core/CorePrereqs.h"
44 
45 #include "CommandLineParser.h"
47 
48 #define SetCommandLineArgument(name, defaultValue) \
49  orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
50  = (new orxonox::SI_CLA(new orxonox::CommandLineArgument(#name, defaultValue)))->getArgument()
51 #define SetCommandLineSwitch(name) \
52  SetCommandLineArgument(name, false)
53 
54 namespace orxonox
55 {
57  {
58  public:
61  , argument_(argument)
62  {}
64 
65  virtual void load() override
66  { CommandLineParser::addArgument(this->argument_); }
67 
68  virtual void unload() override
69  { CommandLineParser::removeArgument(this->argument_); }
70 
72  { return *this->argument_; }
73 
74  private:
76  };
77 
79 }
80 
81 #endif /* _CommandLineIncludes_H__ */
static constexpr Type COMMAND_LINE_ARGUMENT
Definition: CorePrereqs.h:96
StaticallyInitializedCommandLineArgument(CommandLineArgument *argument)
Definition: CommandLineIncludes.h:59
Shared library macros, enums, constants and forward declarations for the core library ...
~StaticallyInitializedCommandLineArgument()
Definition: CommandLineIncludes.h:63
virtual void unload() override
Definition: CommandLineIncludes.h:68
CommandLineArgument & getArgument()
Definition: CommandLineIncludes.h:71
Definition: CommandLineIncludes.h:56
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Definition: StaticallyInitializedInstance.h:36
#define _CoreExport
Definition: CorePrereqs.h:61
static void addArgument(CommandLineArgument *argument)
Adds a new CommandLineArgument to the internal map.
Definition: CommandLineParser.cc:316
virtual void load() override
Definition: CommandLineIncludes.h:65
CommandLineArgument * argument_
Definition: CommandLineIncludes.h:75
static void removeArgument(CommandLineArgument *argument)
Removes a CommandLineArgument from the internal map.
Definition: CommandLineParser.cc:330
Declaration of CommandLineParser and CommandLineArgument, definition of the SetCommandLineArgument() ...
Container class for a command line argument of any type supported by MultiType.
Definition: CommandLineParser.h:65
StaticallyInitializedCommandLineArgument SI_CLA
Definition: CommandLineIncludes.h:78