summaryrefslogtreecommitdiff
path: root/libcult/cult/rtti
diff options
context:
space:
mode:
Diffstat (limited to 'libcult/cult/rtti')
-rw-r--r--libcult/cult/rtti/type-id.hxx52
-rw-r--r--libcult/cult/rtti/type-id.ixx45
-rw-r--r--libcult/cult/rtti/type-id.txx18
-rw-r--r--libcult/cult/rtti/type-info.cxx42
-rw-r--r--libcult/cult/rtti/type-info.hxx147
-rw-r--r--libcult/cult/rtti/type-info.ixx87
6 files changed, 0 insertions, 391 deletions
diff --git a/libcult/cult/rtti/type-id.hxx b/libcult/cult/rtti/type-id.hxx
deleted file mode 100644
index 21494b1..0000000
--- a/libcult/cult/rtti/type-id.hxx
+++ /dev/null
@@ -1,52 +0,0 @@
-// file : cult/rtti/type-id.hxx
-// author : Boris Kolpackov <boris@kolpackov.net>
-// copyright : Copyright (c) 2005-2010 Boris Kolpackov
-// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
-
-#ifndef CULT_RTTI_TYPE_ID_HXX
-#define CULT_RTTI_TYPE_ID_HXX
-
-#include <cult/types/fundamental.hxx>
-
-#include <typeinfo> // std::type_info
-
-namespace Cult
-{
- namespace RTTI
- {
- class TypeId
- {
- public:
- template<typename X>
- TypeId (X const volatile&);
-
- TypeId (std::type_info const&);
-
- public:
- Char const*
- name () const;
-
- friend Boolean
- operator== (TypeId const&, TypeId const&);
-
- friend Boolean
- operator!= (TypeId const&, TypeId const&);
-
- friend Boolean
- operator< (TypeId const&, TypeId const&);
-
- /*
- friend std::ostream&
- operator << (std::ostream& os, TypeId const& t);
- */
-
- private:
- std::type_info const* ti_;
- };
- }
-}
-
-#include <cult/rtti/type-id.ixx>
-#include <cult/rtti/type-id.txx>
-
-#endif // CULT_RTTI_TYPE_ID_HXX
diff --git a/libcult/cult/rtti/type-id.ixx b/libcult/cult/rtti/type-id.ixx
deleted file mode 100644
index cc77d5f..0000000
--- a/libcult/cult/rtti/type-id.ixx
+++ /dev/null
@@ -1,45 +0,0 @@
-// file : cult/rtti/type-id.ixx
-// author : Boris Kolpackov <boris@kolpackov.net>
-// copyright : Copyright (c) 2005-2010 Boris Kolpackov
-// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
-
-namespace Cult
-{
- namespace RTTI
- {
- inline
- TypeId::
- TypeId (std::type_info const& ti)
- : ti_ (&ti)
- {
- }
-
- inline
- Char const* TypeId::
- name () const
- {
- return ti_->name ();
- }
-
- inline
- Boolean
- operator== (TypeId const& x, TypeId const& y)
- {
- return *x.ti_ == *y.ti_;
- }
-
- inline
- Boolean
- operator!= (TypeId const& x, TypeId const& y)
- {
- return *x.ti_ != *y.ti_;
- }
-
- inline
- Boolean
- operator< (TypeId const& x, TypeId const& y)
- {
- return x.ti_->before (*y.ti_);
- }
- }
-}
diff --git a/libcult/cult/rtti/type-id.txx b/libcult/cult/rtti/type-id.txx
deleted file mode 100644
index 4fd771a..0000000
--- a/libcult/cult/rtti/type-id.txx
+++ /dev/null
@@ -1,18 +0,0 @@
-// file : cult/rtti/type-id.txx
-// author : Boris Kolpackov <boris@kolpackov.net>
-// copyright : Copyright (c) 2005-2010 Boris Kolpackov
-// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
-
-namespace Cult
-{
- namespace RTTI
- {
- template <typename X>
- inline
- TypeId::
- TypeId (X const volatile& x)
- : ti_ (&typeid (x))
- {
- }
- }
-}
diff --git a/libcult/cult/rtti/type-info.cxx b/libcult/cult/rtti/type-info.cxx
deleted file mode 100644
index 5bc4040..0000000
--- a/libcult/cult/rtti/type-info.cxx
+++ /dev/null
@@ -1,42 +0,0 @@
-// file : cult/rtti/type-info.cxx
-// author : Boris Kolpackov <boris@kolpackov.net>
-// copyright : Copyright (c) 2005-2010 Boris Kolpackov
-// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
-
-#include <cult/rtti/type-info.hxx>
-
-#include <cult/mm/static-ptr.hxx>
-
-#include <cult/containers/map.hxx>
-
-namespace Cult
-{
- namespace RTTI
- {
- Access const Access::private_ (Access::private__);
- Access const Access::protected_ (Access::protected__);
- Access const Access::public_ (Access::public__);
-
- typedef
- Containers::Map<TypeId, TypeInfo>
- TypeInfoMap;
-
- static MM::StaticPtr<TypeInfoMap> map_;
-
- TypeInfo const&
- lookup (TypeId const& type_id)
- {
- TypeInfoMap::ConstIterator i (map_->find (type_id));
-
- if (i == map_->end ()) throw NoInfo ();
-
- return i->second;
- }
-
- Void
- insert (TypeInfo const& type_info)
- {
- map_->insert (TypeInfoMap::Pair (type_info.type_id (), type_info));
- }
- }
-}
diff --git a/libcult/cult/rtti/type-info.hxx b/libcult/cult/rtti/type-info.hxx
deleted file mode 100644
index dce4923..0000000
--- a/libcult/cult/rtti/type-info.hxx
+++ /dev/null
@@ -1,147 +0,0 @@
-// file : cult/rtti/type-info.hxx
-// author : Boris Kolpackov <boris@kolpackov.net>
-// copyright : Copyright (c) 2005-2010 Boris Kolpackov
-// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
-
-#ifndef CULT_RTTI_TYPE_INFO_HXX
-#define CULT_RTTI_TYPE_INFO_HXX
-
-#include <cult/types/fundamental.hxx>
-
-#include <cult/rtti/type-id.hxx>
-
-#include <cult/containers/vector.hxx>
-
-#include <typeinfo> // std::type_info
-
-namespace Cult
-{
- namespace RTTI
- {
- //
- //
- //
- class Access
- {
- public:
- static Access const private_, protected_, public_;
-
- friend Boolean
- operator== (Access const& a, Access const& b)
- {
- return a.v_ == b.v_;
- }
-
- friend Boolean
- operator!= (Access const& a, Access const& b)
- {
- return a.v_ != b.v_;
- }
-
- private:
- enum Value { private__, protected__, public__ } v_;
-
- Access (Value v)
- : v_ (v)
- {
- }
- };
-
- //
- //
- class TypeInfo;
-
-
- //
- //
- class BaseInfo
- {
- public:
- BaseInfo (Access access, Boolean virtual_, TypeId const& type_id);
-
- public:
- TypeInfo const&
- type_info () const;
-
- Access
- access () const;
-
- Boolean
- virtual_ () const;
-
- private:
- Access access_;
- Boolean virtual__;
- TypeId type_id_;
- mutable TypeInfo const* type_info_;
- };
-
-
- //
- //
- class TypeInfo
- {
- typedef Containers::Vector<BaseInfo> BaseInfoList;
-
- public:
- typedef
- BaseInfoList::ConstIterator
- BaseIterator;
-
- public:
- TypeInfo (TypeId const& type_id);
-
- TypeId
- type_id () const;
-
- BaseIterator
- begin_base () const;
-
- BaseIterator
- end_base () const;
-
- Void
- add_base (Access access, Boolean virtual_, TypeId const& type_id);
-
- private:
- TypeId type_id_;
- BaseInfoList base_list_;
- };
-
-
- //
- //
- class NoInfo {};
-
- TypeInfo const&
- lookup (TypeId const& type_id);
-
- inline
- TypeInfo const&
- lookup (std::type_info const& type_info)
- {
- return lookup (TypeId (type_info));
- }
-
- template<typename X>
- TypeInfo const&
- lookup (X const& x)
- {
- return lookup (typeid (x));
- }
-
- template<typename X>
- TypeInfo const&
- lookup ()
- {
- return lookup (typeid (X));
- }
-
- Void
- insert (TypeInfo const&);
- }
-}
-
-#include <cult/rtti/type-info.ixx>
-
-#endif // CULT_RTTI_TYPE_INFO_HXX
diff --git a/libcult/cult/rtti/type-info.ixx b/libcult/cult/rtti/type-info.ixx
deleted file mode 100644
index f96ad6c..0000000
--- a/libcult/cult/rtti/type-info.ixx
+++ /dev/null
@@ -1,87 +0,0 @@
-// file : cult/rtti/type-info.ixx
-// author : Boris Kolpackov <boris@kolpackov.net>
-// copyright : Copyright (c) 2005-2010 Boris Kolpackov
-// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
-
-namespace Cult
-{
- namespace RTTI
- {
- // BaseInfo
- //
-
- inline
- BaseInfo::
- BaseInfo (Access access, Boolean virtual_, TypeId const& type_id)
- : access_ (access),
- virtual__ (virtual_),
- type_id_ (type_id),
- type_info_ (0)
- {
- }
-
- inline
- TypeInfo const& BaseInfo::
- type_info () const
- {
- if (type_info_ == 0) type_info_ = &(lookup (type_id_));
-
- return *type_info_;
- }
-
-
- inline
- Access BaseInfo::
- access () const
- {
- return access_;
- }
-
- inline
- Boolean BaseInfo::
- virtual_ () const
- {
- return virtual__;
- }
-
-
- // TypeInfo
- //
-
- inline
- TypeInfo::
- TypeInfo (TypeId const& type_id)
- : type_id_ (type_id)
- {
- }
-
- inline
- TypeId TypeInfo::
- type_id () const
- {
- return type_id_;
- }
-
- inline
- TypeInfo::BaseIterator TypeInfo::
- begin_base () const
- {
- return base_list_.begin ();
- }
-
-
- inline
- TypeInfo::BaseIterator TypeInfo::
- end_base () const
- {
- return base_list_.end ();
- }
-
- inline
- Void TypeInfo::
- add_base (Access access, Boolean virtual_, TypeId const& type_id)
- {
- base_list_.push_back (BaseInfo (access, virtual_, type_id));
- }
- }
-}