LifeV
FactoryTypeInfo.hpp
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 #ifndef FACTORY_TYPE_INFO_H
37 #define FACTORY_TYPE_INFO_H 1
38 
39 #include <typeinfo>
40 
41 namespace LifeV
42 {
43 
45 {
46 public:
47  //! @name Constructors, destructor
48  //@{
50  FactoryTypeInfo (const std::type_info&); // non-explicit
52  virtual ~FactoryTypeInfo();
53  //@}
54 
55  //! @name Methods
56  //@{
57  //! Compatibility functions
58  bool before (const FactoryTypeInfo& rhs) const;
59  //@}
60 
61  //! @name Get methods
62  //@{
63  //! Access for the wrapped \c std::type_info
64  const std::type_info& typeInfo() const;
65  //! get the \c name()
66  const char* name() const;
67  //@}
68 private:
69  const std::type_info* M_info;
70 };
71 
72 inline bool operator== (const FactoryTypeInfo& lhs, const FactoryTypeInfo& rhs)
73 {
74  return lhs.typeInfo() == rhs.typeInfo();
75 }
76 
77 inline bool operator< (const FactoryTypeInfo& lhs, const FactoryTypeInfo& rhs)
78 {
79  return lhs.before (rhs);
80 }
81 
82 inline bool operator!= (const FactoryTypeInfo& lhs, const FactoryTypeInfo& rhs)
83 {
84  return ! (lhs == rhs);
85 }
86 
87 inline bool operator> (const FactoryTypeInfo& lhs, const FactoryTypeInfo& rhs)
88 {
89  return rhs < lhs;
90 }
91 
92 inline bool operator<= (const FactoryTypeInfo& lhs, const FactoryTypeInfo& rhs)
93 {
94  return ! (lhs > rhs);
95 }
96 
97 inline bool operator>= (const FactoryTypeInfo& lhs, const FactoryTypeInfo& rhs)
98 {
99  return ! (lhs < rhs);
100 }
101 
102 } // Namespace LifeV
103 
104 #endif // FACTORY_TYPE_INFO_H
bool operator!=(const FactoryTypeInfo &lhs, const FactoryTypeInfo &rhs)
bool operator<=(const FactoryTypeInfo &lhs, const FactoryTypeInfo &rhs)
FactoryTypeInfo(FactoryTypeInfo const &)
const std::type_info * M_info
void updateInverseJacobian(const UInt &iQuadPt)
bool operator>=(const FactoryTypeInfo &lhs, const FactoryTypeInfo &rhs)
const char * name() const
get the name()
bool operator==(const FactoryTypeInfo &lhs, const FactoryTypeInfo &rhs)
bool operator<(const FactoryTypeInfo &lhs, const FactoryTypeInfo &rhs)
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 &)
bool operator>(const FactoryTypeInfo &lhs, const FactoryTypeInfo &rhs)