Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
typeinfo.hpp
1 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2 
3  This file is part of the Feel library
4 
5  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
6  Date: 2004-10-13
7 
8  Copyright (C) 2009 Université de Grenoble 1
9  Copyright (C) 2004 EPFL, INRIA, Politecnico di Milano
10 
11  This library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU Lesser General Public
13  License as published by the Free Software Foundation; either
14  version 3.0 of the License, or (at your option) any later version.
15 
16  This library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  Lesser General Public License for more details.
20 
21  You should have received a copy of the GNU Lesser General Public
22  License along with this library; if not, write to the Free Software
23  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 */
30 #ifndef __TypeInfo_H
31 #define __TypeInfo_H 1
32 
33 #include <typeinfo>
34 
35 namespace Feel
36 {
47 class TypeInfo
48 {
49 public:
50 
51 
55 
57 
61 
62  TypeInfo();
63  TypeInfo( const std::type_info& ); // non-explicit
64  TypeInfo( TypeInfo const & );
65  ~TypeInfo();
66 
68 
72 
73 
75 
79 
81  const std::type_info& typeInfo() const;
82 
84  const char* name() const;
85 
87 
91 
92 
94 
98 
99 
101  bool before( const TypeInfo& rhs ) const;
102 
103 
105 
106 private:
107 
108  const std::type_info* M_info;
109 };
110 
111 inline bool operator==( const TypeInfo& lhs, const TypeInfo& rhs )
112 {
113  return lhs.typeInfo() == rhs.typeInfo();
114 }
115 
116 inline bool operator<( const TypeInfo& lhs, const TypeInfo& rhs )
117 {
118  return lhs.before( rhs );
119 }
120 
121 inline bool operator!=( const TypeInfo& lhs, const TypeInfo& rhs )
122 {
123  return !( lhs == rhs );
124 }
125 
126 inline bool operator>( const TypeInfo& lhs, const TypeInfo& rhs )
127 {
128  return rhs < lhs;
129 }
130 
131 inline bool operator<=( const TypeInfo& lhs, const TypeInfo& rhs )
132 {
133  return !( lhs > rhs );
134 }
135 
136 inline bool operator>=( const TypeInfo& lhs, const TypeInfo& rhs )
137 {
138  return !( lhs < rhs );
139 }
140 
141 }// end namespace Feel
142 
143 #endif /* __TypeInfo_H */
const std::type_info & typeInfo() const
Access for the wrapped std::type_info.
Definition: typeinfo.cpp:72
wrapper for std::type_info
Definition: typeinfo.hpp:47
bool before(const TypeInfo &rhs) const
Compatibility functions.
Definition: typeinfo.cpp:65
const char * name() const
get the name()
Definition: typeinfo.cpp:79

Generated on Sun Dec 22 2013 13:11:15 for Feel++ by doxygen 1.8.5