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-2018 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 is derived from IOdictionary but excludes parallel
29  master reading.
30 
31 SourceFiles
32  localIOdictionary.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef localIOdictionary_H
37 #define localIOdictionary_H
38 
39 #include "baseIOdictionary.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class localIOdictionary Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 :
52  public baseIOdictionary
53 {
54 
55 public:
56 
57  // Constructors
58 
59  //- Construct given an IOobject
60  localIOdictionary(const IOobject& io);
61 
62  //- Construct given an IOobject and dictionary
63  localIOdictionary(const IOobject& io, const dictionary& dict);
64 
65  //- Construct given an IOobject and Istream
66  localIOdictionary(const IOobject& io, Istream& is);
67 
68  //- Construct given an IOobject, supply wanted typeName
69  localIOdictionary(const IOobject& io, const word& wantedType);
70 
71 
72  //- Destructor
73  virtual ~localIOdictionary();
74 
75 
76  // Member functions
77 
78  //- Is object global
79  virtual bool global() const
80  {
81  return false;
82  }
83 
84  //- Return complete path + object name if the file exists
85  // in the case otherwise null
86  virtual fileName filePath() const
87  {
88  // Use default (local only) search strategy
89  return localFilePath(type());
90  }
91 
92 };
93 
94 
95 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 
97 } // End namespace Foam
98 
99 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
100 
101 #endif
102 
103 // ************************************************************************* //
virtual bool global() const
Is object global.
dictionary dict
A class for handling file names.
Definition: fileName.H:69
baseIOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO function...
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
virtual ~localIOdictionary()
Destructor.
localIOdictionary is derived from IOdictionary but excludes parallel master reading.
fileName localFilePath(const word &typeName) const
Helper for filePath that searches locally.
Definition: IOobject.C:421
A class for handling words, derived from string.
Definition: word.H:59
localIOdictionary(const IOobject &io)
Construct given an IOobject.
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:481
virtual fileName filePath() const
Return complete path + object name if the file exists.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
Namespace for OpenFOAM.