IOOutputFilter.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2012 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 \*---------------------------------------------------------------------------*/
25 
26 #include "IOOutputFilter.H"
27 #include "Time.H"
28 
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 
31 template<class OutputFilter>
33 (
34  const word& outputFilterName,
35  const IOobject& ioDict,
36  const bool readFromFiles
37 )
38 :
39  IOdictionary(ioDict),
40  OutputFilter(outputFilterName, ioDict.db(), *this, readFromFiles)
41 {}
42 
43 
44 template<class OutputFilter>
46 (
47  const word& outputFilterName,
48  const objectRegistry& obr,
49  const word& dictName,
50  const IOobject::readOption rOpt,
51  const bool readFromFiles
52 )
53 :
55  (
56  IOobject
57  (
58  dictName,
59  obr.time().system(),
60  obr,
61  rOpt,
62  IOobject::NO_WRITE
63  )
64  ),
65  OutputFilter(outputFilterName, obr, *this, readFromFiles)
66 {}
67 
68 
69 template<class OutputFilter>
71 (
72  const word& outputFilterName,
73  const objectRegistry& obr,
74  const fileName& dictName,
75  const IOobject::readOption rOpt,
76  const bool readFromFiles
77 )
78 :
80  (
81  IOobject
82  (
83  dictName,
84  obr,
85  rOpt,
86  IOobject::NO_WRITE
87  )
88  ),
89  OutputFilter(outputFilterName, obr, *this, readFromFiles)
90 {}
91 
92 
93 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
94 
95 template<class OutputFilter>
97 {}
98 
99 
100 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
101 
102 template<class OutputFilter>
104 {
105  if (regIOobject::read())
106  {
107  OutputFilter::read(*this);
108  return true;
109  }
110  else
111  {
112  return false;
113  }
114 }
115 
116 
117 template<class OutputFilter>
119 {
121 }
122 
123 
124 // ************************************************************************* //
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::read
bool read(const char *, int32_t &)
Definition: int32IO.C:87
Foam::objectRegistry::time
const Time & time() const
Return time.
Definition: objectRegistry.H:117
IOOutputFilter.H
Foam::IOobject::db
const objectRegistry & db() const
Return the local objectRegistry.
Definition: IOobject.C:239
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:50
Foam::IOOutputFilter::~IOOutputFilter
virtual ~IOOutputFilter()
Destructor.
Definition: IOOutputFilter.C:96
dictName
const word dictName("particleTrackDict")
Foam::TimePaths::system
const word & system() const
Return system name.
Definition: TimePaths.H:120
Foam::IOOutputFilter::read
virtual bool read()
Read output filter properties.
Definition: IOOutputFilter.C:103
Foam::IOOutputFilter::write
virtual void write()
Sample and write.
Definition: IOOutputFilter.C:118
Foam::IOOutputFilter::IOOutputFilter
IOOutputFilter(const IOOutputFilter &)
Foam::IOobject::readOption
readOption
Enumeration defining the read options.
Definition: IOobject.H:106
write
Tcoeff write()