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-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::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  // Private member functions
91 
92  //- Disallow default bitwise copy construct
94 
95  //- Disallow default bitwise assignment
96  void operator=(const removeRegisteredObject&);
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();
118 
119 
120  // Member Functions
121 
122  //- Read the removeRegisteredObject data
123  virtual bool read(const dictionary&);
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 // ************************************************************************* //
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:137
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.