Loading...
Searching...
No Matches
fileOperationInitialise.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) 2017-2018 OpenFOAM Foundation
9 Copyright (C) 2023 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::fileOperationInitialise
29
30Description
31 General fileOperation initialiser.
32 Handles \c -ioRanks option, using it to set the FOAM_IORANKS environment
33 variable.
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef Foam_fileOperations_fileOperationInitialise_H
38#define Foam_fileOperations_fileOperationInitialise_H
39
41
42// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44namespace Foam
45{
47{
48
49/*---------------------------------------------------------------------------*\
50 Class fileOperationInitialise Declaration
51\*---------------------------------------------------------------------------*/
52
54{
55public:
56
57 //- Runtime type information
58 TypeName("fileOperationInitialise");
59
60
61 // Constructors
62
63 //- Construct from components
64 fileOperationInitialise(int& argc, char**& argv);
65
67 // Declare run-time constructor selection table
68
70 (
71 autoPtr,
73 word,
74 (
75 int& argc, char**& argv
76 ),
77 (argc, argv)
78 );
79
80
81 // Selectors
82
83 //- Select initialisation type
85 (
86 const word& type, int& argc, char**& argv
87 );
88
89
90 //- Destructor
91 virtual ~fileOperationInitialise() = default;
93
94 // Member Functions
95
96 //- Requires (MPI) threading?
97 virtual bool needsThreading() const = 0;
98};
99
101/*---------------------------------------------------------------------------*\
102 Class fileOperationInitialise_unthreaded Declaration
103\*---------------------------------------------------------------------------*/
104
105//- A fileOperation initialiser for unthreaded file handlers.
107:
109{
110public:
112 // Constructors
113
114 //- Construct from components
115 fileOperationInitialise_unthreaded(int& argc, char**& argv)
116 :
117 fileOperationInitialise(argc, argv)
118 {}
119
120
121 //- Destructor
123
124
125 // Member Functions
126
127 //- No (MPI) threading required
128 virtual bool needsThreading() const { return false; }
129};
130
132// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133
134} // End namespace fileOperations
135} // End namespace Foam
136
137// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138
139#endif
140
141// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A fileOperation initialiser for unthreaded file handlers.
fileOperationInitialise_unthreaded(int &argc, char **&argv)
Construct from components.
virtual ~fileOperationInitialise_unthreaded()=default
Destructor.
virtual bool needsThreading() const
No (MPI) threading required.
virtual ~fileOperationInitialise()=default
Destructor.
declareRunTimeSelectionTable(autoPtr, fileOperationInitialise, word,(int &argc, char **&argv),(argc, argv))
static autoPtr< fileOperationInitialise > New(const word &type, int &argc, char **&argv)
Select initialisation type.
TypeName("fileOperationInitialise")
Runtime type information.
virtual bool needsThreading() const =0
Requires (MPI) threading?
fileOperationInitialise(int &argc, char **&argv)
Construct from components.
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for implementations of a fileOperation.
Definition regIOobject.H:60
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).
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68