removeRegisteredObject.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) 2013-2016 OpenFOAM Foundation
9  Copyright (C) 2015-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::functionObjects::removeRegisteredObject
29 
30 Group
31  grpUtilitiesFunctionObjects
32 
33 Description
34  Removes registered objects if present in the database.
35 
36 Usage
37  Example of function object specification:
38  \verbatim
39  removeRegisteredObject1
40  {
41  type removeRegisteredObject;
42  libs (utilityFunctionObjects);
43  ...
44  objects (obj1 obj2);
45  }
46  \endverbatim
47 
48  Where the entries comprise:
49  \table
50  Property | Description | Required | Default value
51  type | type name: removeRegisteredObject | yes |
52  objects | objects to remove | yes |
53  \endtable
54 
55 See also
56  Foam::functionObject
57 
58 SourceFiles
59  removeRegisteredObject.C
60 
61 \*---------------------------------------------------------------------------*/
62 
63 #ifndef functionObjects_removeRegisteredObject_H
64 #define functionObjects_removeRegisteredObject_H
65 
66 #include "regionFunctionObject.H"
67 #include "wordList.H"
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 namespace functionObjects
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class removeRegisteredObject Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 class removeRegisteredObject
81 :
82  public regionFunctionObject
83 {
84  // Private Data
85 
86  //- Names of objects to control
87  wordList objectNames_;
88 
89 
90  // Private member functions
91 
92  //- No copy construct
93  removeRegisteredObject(const removeRegisteredObject&) = delete;
94 
95  //- No copy assignment
96  void operator=(const removeRegisteredObject&) = delete;
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("removeRegisteredObject");
103 
104 
105  // Constructors
106 
107  //- Construct from Time and dictionary
109  (
110  const word& name,
111  const Time& runTime,
112  const dictionary& dict
113  );
114 
115 
116  //- Destructor
117  virtual ~removeRegisteredObject() = default;
118 
119 
120  // Member Functions
121 
122  //- Read the removeRegisteredObject data
123  virtual bool read(const dictionary& dict);
124 
125  //- Remove the registered objects
126  virtual bool execute();
127 
128  //- Do nothing
129  virtual bool write();
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace functionObjects
136 } // End namespace Foam
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #endif
141 
142 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::functionObjects::removeRegisteredObject::TypeName
TypeName("removeRegisteredObject")
Runtime type information.
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::functionObjects::removeRegisteredObject::~removeRegisteredObject
virtual ~removeRegisteredObject()=default
Destructor.
wordList.H
Foam::functionObjects::removeRegisteredObject
Removes registered objects if present in the database.
Definition: removeRegisteredObject.H:94
Foam::wordList
List< word > wordList
A List of words.
Definition: fileName.H:62
Foam::functionObjects::removeRegisteredObject::read
virtual bool read(const dictionary &dict)
Read the removeRegisteredObject data.
Definition: removeRegisteredObject.C:70
regionFunctionObject.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::functionObjects::removeRegisteredObject::execute
virtual bool execute()
Remove the registered objects.
Definition: removeRegisteredObject.C:80
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
Foam::List< word >
Foam::functionObjects::removeRegisteredObject::write
virtual bool write()
Do nothing.
Definition: removeRegisteredObject.C:100
Foam::functionObjects::regionFunctionObject
Specialization of Foam::functionObject for a region and providing a reference to the region Foam::obj...
Definition: regionFunctionObject.H:90