aboutsummaryrefslogtreecommitdiff
path: root/libxsde/xsde/cxx/hybrid/parser-map.hxx
blob: 99ae593473ac7def64aae184a6c99d8e74c68d74 (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
// file      : xsde/cxx/hybrid/parser-map.hxx
// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
// license   : GNU GPL v2 + exceptions; see accompanying LICENSE file

#ifndef XSDE_CXX_HYBRID_PARSER_MAP_HXX
#define XSDE_CXX_HYBRID_PARSER_MAP_HXX

#include <stddef.h> // size_t

#include <xsde/cxx/parser/map.hxx>

namespace xsde
{
  namespace cxx
  {
    namespace hybrid
    {
      class parser_map_impl: public parser::parser_map
      {
      public:
        struct entry
        {
          const char* type_id;
          parser::parser_base* parser;
        };

        parser_map_impl (entry* entries, size_t size)
            : entries_ (entries), size_ (size), resetting_ (false)
        {
        }

        virtual parser::parser_base*
        find (const char* type_id) const;

        virtual void
        reset () const;

      private:
        parser_map_impl (const parser_map_impl&);
        parser_map_impl& operator= (const parser_map_impl&);

      private:
        entry* entries_;
        size_t size_;
        bool resetting_;
      };
    }
  }
}

#endif // XSDE_CXX_HYBRID_PARSER_MAP_HXX