aboutsummaryrefslogtreecommitdiff
path: root/libxsde/xsde/cxx/parser/validating/inheritance-map.hxx
blob: 0c13d2c65f2e1453ed5e59980e6a01587d43e654 (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
53
54
55
56
57
58
59
60
61
// file      : xsde/cxx/parser/validating/inheritance-map.hxx
// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
// license   : GNU GPL v2 + exceptions; see accompanying LICENSE file

#ifndef XSDE_CXX_PARSER_VALIDATING_INHERITANCE_MAP_HXX
#define XSDE_CXX_PARSER_VALIDATING_INHERITANCE_MAP_HXX

#include <stddef.h> // size_t

#include <xsde/cxx/config.hxx>
#include <xsde/cxx/ro-string.hxx>
#include <xsde/cxx/hashmap.hxx>

namespace xsde
{
  namespace cxx
  {
    namespace parser
    {
      namespace validating
      {
        struct inheritance_map: hashmap
        {
          inheritance_map (size_t buckets);

          void
          insert (const char* derived, const char* base);

          bool
          check (const char* derived, const char* base) const;
        };


        // Translation unit initializer.
        //
        struct inheritance_map_init
        {
          static inheritance_map* map;
          static size_t count;

          inheritance_map_init ();
          ~inheritance_map_init ();
        };

        inline inheritance_map&
        inheritance_map_instance ();

        // Map entry initializer.
        //
        struct inheritance_map_entry
        {
          inheritance_map_entry (const char* derived, const char* base);
        };
      }
    }
  }
}

#include <xsde/cxx/parser/validating/inheritance-map.ixx>

#endif  // XSDE_CXX_PARSER_VALIDATING_INHERITANCE_MAP_HXX