summaryrefslogtreecommitdiff
path: root/contrib/utility/Utility/Introspection/TypeId.hpp
blob: 51f66f99a0bba5f178606fd6164b9162385e0249 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// file      : Utility/Introspection/TypeId.hpp
// author    : Boris Kolpackov <boris@kolpackov.net>
// copyright : Copyright (c) 2002-2003 Boris Kolpackov
// license   : http://kolpackov.net/license.html

#ifndef UTILITY_INTROSPECTION_TYPE_ID_HPP
#define UTILITY_INTROSPECTION_TYPE_ID_HPP

#include <typeinfo>
#include <iosfwd>

namespace Utility
{
  namespace Introspection
  {
    class TypeId
    {
    public:
      template<typename T>
      TypeId (T const& t);

      TypeId (std::type_info const& tid);

    public:
      bool
      operator == (TypeId const& other) const;

      bool
      operator != (TypeId const& other) const;

      bool
      operator < (TypeId const& other) const;

      friend std::ostream&
      operator << (std::ostream& os, TypeId const& t);

    private:
      std::type_info const* tid_;
    };
  }
}

#include "Utility/Introspection/TypeId.tpp"
#include "Utility/Introspection/TypeId.ipp"

#endif  // UTILITY_INTROSPECTION_TYPE_ID_HPP
//$Id$