aboutsummaryrefslogtreecommitdiff
path: root/libxsde/xsde/cxx/parser/map.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'libxsde/xsde/cxx/parser/map.ixx')
-rw-r--r--libxsde/xsde/cxx/parser/map.ixx41
1 files changed, 41 insertions, 0 deletions
diff --git a/libxsde/xsde/cxx/parser/map.ixx b/libxsde/xsde/cxx/parser/map.ixx
new file mode 100644
index 0000000..3a1f931
--- /dev/null
+++ b/libxsde/xsde/cxx/parser/map.ixx
@@ -0,0 +1,41 @@
+// file : xsde/cxx/parser/map.ixx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC
+// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+namespace xsde
+{
+ namespace cxx
+ {
+ namespace parser
+ {
+#ifndef XSDE_EXCEPTIONS
+ inline parser_map_impl::error parser_map_impl::
+ _error () const
+ {
+ return map_._error () ? error_no_memory : error_none;
+ }
+#endif
+
+ inline parser_map_impl::
+ parser_map_impl (size_t buckets)
+ : map_ (buckets, sizeof (parser_base*))
+ {
+ }
+
+ inline void parser_map_impl::
+ insert (parser_base& p)
+ {
+ parser_base* tmp = &p;
+ map_.insert (p._dynamic_type (), &tmp);
+ }
+
+ inline parser_base* parser_map_impl::
+ find (const char* type) const
+ {
+ const void* p = map_.find (type);
+ return p ? *static_cast<parser_base* const*> (p) : 0;
+ }
+ }
+ }
+}