tableReader.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) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::tableReader
28 
29 Description
30  Base class to read table data for the interpolationTable
31 
32 SourceFiles
33  tableReader.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef tableReader_H
38 #define tableReader_H
39 
40 #include "fileName.H"
41 #include "wordList.H"
42 #include "vector.H"
43 #include "tensor.H"
44 #include "typeInfo.H"
45 #include "runTimeSelectionTables.H"
46 #include "autoPtr.H"
47 #include "dictionary.H"
48 #include "Tuple2.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class tableReader Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class Type>
60 class tableReader
61 {
62 
63 public:
64 
65  //- Runtime type information
66  TypeName("tableReader");
67 
68  // Declare run-time constructor selection table
69 
71  (
72  autoPtr,
74  dictionary,
75  (const dictionary& dict),
76  (dict)
77  );
78 
79 
80  // Constructors
81 
82  //- Construct from dictionary
83  tableReader(const dictionary& dict);
84 
85  //- Construct and return a clone
86  virtual autoPtr<tableReader<Type>> clone() const = 0;
87 
88 
89  // Selectors
90 
91  //- Return a reference to the selected tableReader
92  static autoPtr<tableReader> New(const dictionary& spec);
93 
94 
95  //- Destructor
96  virtual ~tableReader();
97 
98 
99  // Member functions
100 
101  //- Read the table
102  virtual void operator()
103  (
104  const fileName&,
106  ) = 0;
107 
108  //- Read the 2D table
109  virtual void operator()
110  (
111  const fileName&,
113  ) = 0;
114 
115  //- Write additional information
116  virtual void write(Ostream& os) const;
117 };
118 
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 } // End namespace Foam
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #ifdef NoRepository
127  #include "tableReader.C"
128 #endif
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #endif
134 
135 // ************************************************************************* //
tableReader.C
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
typeInfo.H
Tuple2.H
Foam::tableReader
Base class to read table data for the interpolationTable.
Definition: tableReader.H:59
Foam::tableReader::tableReader
tableReader(const dictionary &dict)
Construct from dictionary.
Definition: tableReader.C:65
Foam::tableReader::TypeName
TypeName("tableReader")
Runtime type information.
tensor.H
wordList.H
Foam::tableReader::~tableReader
virtual ~tableReader()
Destructor.
Definition: tableReader.C:72
fileName.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::tableReader::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, tableReader, dictionary,(const dictionary &dict),(dict))
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:102
dictionary.H
Foam::tableReader::write
virtual void write(Ostream &os) const
Write additional information.
Definition: tableReader.C:79
vector.H
Foam::tableReader::clone
virtual autoPtr< tableReader< Type > > clone() const =0
Construct and return a clone.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::tableReader::New
static autoPtr< tableReader > New(const dictionary &spec)
Return a reference to the selected tableReader.
Definition: tableReader.C:35
autoPtr.H