From 8286ac511144e4f17d34eac9affb97e50646344a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 23 Jul 2014 15:25:44 +0200 Subject: Imported Upstream version 4.0.0 --- libcutl/cutl/compiler/type-info.hxx | 111 ++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 libcutl/cutl/compiler/type-info.hxx (limited to 'libcutl/cutl/compiler/type-info.hxx') diff --git a/libcutl/cutl/compiler/type-info.hxx b/libcutl/cutl/compiler/type-info.hxx new file mode 100644 index 0000000..8d9a32b --- /dev/null +++ b/libcutl/cutl/compiler/type-info.hxx @@ -0,0 +1,111 @@ +// file : cutl/compiler/type-info.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#ifndef CUTL_COMPILER_TYPE_INFO_HXX +#define CUTL_COMPILER_TYPE_INFO_HXX + +#include +#include +#include // std::type_info + +#include +#include +#include + +#include + +namespace cutl +{ + namespace compiler + { + // + // + class type_info; + typedef type_info type_info_t; + + + // + // + class LIBCUTL_EXPORT base_info + { + public: + base_info (type_id const&); + + public: + type_info_t const& + type_info () const; + + private: + type_id type_id_; + mutable type_info_t const* type_info_; + }; + + typedef base_info base_info_t; + + + // + // + class LIBCUTL_EXPORT type_info + { + typedef std::vector bases; + + public: + typedef + bases::const_iterator + base_iterator; + + public: + type_info (type_id_t const&); + + type_id_t + type_id () const; + + base_iterator + begin_base () const; + + base_iterator + end_base () const; + + void + add_base (type_id_t const&); + + private: + type_id_t type_id_; + bases bases_; + }; + + + // + // + class LIBCUTL_EXPORT no_type_info: exception {}; + + LIBCUTL_EXPORT type_info const& + lookup (type_id const&); + + LIBCUTL_EXPORT type_info const& + lookup (std::type_info const&); + + template + type_info const& + lookup (X const volatile&); + + template + type_info const& + lookup (); + + LIBCUTL_EXPORT void + insert (type_info const&); + + namespace bits + { + struct default_type_info_id {}; + typedef std::map type_info_map; + static static_ptr type_info_map_; + } + } +} + +#include + +#endif // CUTL_COMPILER_TYPE_INFO_HXX -- cgit v1.2.3