Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49419 - in sandbox/mirror: boost/mirror/meta_types/boost boost/mirror/meta_types/std doc/html libs/mirror/example/special libs/mirror/test
From: chochlik_at_[hidden]
Date: 2008-10-21 09:48:04


Author: matus.chochlik
Date: 2008-10-21 09:48:03 EDT (Tue, 21 Oct 2008)
New Revision: 49419
URL: http://svn.boost.org/trac/boost/changeset/49419

Log:
[mirror 0.2.x]
- minor doc update
- added meta_type(s) for boost any, variant and optional

Added:
   sandbox/mirror/boost/mirror/meta_types/boost/any.hpp (contents, props changed)
   sandbox/mirror/boost/mirror/meta_types/boost/optional.hpp (contents, props changed)
   sandbox/mirror/boost/mirror/meta_types/boost/variant.hpp (contents, props changed)
Text files modified:
   sandbox/mirror/boost/mirror/meta_types/std/less.hpp | 3 +--
   sandbox/mirror/doc/html/mirror.html | 4 ++--
   sandbox/mirror/libs/mirror/example/special/boost_tuple.cpp | 7 ++++++-
   sandbox/mirror/libs/mirror/test/types_ct_04.cpp | 8 ++++++--
   4 files changed, 15 insertions(+), 7 deletions(-)

