Flow123d  jenkins-Flow123d-linux-release-multijob-282
main.h
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2007 Technical University of Liberec. All rights reserved.
4  *
5  * Please make a following refer to Flow123d on your project site if you use the program for any purpose,
6  * especially for academic research:
7  * Flow123d, Research Centre: Advanced Remedial Technologies, Technical University of Liberec, Czech Republic
8  *
9  * This program is free software; you can redistribute it and/or modify it under the terms
10  * of the GNU General Public License version 3 as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along with this program; if not,
17  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 021110-1307, USA.
18  *
19  *
20  * $Id$
21  * $Revision$
22  * $LastChangedBy$
23  * $LastChangedDate$
24  *
25  * @file
26  * @brief ???
27  *
28  */
29 
30 #include <string>
31 #include "input/input_type.hh"
32 #include "input/accessors.hh"
34 
35 using namespace std;
36 
37 #ifndef MAIN_H
38 #define MAIN_H
39 
40 
41 
42 class Application : public ApplicationBase {
43 public:
44  /// Root of the Input::Type tree. Description of whole input structure.
46 
47  /// Application constructor.
48  Application(int argc, char ** argv);
49 
50  /**
51  * Displays program version and build info.
52  * Pass version information to Profiler.
53  *
54  * TODO: Split these two functionalities.
55  */
56  void display_version();
57 
58  /**
59  * Read main input file
60  *
61  * Returns accessor to the root Record.
62  */
63  Input::Record read_input();
64 
65  /// Destructor
66  virtual ~Application();
67 
68 protected:
69 
70  /**
71  * Run application.
72  *
73  * Read input and solve problem.
74  */
75  virtual void run();
76 
77  /**
78  * Check pause_after_run flag defined in input file.
79  */
80  virtual void after_run();
81 
82  /**
83  * Parse command line parameters.
84  * @param[in] argc command line argument count
85  * @param[in] argv command line arguments
86  */
87  virtual void parse_cmd_line(const int argc, char ** argv);
88 
89  /**
90  * Split path to directory (part up to last DIR_SEPARATOR excluded) and filename.
91  * Directory is set to "." if no DIR_SEPARATOR is found.
92  */
93  void split_path(const string& path, string& directory, string& file_name);
94 
95 private:
96 
97  /// directory of main input file (used to resolve relative paths of other input files)
99  /// filename of main input file
101 
103  char ** passed_argv_;
104 
105  /// Description of possible command line arguments.
107 
108  /// If true, we do output of profiling information.
110 
111  /// root input record
113 };
114 
115 
116 
117 
118 #endif
119 
120 //-----------------------------------------------------------------------------
121 // vim: set cindent:
122 
string main_input_filename_
filename of main input file
Definition: main.h:100
bool use_profiler
If true, we do output of profiling information.
Definition: main.h:109
Accessor to the data with type Type::Record.
Definition: accessors.hh:327
string main_input_dir_
directory of main input file (used to resolve relative paths of other input files) ...
Definition: main.h:98
char ** passed_argv_
Definition: main.h:103
int passed_argc_
Definition: main.h:102
static Input::Type::Record input_type
Root of the Input::Type tree. Description of whole input structure.
Definition: main.h:45
string program_arguments_desc_
Description of possible command line arguments.
Definition: main.h:106
Record type proxy class.
Definition: type_record.hh:169
Input::Record root_record
root input record
Definition: main.h:112