diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-03-26 17:09:53 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-03-26 17:09:53 +0200 |
commit | e4c22d3686da0e973e21eae0561c1169c0eeff36 (patch) | |
tree | 0a49e9167edc88938b0287949080931314e8afea /libxsde/xsde/cxx/hybrid/serializer-map.hxx | |
parent | 0d62005a3ff3b62d02c2eb3fd8644e0e19b202e8 (diff) |
Implement support for XML Schema polymorphism in C++/Hybrid
examples/cxx/hybrid/polyroot/
examples/cxx/hybrid/polymorphism/: new examples
tests/cxx/hybrid/polymorphism/: new tests
Diffstat (limited to 'libxsde/xsde/cxx/hybrid/serializer-map.hxx')
-rw-r--r-- | libxsde/xsde/cxx/hybrid/serializer-map.hxx | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/libxsde/xsde/cxx/hybrid/serializer-map.hxx b/libxsde/xsde/cxx/hybrid/serializer-map.hxx new file mode 100644 index 0000000..5e3fb1a --- /dev/null +++ b/libxsde/xsde/cxx/hybrid/serializer-map.hxx @@ -0,0 +1,52 @@ +// file : xsde/cxx/hybrid/serializer-map.hxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSDE_CXX_HYBRID_SERIALIZER_MAP_HXX +#define XSDE_CXX_HYBRID_SERIALIZER_MAP_HXX + +#include <stddef.h> // size_t + +#include <xsde/cxx/serializer/map.hxx> + +namespace xsde +{ + namespace cxx + { + namespace hybrid + { + class serializer_map_impl: public serializer::serializer_map + { + public: + struct entry + { + const char* type_id; + serializer::serializer_base* serializer; + }; + + serializer_map_impl (entry* entries, size_t size) + : entries_ (entries), size_ (size), resetting_ (true) + { + } + + virtual serializer::serializer_base* + find (const void* type_id) const; + + virtual void + reset () const; + + private: + serializer_map_impl (const serializer_map_impl&); + serializer_map_impl& operator= (const serializer_map_impl&); + + private: + entry* entries_; + size_t size_; + bool resetting_; + }; + } + } +} + +#endif // XSDE_CXX_HYBRID_SERIALIZER_MAP_HXX |