Added: sandbox/mirror/boost/mirror/meta_types/boost/any.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/meta_types/boost/any.hpp 2008-10-21 09:48:03 EDT (Tue, 21 Oct 2008)
@@ -0,0 +1,30 @@
+/**
+ * \file boost/mirror/meta_types/boost/any.hpp
+ *
+ * Registering of ::boost::any
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under the Boost
+ * Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ */
+
+#ifndef BOOST_MIRROR_META_TYPES_BOOST_ANY_HPP
+#define BOOST_MIRROR_META_TYPES_BOOST_ANY_HPP
+
+// register string types
+#include <boost/mirror/meta_type.hpp>
+#include <boost/any.hpp>
+
+namespace boost {
+namespace mirror {
+
+/** Register the ::boost::any type
+ */
+BOOST_MIRROR_REG_TYPE(::boost, any)
+
+
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Added: sandbox/mirror/boost/mirror/meta_types/boost/optional.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/meta_types/boost/optional.hpp 2008-10-21 09:48:03 EDT (Tue, 21 Oct 2008)
@@ -0,0 +1,47 @@
+/**
+ * \file boost/mirror/meta_types/boost/optional.hpp
+ *
+ * Meta-type for boost::optional<T>
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under the Boost
+ * Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ */
+
+#ifndef BOOST_MIRROR_META_TYPES_BOOST_OPTIONAL_HPP
+#define BOOST_MIRROR_META_TYPES_BOOST_OPTIONAL_HPP
+
+#include <boost/mirror/meta_type.hpp>
+#include <boost/mirror/detail/template_name.hpp>
+#include <boost/optional/optional.hpp>
+
+namespace boost {
+namespace mirror {
+
+namespace detail {
+
+struct meta_type_boost_optional
+{
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME("optional")
+};
+
+} // namespace detail
+
+
+template <typename T>
+struct meta_type< ::boost::optional<T> >
+: detail::static_template_name<
+ BOOST_MIRRORED_NAMESPACE(::boost),
+ detail::meta_type_boost_optional ,
+ mpl::vector1<T>
+>
+{
+ typedef ::boost::optional<T> reflected_type;
+};
+
+
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Added: sandbox/mirror/boost/mirror/meta_types/boost/variant.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/meta_types/boost/variant.hpp 2008-10-21 09:48:03 EDT (Tue, 21 Oct 2008)
@@ -0,0 +1,73 @@
+/**
+ * \file boost/mirror/meta_types/boost/variant.hpp
+ * Meta-type for boost::variant<>
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under the Boost
+ * Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ */
+
+#ifndef BOOST_MIRROR_META_TYPES_BOOST_VARIANT_HPP
+#define BOOST_MIRROR_META_TYPES_BOOST_VARIANT_HPP
+
+#include <boost/mirror/meta_type.hpp>
+#include <boost/mirror/detail/template_name.hpp>
+//
+#include <boost/variant.hpp>
+
+namespace boost {
+namespace mirror {
+
+#define BOOST_MIRROR_TMP_BOOST_VARIANT_TEMPL_DECL() \
+template < \
+ BOOST_VARIANT_ENUM_PARAMS(typename T)\
+>
+
+#define BOOST_MIRROR_TMP_BOOST_VARIANT_TEMPL_ARG_NAMES() \
+ BOOST_VARIANT_ENUM_PARAMS(T)
+
+
+namespace detail {
+
+struct meta_type_boost_variant
+{
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME("variant")
+};
+
+
+// designate detail::variant::void_ as typelist null type
+template <>
+struct is_typelist_null_type< ::boost::detail::variant::void_ >
+ : ::boost::true_type { };
+
+
+} // namespace detail
+
+
+BOOST_MIRROR_TMP_BOOST_VARIANT_TEMPL_DECL()
+struct meta_type<
+ ::boost::variant< BOOST_MIRROR_TMP_BOOST_VARIANT_TEMPL_ARG_NAMES() >
+>
+: detail::static_template_name<
+ BOOST_MIRRORED_NAMESPACE(::boost),
+ detail::meta_type_boost_variant,
+ mpl::vector<
+ BOOST_MIRROR_TMP_BOOST_VARIANT_TEMPL_ARG_NAMES()
+ >
+>
+{
+ typedef ::boost::variant<
+ BOOST_MIRROR_TMP_BOOST_VARIANT_TEMPL_ARG_NAMES()
+ > reflected_type;
+};
+
+// undefine the helper macros
+#undef BOOST_MIRROR_TMP_BOOST_VARIANT_TEMPL_DECL
+#undef BOOST_MIRROR_TMP_BOOST_VARIANT_TEMPL_ARG_NAMES
+
+
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Modified: sandbox/mirror/boost/mirror/meta_types/std/less.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/std/less.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/std/less.hpp 2008-10-21 09:48:03 EDT (Tue, 21 Oct 2008)
@@ -20,7 +20,6 @@
 
 namespace detail {
 
-template <typename >
 struct meta_type_std_less
 {
         BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME("less")
@@ -33,7 +32,7 @@
 struct meta_type< ::std::less<T> >
 : detail::static_template_name<
         BOOST_MIRRORED_NAMESPACE(::std),
- detail::meta_type_std_less<T> ,
+ detail::meta_type_std_less ,
         mpl::vector1<T>
>
 {

Modified: sandbox/mirror/doc/html/mirror.html
==============================================================================
--- sandbox/mirror/doc/html/mirror.html (original)
+++ sandbox/mirror/doc/html/mirror.html 2008-10-21 09:48:03 EDT (Tue, 21 Oct 2008)
@@ -144,13 +144,13 @@
                 in a namespace, inside of a class)
         </li>
 <li>
- Unform and generic inspection of class' base classes. One can inspect
+ Uniform and generic inspection of class' base classes. One can inspect
                 traits of the base classes for example their types, whether they are inherited
                 virtually or not and the access specifier (<code class="computeroutput">private</code>, <code class="computeroutput">protected</code>,
                 <code class="computeroutput">public</code>).
         </li>
 <li>
- Unform and generic inspection of class' member attributes either just those defined
+ Uniform and generic inspection of class' member attributes either just those defined
                 directly in the reflected class or inherited from it's base-classes.
                 At compile-time the count of class' attributes and their types, storage class
                 specifiers (<code class="computeroutput">static</code>, <code class="computeroutput">mutable</code>) and some other traits

Modified: sandbox/mirror/libs/mirror/example/special/boost_tuple.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/example/special/boost_tuple.cpp (original)
+++ sandbox/mirror/libs/mirror/example/special/boost_tuple.cpp 2008-10-21 09:48:03 EDT (Tue, 21 Oct 2008)
@@ -25,6 +25,9 @@
 #include <boost/mirror/meta_types/std/list.hpp>
 #include <boost/mirror/meta_types/std/map.hpp>
 #include <boost/mirror/meta_types/std/set.hpp>
+#include <boost/mirror/meta_types/boost/any.hpp>
+#include <boost/mirror/meta_types/boost/variant.hpp>
+#include <boost/mirror/meta_types/boost/optional.hpp>
 
 #include <boost/mirror/meta_classes/boost/tuples/tuple.hpp>
 #include <boost/mirror/meta_classes/boost/fusion/vector.hpp>
@@ -77,8 +80,10 @@
         typedef A (*B)(string);
         typedef B (C)(char, wchar_t);
         typedef A D[2][3];
+ typedef ::boost::optional< ::boost::any> Z;
+ typedef ::boost::variant< A, B, C, D> V;
         typedef tuple<int, double, const string *> T1;
- typedef tuple<const A, volatile B, C&, D> T2;
+ typedef tuple<const A, volatile B, C&, D, V, Z> T2;
         typedef pair<T1, T2> T3;
         typedef tuple<void*, const wstring& , const string&> T4;
         typedef tuple<char, wchar_t, short int const> T5;

Modified: sandbox/mirror/libs/mirror/test/types_ct_04.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/types_ct_04.cpp (original)
+++ sandbox/mirror/libs/mirror/test/types_ct_04.cpp 2008-10-21 09:48:03 EDT (Tue, 21 Oct 2008)
@@ -18,6 +18,9 @@
 #include <boost/mirror/meta_types/std/map.hpp>
 #include <boost/mirror/meta_types/std/pair.hpp>
 #include <boost/mirror/meta_types/boost/tuples/tuple.hpp>
+#include <boost/mirror/meta_types/boost/optional.hpp>
+#include <boost/mirror/meta_types/boost/any.hpp>
+#include <boost/mirror/meta_types/boost/variant.hpp>
 //
 #include <cstdlib>
 //
@@ -56,14 +59,15 @@
         typedef ::test::feature::detail::foo_impl X;
         typedef BOOST_MIRROR_TYPEDEF(::test, foobar) Y;
         typedef BOOST_MIRROR_TYPEDEF(::boost::cts, bstring) W;
- typedef long int Z;
+ typedef ::boost::optional< ::boost::any> Z;
+ typedef ::boost::variant< X, Y, W, Z> V;
         //
         typedef X * const T1;
         typedef Y volatile * const T2;
         typedef const volatile W T3;
         typedef Z const * const T4[][1][2][3][4][5][6][7][8][9];
         typedef T1& (T5)(T2, T3, T4);
- typedef T5* (T6)(T5*, T5&, Z);
+ typedef T5* (T6)(T5*, T5&, V);
         //
         typedef T6& T;
         //


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