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

namespace xsde
{
  namespace cxx
  {
    namespace serializer
    {
      inline substitution_map::
      substitution_map (size_t buckets)
          : hashmap (buckets, sizeof (hashmap*)), callback_ (0)
      {
      }

      inline void substitution_map::
      callback (callback_func c)
      {
        callback_ = c;
      }

      inline bool substitution_map::
      check (const char*& ns,
             const char*& name,
             const char* type,
             const void* obj) const
      {
        return !empty () || callback_ != 0
          ? check_ (ns, name, type, obj, true)
          : false;
      }

      inline substitution_map&
      substitution_map_instance ()
      {
        return *substitution_map_init::map;
      }
    }
  }
}