1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "MeshObject.H"
27 #include "objectRegistry.H"
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 template<class Mesh, class Type>
32 Foam::MeshObject<Mesh, Type>::MeshObject(const Mesh& mesh)
39 mesh.thisDb().instance(),
47 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
49 template<class Mesh, class Type>
50 const Type& Foam::MeshObject<Mesh, Type>::New
57 mesh.thisDb().objectRegistry::template foundObject<Type>
63 return mesh.thisDb().objectRegistry::template lookupObject<Type>
70 return store(new Type(mesh));
75 template<class Mesh, class Type>
77 const Type& Foam::MeshObject<Mesh, Type>::New
85 mesh.thisDb().objectRegistry::template foundObject<Type>
91 return mesh.thisDb().objectRegistry::template lookupObject<Type>
98 return store(new Type(mesh, d));
103 template<class Mesh, class Type>
104 template<class Data1, class Data2>
105 const Type& Foam::MeshObject<Mesh, Type>::New
114 mesh.thisDb().objectRegistry::template foundObject<Type>
120 return mesh.thisDb().objectRegistry::template lookupObject<Type>
127 return store(new Type(mesh, d1, d2));
132 template<class Mesh, class Type>
133 template<class Data1, class Data2, class Data3>
134 const Type& Foam::MeshObject<Mesh, Type>::New
144 mesh.thisDb().objectRegistry::template foundObject<Type>
150 return mesh.thisDb().objectRegistry::template lookupObject<Type>
157 return store(new Type(mesh, d1, d2, d3));
162 template<class Mesh, class Type>
163 template<class Data1, class Data2, class Data3, class Data4>
164 const Type& Foam::MeshObject<Mesh, Type>::New
175 mesh.thisDb().objectRegistry::template foundObject<Type>
181 return mesh.thisDb().objectRegistry::template lookupObject<Type>
188 return store(new Type(mesh, d1, d2, d3, d4));
193 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
195 template<class Mesh, class Type>
196 bool Foam::MeshObject<Mesh, Type>::Delete(const Mesh& mesh)
200 mesh.thisDb().objectRegistry::template foundObject<Type>
206 return mesh.thisDb().checkOut
210 mesh.thisDb().objectRegistry::template lookupObject<Type>
224 template<class Mesh, class Type>
225 Foam::MeshObject<Mesh, Type>::~MeshObject()
231 // ************************************************************************* //