yat  0.10.4pre
TypeInfo.h
1 #ifndef _theplu_yat_utility_type_info_
2 #define _theplu_yat_utility_type_info_
3 
4 // $Id: TypeInfo.h 2119 2009-12-12 23:11:43Z peter $
5 
6 /*
7  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
8  Copyright (C) 2009 Peter Johansson
9 
10  This file is part of the yat library, http://dev.thep.lu.se/yat
11 
12  The yat library is free software; you can redistribute it and/or
13  modify it under the terms of the GNU General Public License as
14  published by the Free Software Foundation; either version 3 of the
15  License, or (at your option) any later version.
16 
17  The yat library is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with yat. If not, see <http://www.gnu.org/licenses/>.
24 */
25 
26 #include <string>
27 #include <typeinfo>
28 
29 namespace theplu {
30 namespace yat {
31 namespace utility {
32 
36  class TypeInfo
37  {
38  public:
42  // For STL container usage
43  TypeInfo(void);
44 
48  // For convenience we allow implicit conversion from type_info to
49  // TypeInfo.
50  TypeInfo(const std::type_info&);
51 
55  const std::type_info& get(void) const;
56 
60  std::string name(void) const;
61 
65  TypeInfo& operator=(const TypeInfo&);
66 
67  private:
68  // Using compiler generated copy constructor
69  // TypeInfo(const TypeInfo&);
70  // Using compiler generated assignment operator
71  // TypeInfo(const TypeInfo&);
72 
73  const std::type_info* info_;
74  };
75 
82  bool operator==(const TypeInfo&, const TypeInfo&);
83 
89  bool operator!=(const TypeInfo&, const TypeInfo&);
90 
97  bool operator<(const TypeInfo& lhs, const TypeInfo& rhs);
98 
104  bool operator<=(const TypeInfo&, const TypeInfo&);
105 
111  bool operator>(const TypeInfo&, const TypeInfo&);
112 
118  bool operator>=(const TypeInfo&, const TypeInfo&);
119 
120 }}} // of namespace utility, yat, and theplu
121 
122 #endif

Generated on Mon Nov 11 2013 09:41:44 for yat by  doxygen 1.8.1