LifeV
FactoryTypeInfo.cpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4 
5 Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6 Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8 This file is part of LifeV.
9 
10 LifeV is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation, either version 3 of the License, or
13 (at your option) any later version.
14 
15 LifeV is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23 *******************************************************************************
24 */
25 //@HEADER
26 /*!
27  @file
28  @brief Type information class
29 
30  @date 13-10-2004
31  @author Christophe Prud'homme <christophe.prudhomme@epfl.ch>
32 
33  @maintainer Radu Popescu <radu.popescu@epfl.ch>
34 */
35 
36 #include <cassert>
37 
38 #include <lifev/core/LifeV.hpp>
39 #include <lifev/core/util/FactoryTypeInfo.hpp>
40 
41 namespace LifeV
42 {
43 
44 // ===============================
45 // Constructors and Destructor
46 // ===============================
47 
49 {
50  class Nil {};
51  M_info = &typeid (Nil);
52  assert ( M_info != 0 );
53 
54 }
55 
56 FactoryTypeInfo::FactoryTypeInfo (const std::type_info& ti) :
57  M_info (&ti)
58 {
59  assert ( M_info != 0 );
60 }
61 
63  M_info ( ti.M_info )
64 {
65  assert ( M_info != 0 );
66 }
67 
69 {
70 }
71 
72 // ===============================
73 // Public methods
74 // ===============================
75 
76 bool
78 {
79  assert ( M_info != 0 );
80  return M_info->before (*rhs.M_info);
81 }
82 
83 // ======================
84 // Get methods
85 // ======================
86 
87 const std::type_info&
89 {
90  assert ( M_info != 0 );
91  return *M_info;
92 }
93 
94 const char*
96 {
97  assert ( M_info != 0 );
98  return M_info->name();
99 }
100 
101 }
FactoryTypeInfo(FactoryTypeInfo const &)
const std::type_info * M_info
void updateInverseJacobian(const UInt &iQuadPt)
const char * name() const
get the name()
const std::type_info & typeInfo() const
Access for the wrapped std::type_info.
bool before(const FactoryTypeInfo &rhs) const
Compatibility functions.
FactoryTypeInfo(const std::type_info &)