summaryrefslogtreecommitdiff
path: root/libcult/cult/rtti/type-id.hxx
blob: 21494b19c98eb1cc6e76205b320a51c9752507ae (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
48
49
50
51
52
// file      : cult/rtti/type-id.hxx
// author    : Boris Kolpackov <boris@kolpackov.net>
// copyright : Copyright (c) 2005-2010 Boris Kolpackov
// license   : GNU GPL v2 + exceptions; see accompanying LICENSE file

#ifndef CULT_RTTI_TYPE_ID_HXX
#define CULT_RTTI_TYPE_ID_HXX

#include <cult/types/fundamental.hxx>

#include <typeinfo> // std::type_info

namespace Cult
{
  namespace RTTI
  {
    class TypeId
    {
    public:
      template<typename X>
      TypeId (X const volatile&);

      TypeId (std::type_info const&);

    public:
      Char const*
      name () const;

      friend Boolean
      operator== (TypeId const&, TypeId const&);

      friend Boolean
      operator!= (TypeId const&, TypeId const&);

      friend Boolean
      operator< (TypeId const&, TypeId const&);

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

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

#include <cult/rtti/type-id.ixx>
#include <cult/rtti/type-id.txx>

#endif  // CULT_RTTI_TYPE_ID_HXX