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