source: trunk/yat/utility/TypeInfo.h @ 865

Last change on this file since 865 was 865, checked in by Peter, 14 years ago

changing URL to http://trac.thep.lu.se/trac/yat

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.0 KB
Line 
1#ifndef _theplu_yat_utility_type_info_
2#define _theplu_yat_utility_type_info_
3
4// $Id: TypeInfo.h 865 2007-09-10 19:41:04Z peter $
5
6/*
7  Copyright (C) 2007 Peter Johansson
8
9  This file is part of the yat library, http://trac.thep.lu.se/trac/yat
10
11  The yat library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 2 of the
14  License, or (at your option) any later version.
15
16  The yat 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  General Public License for more details.
20
21  You should have received a copy of the GNU General Public License
22  along with this program; if not, write to the Free Software
23  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24  02111-1307, USA.
25*/
26
27#include <string>
28#include <typeinfo>
29
30namespace theplu {
31namespace yat {
32namespace utility {
33
34  /**
35     @brief Wrapper class for storing std::type_info
36  */
37  class TypeInfo
38  {
39  public:
40    /**
41       @brief Constructor
42    */
43    // For STL container usage
44    TypeInfo(void);
45
46    /**
47       @brief Constructor
48    */
49    TypeInfo(const std::type_info&);
50
51    /**
52     */
53    const std::type_info& get(void) const;
54
55    /**
56       \return name of type
57     */
58    std::string name(void) const;
59
60    /**
61       @brief assignment operator
62    */
63    TypeInfo& operator=(const TypeInfo&);
64
65  private:
66    // Using compiler generated copy constructor
67    // TypeInfo(const TypeInfo&);
68    // Using compiler generated assignment operator
69    // TypeInfo(const TypeInfo&);
70
71    const std::type_info* info_;
72  };
73
74  bool operator==(const TypeInfo&, const TypeInfo&);
75  bool operator!=(const TypeInfo&, const TypeInfo&);
76  bool operator<(const TypeInfo&, const TypeInfo&);
77  bool operator<=(const TypeInfo&, const TypeInfo&);
78  bool operator>(const TypeInfo&, const TypeInfo&);
79  bool operator>=(const TypeInfo&, const TypeInfo&);
80
81}}} // of namespace utility, yat, and theplu
82
83#endif
Note: See TracBrowser for help on using the repository browser.