helpType.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::helpType
26 
27 Description
28  Base class for foam help classes
29 
30 SourceFiles
31  helpType.C
32  helpTypeNew.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef helpType_H
37 #define helpType_H
38 
39 #include "runTimeSelectionTables.H"
40 #include "autoPtr.H"
41 #include "argList.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // forward declaration of classes
49 
50 class fvMesh;
51 
52 /*---------------------------------------------------------------------------*\
53  Class helpType Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class helpType
57 {
58 
59 protected:
60 
61  //- Return file path to the Doxygen sources (if available)
62  fileName doxygenPath() const;
63 
64  //- Display the list of documentation options
66  (
67  const string& searchStr,
68  const bool exactMatch
69  ) const;
70 
71  //- Display the help documentation in a browser
72  void displayDoc
73  (
74  const word& className,
75  const string& searchStr,
76  const bool exactMatch
77  ) const;
78 
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("helpType");
84 
85  // Declare runtime constructor selection table
87  (
88  autoPtr,
89  helpType,
90  dictionary,
91  (),
92  ()
93  );
94 
95 
96  //- Constructor
97  helpType();
98 
99  //- Selector
100  static autoPtr<helpType> New(const word& helpTypeName);
101 
102  //- Destructor
103  virtual ~helpType();
104 
105 
106  // Member Functions
107 
108  //- Initialise - typically setting static variables,
109  // e.g. command line arguments
110  virtual void init();
111 
112  //- Execute the help
113  virtual void execute(const argList& args, const fvMesh& mesh) = 0;
114 };
115 
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 } // End namespace Foam
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
A class for handling file names.
Definition: fileName.H:69
fileName doxygenPath() const
Return file path to the Doxygen sources (if available)
void displayDocOptions(const string &searchStr, const bool exactMatch) const
Display the list of documentation options.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
helpType()
Constructor.
virtual void execute(const argList &args, const fvMesh &mesh)=0
Execute the help.
static autoPtr< helpType > New(const word &helpTypeName)
Selector.
virtual ~helpType()
Destructor.
TypeName("helpType")
Runtime type information.
Base class for foam help classes.
Definition: helpType.H:55
dynamicFvMesh & mesh
A class for handling words, derived from string.
Definition: word.H:59
Extract command arguments and options from the supplied argc and argv parameters. ...
Definition: argList.H:102
declareRunTimeSelectionTable(autoPtr, helpType, dictionary,(),())
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
void displayDoc(const word &className, const string &searchStr, const bool exactMatch) const
Display the help documentation in a browser.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Macros to ease declaration of run-time selection tables.
Foam::argList args(argc, argv)
virtual void init()
Initialise - typically setting static variables,.
Namespace for OpenFOAM.