localIOdictionary.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2015-2020 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::localIOdictionary
26 
27 Description
28  localIOdictionary derived from IOdictionary with global set false to
29  disable parallel master reading.
30 
31  Used to read GeometricFields.
32 
33 SourceFiles
34  localIOdictionary.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef localIOdictionary_H
39 #define localIOdictionary_H
40 
41 #include "IOdictionary.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class localIOdictionary Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 :
54  public IOdictionary
55 {
56 
57 public:
58 
59  // Constructors
60 
61  //- Construct given an IOobject and actual type name
62  localIOdictionary(const IOobject& io);
63 
64  //- Construct given an IOobject and dictionary
65  localIOdictionary(const IOobject&, const dictionary&);
66 
67  //- Construct given an IOobject and actual type name
68  localIOdictionary(const IOobject& io, const word& actualType);
69 
70 
71  // Member Functions
72 
73  //- Is object global
74  virtual bool global() const
75  {
76  return false;
77  }
78 
79  //- Return complete path + object name if the file exists
80  // in the case otherwise null
81  virtual fileName filePath() const
82  {
83  // Use default (local only) search strategy
84  return localFilePath(type());
85  }
86 };
87 
88 
89 //- Template function for obtaining global status
90 template<>
92 {
93  return false;
94 }
95 
96 
97 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
98 
99 } // End namespace Foam
100 
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102 
103 #endif
104 
105 // ************************************************************************* //
virtual bool global() const
Is object global.
A class for handling file names.
Definition: fileName.H:79
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
localIOdictionary derived from IOdictionary with global set false to disable parallel master reading...
fileName localFilePath(const word &typeName) const
Helper for filePath that searches locally.
Definition: IOobject.C:385
A class for handling words, derived from string.
Definition: word.H:59
localIOdictionary(const IOobject &io)
Construct given an IOobject and actual type name.
virtual fileName filePath() const
Return complete path + object name if the file exists.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
Namespace for OpenFOAM.
bool typeGlobal< localIOdictionary >()
Template function for obtaining global status.