| 79 | template<class Mesh, template<class> class MeshObjectType, class Type> |
| 80 | template<class Data1> |
| 81 | const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New |
| 82 | ( |
| 83 | const Mesh& mesh, |
| 84 | const Data1& d |
| 85 | ) |
| 86 | { |
| 87 | if |
| 88 | ( |
| 89 | mesh.thisDb().objectRegistry::template foundObject<Type> |
| 90 | ( |
| 91 | Type::typeName |
| 92 | ) |
| 93 | ) |
| 94 | { |
| 95 | return mesh.thisDb().objectRegistry::template lookupObject<Type> |
| 96 | ( |
| 97 | Type::typeName |
| 98 | ); |
| 99 | } |
| 100 | else |
| 101 | { |
| 102 | if (meshObject::debug) |
| 103 | { |
| 104 | Pout<< "MeshObject::New(const " << Mesh::typeName |
| 105 | << "&, const Data1&) : constructing " << Type::typeName |
| 106 | << " for region " << mesh.name() << endl; |
| 107 | } |
| 108 | |
| 109 | Type* objectPtr = new Type(mesh, d); |
| 110 | |
| 111 | regIOobject::store(static_cast<MeshObjectType<Mesh>*>(objectPtr)); |
| 112 | |
| 113 | return *objectPtr; |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | |
| 118 | template<class Mesh, template<class> class MeshObjectType, class Type> |
no test coverage detected