|
Boost-Commit : |
From: chochlik_at_[hidden]
Date: 2008-04-21 08:21:04
Author: matus.chochlik
Date: 2008-04-21 08:21:04 EDT (Mon, 21 Apr 2008)
New Revision: 44693
URL: http://svn.boost.org/trac/boost/changeset/44693
Log:
minor changes to meta_class.hpp
Text files modified:
sandbox/mirror/boost/mirror/meta_class.hpp | 103 +++++++++++++++++++++++++++++++++++----
1 files changed, 92 insertions(+), 11 deletions(-)
Modified: sandbox/mirror/boost/mirror/meta_class.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_class.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_class.hpp 2008-04-21 08:21:04 EDT (Mon, 21 Apr 2008)
@@ -116,7 +116,7 @@
*/
typedef typename mpl::accumulate<
list_of_regular_base_classes,
- mpl::vector<>,
+ mpl::vector0<>,
mpl::push_back<
mpl::insert_range<
mpl::_1,
@@ -165,7 +165,7 @@
*/
typedef typename mpl::accumulate<
typename base_classes::list,
- mpl::vector<>,
+ mpl::vector0<>,
mpl::if_<
reflects_virtual_inheritance<
mpl::_2
@@ -217,12 +217,10 @@
template <class meta_inheritance>
struct get_base_class_attrib_type_list
{
- typedef typename
- meta_inheritance::
- meta_class::
- attributes::
- type_list type;
-
+ typedef typename meta_inheritance::
+ meta_class::
+ attributes::
+ type_list type;
};
typedef typename mpl::joint_view<
@@ -234,7 +232,7 @@
* of the reflected class.
* NOTE: this implementation puts the
* members of the virtual bases before
- * the other members
+ * the other members.
*/
typedef typename mpl::accumulate<
base_class_layout,
@@ -256,7 +254,52 @@
typename meta_class<reflected_class, variant_tag>::attributes::type_list
>::type member_attrib_type_list;
- /** The count of virtually inherited attributes
+
+ /** This template gets the list of the owner classes
+ * for the inherited attributes.
+ */
+ template <class meta_inheritance, class current_list>
+ struct get_base_class_attrib_owner_and_offs
+ {
+ typedef typename meta_inheritance::
+ meta_class meta_class;
+
+ typedef typename meta_class::
+ attributes::
+ type_list type_list;
+
+ typedef typename mpl::size<
+ current_list
+ > offset;
+
+ typedef typename mpl::accumulate<
+ type_list,
+ mpl::vector0<>,
+ mpl::pair<
+ meta_class,
+ offset
+ >
+ >::type type;
+ };
+
+ /** This is a list that contains a pair of owner meta_class
+ * and the index offset for every inherited attribute.
+ */
+ typedef typename mpl::accumulate<
+ base_class_layout,
+ mpl::vector0<>,
+ mpl::insert_range<
+ mpl::_1,
+ mpl::end<mpl::_1>,
+ get_base_class_attrib_owner_and_offs<
+ mpl::_2,
+ mpl::_1
+ >
+ >
+ >::type inherited_member_owners_and_offsets;
+
+
+ /** The count of virtually attributes
*/
typedef typename mpl::accumulate<
typename mpl::transform<
@@ -282,7 +325,45 @@
mpl::int_<I>,
virtual_attrib_count
>::type { };
-
+
+
+ /** This template gets the regular_base_class_layout
+ * of a base class when given a meta_inheritance
+ * specialization for this base class.
+ template <class meta_inheritance>
+ struct get_base_class_inheritance_hierarchy
+ {
+ typedef typename mpl::push_back<
+ meta_inheritance::
+ meta_class::
+ all_attributes::
+ detail::
+ regular_base_class_layout type;
+ };
+ */
+
+ /** The inheritance hierarchy of non-virtual
+ * base classes of the reflected class.
+ typedef typename mpl::accumulate<
+ list_of_regular_base_classes,
+ mpl::vector0<>,
+ mpl::accumulate<
+ get_base_class_regular_layout<
+ mpl::_2
+ >,
+ mpl::vector0<>,
+ >
+ */
+/*
+ mpl::insert_range<
+ mpl::_1,
+ mpl::end<mpl::_1>,
+ >
+ >::type regular_base_class_layout;
+*/
+
+
+
/** This template is used to query the return value
* type of the getter for the I-th member attribute
*/
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk