removeRegisteredObject.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) 2013-2019 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::functionObjects::removeRegisteredObject
26 
27 Description
28  Removes registered objects if present in the database.
29 
30  Example of function object specification:
31  \verbatim
32  removeRegisteredObject1
33  {
34  type removeRegisteredObject;
35  libs ("libutilityFunctionObjects.so");
36  ...
37  objects (obj1 obj2);
38  }
39  \endverbatim
40 
41 Usage
42  \table
43  Property | Description | Required | Default value
44  type | type name: removeRegisteredObject | yes |
45  objects | objects to remove | yes |
46  \endtable
47 
48 See also
49  Foam::functionObject
50 
51 SourceFiles
52  removeRegisteredObject.C
53 
54 \*---------------------------------------------------------------------------*/
55 
56 #ifndef functionObjects_removeRegisteredObject_H
57 #define functionObjects_removeRegisteredObject_H
58 
59 #include "functionObject.H"
60 #include "wordList.H"
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 
67 // Forward declaration of classes
68 class objectRegistry;
69 
70 namespace functionObjects
71 {
72 
73 /*---------------------------------------------------------------------------*\
74  Class removeRegisteredObject Declaration
75 \*---------------------------------------------------------------------------*/
76 
77 class removeRegisteredObject
78 :
79  public functionObject
80 {
81  // Private Data
82 
83  //- Reference to the objectRegistry
84  const objectRegistry& obr_;
85 
86  //- Names of objects to control
87  wordList objectNames_;
88 
89 
90 public:
91 
92  //- Runtime type information
93  TypeName("removeRegisteredObject");
94 
95 
96  // Constructors
97 
98  //- Construct from Time and dictionary
100  (
101  const word& name,
102  const Time& runTime,
103  const dictionary& dict
104  );
105 
106  //- Disallow default bitwise copy construction
108 
109 
110  //- Destructor
111  virtual ~removeRegisteredObject();
112 
113 
114  // Member Functions
115 
116  //- Read the removeRegisteredObject data
117  virtual bool read(const dictionary&);
118 
119  //- Remove the registered objects
120  virtual bool execute();
121 
122  //- Do nothing
123  virtual bool write();
124 
125 
126  // Member Operators
127 
128  //- Disallow default bitwise assignment
129  void operator=(const removeRegisteredObject&) = delete;
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace functionObjects
136 } // End namespace Foam
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #endif
141 
142 // ************************************************************************* //
void operator=(const removeRegisteredObject &)=delete
Disallow default bitwise assignment.
dictionary dict
const word & name() const
Return the name of this functionObject.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
Removes registered objects if present in the database.
virtual bool execute()
Remove the registered objects.
engineTime & runTime
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
virtual bool read(const dictionary &)
Read the removeRegisteredObject data.
A class for handling words, derived from string.
Definition: word.H:59
List< word > wordList
A List of words.
Definition: fileName.H:54
TypeName("removeRegisteredObject")
Runtime type information.
Namespace for OpenFOAM.
removeRegisteredObject(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.