summaryrefslogtreecommitdiff
path: root/contrib/utility/Utility/Introspection/TypeInfo.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/utility/Utility/Introspection/TypeInfo.hpp')
-rw-r--r--contrib/utility/Utility/Introspection/TypeInfo.hpp104
1 files changed, 104 insertions, 0 deletions
diff --git a/contrib/utility/Utility/Introspection/TypeInfo.hpp b/contrib/utility/Utility/Introspection/TypeInfo.hpp
new file mode 100644
index 00000000000..4321fdc522c
--- /dev/null
+++ b/contrib/utility/Utility/Introspection/TypeInfo.hpp
@@ -0,0 +1,104 @@
+// file : Utility/Introspection/TypeInfo.hpp
+// author : Boris Kolpackov <boris@kolpackov.net>
+// copyright : Copyright (c) 2002-2003 Boris Kolpackov
+// license : http://kolpackov.net/license.html
+
+#ifndef UTILITY_INTROSPECTION_TYPE_INFO_HPP
+#define UTILITY_INTROSPECTION_TYPE_INFO_HPP
+
+#include <vector>
+
+#include "Utility/Introspection/TypeId.hpp"
+
+namespace Utility
+{
+ namespace Introspection
+ {
+ //
+ //
+ //
+ struct Access
+ {
+ enum Value
+ {
+ PRIVATE,
+ PROTECTED,
+ PUBLIC
+ };
+ };
+
+ // Forward declaration of class TypeInfo.
+ //
+ //
+ class TypeInfo;
+
+ //
+ //
+ //
+ class BaseInfo
+ {
+ public:
+ BaseInfo (Access::Value access,
+ bool virtual_base,
+ TypeInfo const& ti);
+
+ public:
+ TypeInfo const&
+ type_info () const;
+
+ Access::Value
+ access () const;
+
+ bool
+ virtual_base () const;
+
+ private:
+ TypeInfo const* ti_;
+ bool virtual_base_;
+ Access::Value access_;
+ };
+
+
+ //
+ //
+ //
+ class TypeInfo
+ {
+ private:
+ typedef
+ std::vector<BaseInfo>
+ BaseInfoList;
+
+ public:
+ typedef
+ BaseInfoList::const_iterator
+ BaseIterator;
+
+ public:
+ TypeInfo (TypeId const& tid);
+
+ TypeId
+ type_id () const;
+
+ BaseIterator
+ begin_base () const;
+
+ BaseIterator
+ end_base () const;
+
+ void
+ add_base (Access::Value access,
+ bool virtual_base,
+ TypeInfo const& ti);
+
+ private:
+ TypeId tid_;
+ BaseInfoList base_;
+ };
+ }
+}
+
+#include "Utility/Introspection/TypeInfo.ipp"
+
+#endif // UTILITY_INTROSPECTION_TYPE_INFO_HPP
+//$Id$