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