source: src/UIElements/CommandLineUI/CommandLineParser.hpp@ bc3411

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 Candidate_v1.7.0 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since bc3411 was e6c470, checked in by Frederik Heber <heber@…>, 14 years ago

Fixing documentation.

  • removed out-dated documentation.
  • removed bugs with doxygen.
  • Property mode set to 100644
File size: 3.3 KB
RevLine 
[c6efc1]1/*
2 * CommandLineParser.hpp
3 *
4 * Created on: May 8, 2010
5 * Author: heber
6 */
7
8#ifndef COMMANDLINEPARSER_HPP_
9#define COMMANDLINEPARSER_HPP_
10
[56f73b]11// include config.h
12#ifdef HAVE_CONFIG_H
13#include <config.h>
14#endif
15
16
[c6efc1]17#include <boost/program_options.hpp>
18
19namespace po = boost::program_options;
20
[ad011c]21#include "CodePatterns/Singleton.hpp"
[e4afb4]22#include "UIElements/CommandLineUI/TypeEnumContainer.hpp"
[c6efc1]23
[e4afb4]24#include <map>
25
26class Action;
[552597]27class CommandLineParser_ActionRegistry_ConsistencyTest;
[e4afb4]28class OptionTrait;
[c6efc1]29
[de8e45]30/** This class is a wrapper for boost::program_options.
31 *
32 */
[bcd072]33class CommandLineParser : public Singleton<CommandLineParser> {
34 friend class Singleton<CommandLineParser>;
[19290f]35
36 //!> test needs to access CmdParserLookup to see whether menus are missing
[552597]37 friend class CommandLineParser_ActionRegistry_ConsistencyTest;
[c6efc1]38public:
39
40 // Parses the command line arguments in CommandLineParser::**argv with currently known options.
[e4afb4]41 void Run(int _argc, char **_argv);
42
43 // Initialises all options from ActionRegistry.
44 void InitializeCommandArguments();
[c6efc1]45
46 // Checks whether there have been any commands on the command line.
47 bool isEmpty();
48
49 /* boost's program_options are sorted into three categories:
50 * -# generic options: option available to both command line and config
51 * -# config options: only available in the config file
52 * -# hidden options: options which the user is not shown on "help"
53 */
[e4afb4]54 po::options_description analysis;
55 po::options_description atom;
56 po::options_description command;
57 po::options_description edit;
58 po::options_description fragmentation;
[d09093]59 po::options_description graph;
[e4afb4]60 po::options_description molecule;
[d09093]61 po::options_description options;
[e4afb4]62 po::options_description parser;
63 po::options_description selection;
64 po::options_description tesselation;
65 po::options_description world;
[c6efc1]66
[e3ecc1a]67 po::options_description visible;
68
[bcd072]69 po::variables_map vm;
[c6efc1]70
[7e6b00]71 // private sequence of actions as they appeared on the command line
72 std::list<std::string> SequenceOfActions;
73
[c6efc1]74private:
[bcd072]75 // private constructor and destructor
76 CommandLineParser();
77 virtual ~CommandLineParser();
78
[c6efc1]79 /* The following program_options options_decriptions are used to
80 * generate the various cases and call differently in Parse().
81 */
82 po::options_description cmdline_options;
83 po::options_description config_file_options;
84
[e4afb4]85 // adds options to the parser
86 void AddOptionToParser(const OptionTrait * const currentOption, po::options_description* OptionList);
87
88 // creates a map from short forms to action tokens needed to parse command line
[2a0a9e3]89 std::map <std::string, std::string> getShortFormToActionMap() const;
[e4afb4]90
[c6e5eb]91 typedef std::map< std::string , po::options_description *> CmdParserLookupMap;
92
[e4afb4]93 // lookup list from "configmenus" to the ones of CommandLineParser
[c6e5eb]94 CmdParserLookupMap CmdParserLookup;
[e4afb4]95
[c6efc1]96 // Sets the options from the three cases.
97 void setOptions(int _argc, char **_argv);
98
99 // Parses all options from command line and config file
100 void Parse();
101
[7e6b00]102 // as boost's program_options does not care about of order of appearance but we do for actions,
103 // we have to have a list and a function to obtain it.
[e4afb4]104 void scanforSequenceOfArguments();
105
106 TypeEnumContainer TypeToEnums;
[7e6b00]107
[c6efc1]108 // argument counter and array passed on from main()
109 int argc;
110 char **argv;
111};
112
113#endif /* COMMANDLINEPARSER_HPP_ */
Note: See TracBrowser for help on using the repository browser.