|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r50262 - in sandbox/mirror: boost/mirror boost/mirror/detail boost/mirror/intrinsic doc/html/mirror/non_boost_book/concepts
From: chochlik_at_[hidden]
Date: 2008-12-13 11:39:32
Author: matus.chochlik
Date: 2008-12-13 11:39:31 EST (Sat, 13 Dec 2008)
New Revision: 50262
URL: http://svn.boost.org/trac/boost/changeset/50262
Log:
[mirror 0.3.x]
Added:
sandbox/mirror/boost/mirror/factory.hpp (contents, props changed)
sandbox/mirror/boost/mirror/functor_call.hpp (contents, props changed)
sandbox/mirror/boost/mirror/meta_constructors.hpp (contents, props changed)
Text files modified:
sandbox/mirror/boost/mirror/detail/decorated_type_name.hpp | 2 +-
sandbox/mirror/boost/mirror/detail/function_type_name.hpp | 2 +-
sandbox/mirror/boost/mirror/detail/meta_type_registering.hpp | 4 ++--
sandbox/mirror/boost/mirror/detail/static_int_to_str.hpp | 4 ++--
sandbox/mirror/boost/mirror/detail/traversal.hpp | 16 ++++++++--------
sandbox/mirror/boost/mirror/intrinsic/size.hpp | 3 +++
sandbox/mirror/boost/mirror/meta_attributes.hpp | 24 ++++++++++++------------
sandbox/mirror/boost/mirror/meta_namespace.hpp | 5 +++--
sandbox/mirror/boost/mirror/traversal.hpp | 12 ++++++------
sandbox/mirror/doc/html/mirror/non_boost_book/concepts/ontology.xml | 4 ++--
10 files changed, 40 insertions(+), 36 deletions(-)
Modified: sandbox/mirror/boost/mirror/detail/decorated_type_name.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/decorated_type_name.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/decorated_type_name.hpp 2008-12-13 11:39:31 EST (Sat, 13 Dec 2008)
@@ -77,7 +77,7 @@
}
public:
template <bool FullName, typename CharT>
- static const ::std::basic_string<CharT>& get_name(
+ static inline const ::std::basic_string<CharT>& get_name(
mpl::bool_<FullName> full_or_base,
::std::char_traits<CharT> _cht
)
Modified: sandbox/mirror/boost/mirror/detail/function_type_name.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/function_type_name.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/function_type_name.hpp 2008-12-13 11:39:31 EST (Sat, 13 Dec 2008)
@@ -36,7 +36,7 @@
{
public:
template <bool FullName, typename CharT>
- inline static ::std::basic_string<CharT> build_name(
+ static ::std::basic_string<CharT> build_name(
mpl::bool_<FullName> full_or_base,
::std::basic_string<CharT>& left,
::std::basic_string<CharT>& right,
Modified: sandbox/mirror/boost/mirror/detail/meta_type_registering.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/meta_type_registering.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/meta_type_registering.hpp 2008-12-13 11:39:31 EST (Sat, 13 Dec 2008)
@@ -55,7 +55,7 @@
};
#define BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(TYPE_NAME_STRING) \
- static const ::std::string& get_name( \
+ static inline const ::std::string& get_name( \
mpl::false_, \
::std::char_traits<char> \
)\
@@ -63,7 +63,7 @@
static ::std::string s_name(TYPE_NAME_STRING); \
return s_name; \
} \
- static const ::std::wstring& get_name( \
+ static inline const ::std::wstring& get_name( \
mpl::false_, \
::std::char_traits<wchar_t> \
)\
Modified: sandbox/mirror/boost/mirror/detail/static_int_to_str.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/static_int_to_str.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/static_int_to_str.hpp 2008-12-13 11:39:31 EST (Sat, 13 Dec 2008)
@@ -72,7 +72,7 @@
do_copy_to(_str, mpl::int_<J - 1>());
}
//
- static CharT* convert(CharT* _str, size_t _max_len)
+ static inline CharT* convert(CharT* _str, size_t _max_len)
{
assert(_max_len > size_t(length::value));
do_copy_to(_str, length());
@@ -88,7 +88,7 @@
typedef static_int_to_str_constants<CharT> base_class;
typedef mpl::int_<1>::type length;
- static CharT* convert(CharT* _str, size_t _max_len)
+ static inline CharT* convert(CharT* _str, size_t _max_len)
{
assert(_max_len > 1);
_str[0] = base_class::zero();
Modified: sandbox/mirror/boost/mirror/detail/traversal.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/traversal.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/traversal.hpp 2008-12-13 11:39:31 EST (Sat, 13 Dec 2008)
@@ -50,7 +50,7 @@
class attribute_traversal
{
public:
- attribute_traversal(
+ inline attribute_traversal(
reference_wrapper<VisitorType> _visitor,
InstancePtr _ptr_to_inst
)
@@ -67,7 +67,7 @@
);
}
- ~attribute_traversal(void)
+ inline ~attribute_traversal(void)
{
visitor.leave_attributes(
MetaClass(),
@@ -80,7 +80,7 @@
}
template <class MetaAttribute>
- void operator ()(MetaAttribute ma) const
+ inline void operator ()(MetaAttribute ma) const
{
// update the traversal context
typename mpl::push_back<
@@ -101,7 +101,7 @@
// process single attribute WITH an instance
template <class MetaAttribute, class AttribsNodePath>
- void process_single(
+ void inline process_single(
MetaAttribute ma,
AttribsNodePath path,
mpl::bool_<true>
@@ -144,7 +144,7 @@
// process single attribute W/O an instance
template <class MetaAttribute, class AttribsNodePath>
- void process_single(
+ void inline process_single(
MetaAttribute ma,
AttribsNodePath path,
mpl::bool_<false>
@@ -195,7 +195,7 @@
class base_class_traversal
{
public:
- base_class_traversal(
+ inline base_class_traversal(
reference_wrapper<VisitorType> _visitor,
InstancePtr _ptr_to_inst
)
@@ -212,7 +212,7 @@
);
}
- ~base_class_traversal(void)
+ inline ~base_class_traversal(void)
{
visitor.leave_base_classes(
MetaClass(),
@@ -225,7 +225,7 @@
}
template <class MetaInheritance>
- void operator ()(MetaInheritance mbc) const
+ inline void operator ()(MetaInheritance mbc) const
{
typedef typename mpl::push_back<
ClassNodePath,
Added: sandbox/mirror/boost/mirror/factory.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/factory.hpp 2008-12-13 11:39:31 EST (Sat, 13 Dec 2008)
@@ -0,0 +1,297 @@
+/**
+ * \file boost/mirror/factory.hpp
+ *
+ * Customizable instance construction facility
+ *
+ * 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_FACTORY_HPP
+#define BOOST_MIRROR_FACTORY_HPP
+
+#include <boost/mirror/meta_constructors.hpp>
+
+namespace boost {
+namespace mirror {
+namespace detail {
+
+/** Forward declaration of the constructor template
+ * class.
+ */
+template <
+ template <class> class Manufacturer,
+ class Product,
+ class TypeList,
+ class ParamCount,
+ class Index
+> struct constructor;
+
+/** Default constructor (with no argument)
+ */
+template <
+ template <class> class Manufacturer,
+ class Product,
+ class TypeList,
+ class Index
+> struct constructor<
+ Manufacturer,
+ Product,
+ TypeList,
+ mpl::int_<0>,
+ Index
+>
+{
+ template <typename Param>
+ constructor(Param param)
+ { }
+
+ inline Product operator()(void)
+ {
+ return Product();
+ }
+};
+
+
+#define BOOST_MIRROR_DECLARE_CONSTRUCTOR_PARAM_MANUFACTURER(Z, INDEX, TYPELIST)\
+Manufacturer<typename mpl::at<TYPELIST, mpl::int_<INDEX> >::type > _##INDEX;
+
+#define BOOST_MIRROR_INITIALIZE_CONSTRUCTOR_MANUFACTURER(Z, INDEX, PARAM)\
+ _##INDEX (PARAM, (Product*)0, ConstructorIndex(), mpl::int_<INDEX>())
+
+#define BOOST_MIRROR_CALL_CONSTRUCTOR_MANUFACTURER(Z, INDEX, X)\
+ _##INDEX ()
+
+
+/** Constructor with arguments
+ */
+#define BOOST_MIRROR_IMPLEMENT_CONSTRUCTOR(PARAM_COUNT) \
+template < \
+ template <class> class Manufacturer, \
+ class Product, \
+ class TypeList, \
+ class ConstructorIndex \
+> struct constructor< \
+ Manufacturer, \
+ Product, \
+ TypeList, \
+ mpl::int_< PARAM_COUNT >, \
+ ConstructorIndex \
+> \
+{ \
+ BOOST_PP_REPEAT( \
+ PARAM_COUNT, \
+ BOOST_MIRROR_DECLARE_CONSTRUCTOR_PARAM_MANUFACTURER, \
+ TypeList \
+ ) \
+ \
+ template <typename Param> \
+ inline constructor(Param param) : \
+ BOOST_PP_ENUM( \
+ PARAM_COUNT, \
+ BOOST_MIRROR_INITIALIZE_CONSTRUCTOR_MANUFACTURER, \
+ param \
+ ) \
+ { } \
+ \
+ inline Product operator()(void) \
+ { \
+ return Product( \
+ BOOST_PP_ENUM( \
+ PARAM_COUNT, \
+ BOOST_MIRROR_CALL_CONSTRUCTOR_MANUFACTURER, \
+ 0 \
+ ) \
+ ); \
+ } \
+ \
+ inline Product* new_(void) \
+ { \
+ return new Product( \
+ BOOST_PP_ENUM( \
+ PARAM_COUNT, \
+ BOOST_MIRROR_CALL_CONSTRUCTOR_MANUFACTURER, \
+ 0 \
+ ) \
+ ); \
+ } \
+};
+
+#define BOOST_MIRROR_DO_IMPLEMENT_CONSTRUCTOR(Z, PARAM_COUNT, X) \
+ BOOST_MIRROR_IMPLEMENT_CONSTRUCTOR(PARAM_COUNT)
+
+BOOST_PP_REPEAT_FROM_TO(1, 12, BOOST_MIRROR_DO_IMPLEMENT_CONSTRUCTOR, 0)
+
+
+#undef BOOST_MIRROR_DO_IMPLEMENT_CONSTRUCTOR
+#undef BOOST_MIRROR_IMPLEMENT_CONSTRUCTOR
+#undef BOOST_MIRROR_CALL_CONSTRUCTOR_MANUFACTURER
+#undef BOOST_MIRROR_INITIALIZE_CONSTRUCTOR_MANUFACTURER
+#undef BOOST_MIRROR_DECLARE_CONSTRUCTOR_PARAM_MANUFACTURER
+
+
+template <
+ template <class> class Manufacturer,
+ class Product,
+ class ConstructorParams,
+ class ConstructorCount
+> struct base_factory;
+
+/** Declares the I-th factory member constructor
+ */
+#define BOOST_MIRROR_DECLARE_FACTORY_CONSTRUCTOR(Z, INDEX, CONSTR_LIST) \
+constructor< \
+ Manufacturer, \
+ Product, \
+ typename mpl::at< CONSTR_LIST, mpl::int_<INDEX> >::type, \
+ mpl::int_< \
+ mpl::size< \
+ typename mpl::at< CONSTR_LIST, mpl::int_<INDEX> >::type \
+ >::value \
+ >, \
+ mpl::int_< INDEX > \
+> _ ## INDEX;
+
+/** Factory constructor initalizer
+ */
+#define BOOST_MIRROR_INITIALIZE_FACTORY_CONSTRUCTOR(Z, INDEX, X)\
+ , _##INDEX (manager.param())
+
+#define BOOST_MIRROR_CALL_FACTORY_FUNCTOR(Z, INDEX, X)\
+ case INDEX: return _##INDEX ();
+
+#define BOOST_MIRROR_CALL_FACTORY_OP_NEW(Z, INDEX, X)\
+ case INDEX: return _##INDEX .new_();
+
+#define BOOST_MIRROR_IMPLEMENT_CONSTRUCTION_FUNCTION(MACRO, PARAM_COUNT) \
+ assert(manager.index() >= 0); \
+ assert(manager.index() < PARAM_COUNT); \
+ switch(manager.index()) \
+ { \
+ BOOST_PP_REPEAT( \
+ PARAM_COUNT, \
+ MACRO, \
+ 0 \
+ ) \
+ } \
+ ::std::abort(); \
+
+
+/** Implements a base factory
+ */
+#define BOOST_MIRROR_IMPLEMENT_BASE_FACTORY(PARAM_COUNT) \
+template < \
+ template <class> class Manufacturer, \
+ class Product, \
+ class ConstructorParams \
+> struct base_factory<Manufacturer, Product, ConstructorParams, mpl::int_< PARAM_COUNT> > \
+{ \
+ Manufacturer<void> manager; \
+ \
+ BOOST_PP_REPEAT( \
+ PARAM_COUNT, \
+ BOOST_MIRROR_DECLARE_FACTORY_CONSTRUCTOR, \
+ ConstructorParams \
+ ) \
+ \
+ template <typename Param> \
+ base_factory(Param param, int factory_index) \
+ : manager(param, factory_index) \
+ BOOST_PP_REPEAT( \
+ PARAM_COUNT, \
+ BOOST_MIRROR_INITIALIZE_FACTORY_CONSTRUCTOR, \
+ 0 \
+ ) \
+ { } \
+ \
+ inline Product operator()(void) \
+ { \
+ BOOST_MIRROR_IMPLEMENT_CONSTRUCTION_FUNCTION(\
+ BOOST_MIRROR_CALL_FACTORY_FUNCTOR, \
+ PARAM_COUNT \
+ )\
+ return Product(*((Product*)0)); \
+ } \
+ \
+ inline Product* new_(void) \
+ { \
+ BOOST_MIRROR_IMPLEMENT_CONSTRUCTION_FUNCTION(\
+ BOOST_MIRROR_CALL_FACTORY_OP_NEW, \
+ PARAM_COUNT \
+ )\
+ return ((Product*)0); \
+ } \
+};
+
+#define BOOST_MIRROR_DO_IMPLEMENT_BASE_FACTORY(Z, PARAM_COUNT, X) \
+ BOOST_MIRROR_IMPLEMENT_BASE_FACTORY(PARAM_COUNT)
+
+BOOST_PP_REPEAT(12, BOOST_MIRROR_DO_IMPLEMENT_BASE_FACTORY, 0)
+
+#undef BOOST_MIRROR_CALL_FACTORY_OP_NEW
+#undef BOOST_MIRROR_DO_IMPLEMENT_BASE_FACTORY
+#undef BOOST_MIRROR_IMPLEMENT_BASE_FACTORY
+#undef BOOST_MIRROR_INITIALIZE_FACTORY_CONSTRUCTOR
+#undef BOOST_MIRROR_DECLARE_FACTORY_CONSTRUCTOR
+#undef BOOST_MIRROR_CALL_FACTORY_FUNCTOR
+
+} // namespace detail
+
+/** the factory template
+ */
+template <
+ template <class> class Manufacturer,
+ class Product
+> struct factory
+ : ::boost::mirror::detail::base_factory<
+ Manufacturer,
+ Product,
+ typename meta_constructors<Product>::param_type_lists,
+ mpl::int_<
+ mpl::size<
+ typename meta_constructors<Product>::param_type_lists
+ >::value
+ >
+>
+{
+ typedef ::boost::mirror::detail::base_factory<
+ Manufacturer,
+ Product,
+ typename meta_constructors<Product>::param_type_lists,
+ mpl::int_<
+ mpl::size<
+ typename meta_constructors<Product>::param_type_lists
+ >::value
+ >
+ > base_class;
+
+ factory(void)
+ : base_class(0, 0)
+ { }
+
+ template <typename Param>
+ factory(Param param, int factory_index = 0)
+ : base_class(param, factory_index)
+ { }
+};
+
+template <
+ class ConcreteManufacturer,
+ class Product
+> struct make_factory;
+
+template <
+ template <class> class Manufacturer,
+ class Product
+> struct make_factory<Manufacturer<Product>, Product>
+{
+ typedef factory<Manufacturer, Product> type;
+};
+
+
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+
Added: sandbox/mirror/boost/mirror/functor_call.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/functor_call.hpp 2008-12-13 11:39:31 EST (Sat, 13 Dec 2008)
@@ -0,0 +1,117 @@
+/**
+ * \file boost/mirror/functor_call.hpp
+ *
+ *
+ * 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_FUNCTOR_CALL_HPP
+#define BOOST_MIRROR_FUNCTOR_CALL_HPP
+
+#include <boost/mirror/factory.hpp>
+
+namespace boost {
+namespace mirror {
+namespace detail {
+
+template <
+ template <class> class Manufacturer,
+ class ParamTypeList,
+ class ParamCount
+> struct base_functor_caller;
+
+#define BOOST_MIRROR_BASE_FUNCTION_CALLER_DECLARE_FACTORY(Z, INDEX, X)\
+ factory<Manufacturer, typename mpl::at<ParamTypeList, mpl::int_< INDEX > >::type> \
+ BOOST_PP_CAT(_, INDEX);
+
+
+#define BOOST_MIRROR_BASE_FUNCTION_CALLER_INITIALIZE_FACTORY(Z, INDEX, PARAM) \
+ , BOOST_PP_CAT(_, INDEX) (PARAM, INDEX)
+
+#define BOOST_MIRROR_BASE_FUNCTION_CALLER_CALL_FACTORY(Z, INDEX, X) \
+ BOOST_PP_CAT(_, INDEX)()
+
+
+#define BOOST_MIRROR_IMPLEMENT_BASE_FUNCTION_CALLER(PARAM_COUNT) \
+template < \
+ template <class> class Manufacturer, \
+ class ParamTypeList \
+> struct base_functor_caller<Manufacturer, ParamTypeList, mpl::int_<PARAM_COUNT> > \
+{ \
+ struct { } _dummy; \
+ BOOST_PP_REPEAT( \
+ PARAM_COUNT, \
+ BOOST_MIRROR_BASE_FUNCTION_CALLER_DECLARE_FACTORY, \
+ 0 \
+ ) \
+ \
+ template <class Param> \
+ base_functor_caller(Param param) \
+ : _dummy() \
+ BOOST_PP_REPEAT( \
+ PARAM_COUNT, \
+ BOOST_MIRROR_BASE_FUNCTION_CALLER_INITIALIZE_FACTORY, \
+ param \
+ ) { } \
+ \
+ template <class Functor, class Consumer> \
+ Consumer& operator()(Functor func, Consumer& consumer) \
+ { \
+ consumer(func( \
+ BOOST_PP_ENUM( \
+ PARAM_COUNT, \
+ BOOST_MIRROR_BASE_FUNCTION_CALLER_CALL_FACTORY, \
+ 0 \
+ ) \
+ )); \
+ return consumer; \
+ } \
+};
+
+#define BOOST_MIRROR_DO_IMPLEMENT_BASE_FUNCTION_CALLER(Z, PARAM_COUNT, X) \
+ BOOST_MIRROR_IMPLEMENT_BASE_FUNCTION_CALLER(PARAM_COUNT)
+
+BOOST_PP_REPEAT(12, BOOST_MIRROR_DO_IMPLEMENT_BASE_FUNCTION_CALLER, 0)
+
+#undef BOOST_MIRROR_DO_IMPLEMENT_BASE_FUNCTION_CALLER
+#undef BOOST_MIRROR_IMPLEMENT_BASE_FUNCTION_CALLER
+#undef BOOST_MIRROR_BASE_FUNCTION_CALLER_CALL_FACTORY
+#undef BOOST_MIRROR_BASE_FUNCTION_CALLER_INITIALIZE_FACTORY
+#undef BOOST_MIRROR_BASE_FUNCTION_CALLER_DECLARE_FACTORY
+
+
+} // namespace detail
+
+template <
+ template <class> class Manufacturer,
+ class ParamTypeList
+> struct functor_caller
+ : detail::base_functor_caller<
+ Manufacturer,
+ ParamTypeList,
+ mpl::int_<
+ mpl::size<ParamTypeList>::value
+ >
+>
+{
+ typedef detail::base_functor_caller<
+ Manufacturer,
+ ParamTypeList,
+ mpl::int_<
+ mpl::size<ParamTypeList>::value
+ >
+ > base_class;
+
+ template <class Param>
+ functor_caller(Param param)
+ : base_class(param)
+ { }
+};
+
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+
Modified: sandbox/mirror/boost/mirror/intrinsic/size.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/intrinsic/size.hpp (original)
+++ sandbox/mirror/boost/mirror/intrinsic/size.hpp 2008-12-13 11:39:31 EST (Sat, 13 Dec 2008)
@@ -10,6 +10,9 @@
#ifndef BOOST_MIRROR_INTRINSIC_SIZE_HPP
#define BOOST_MIRROR_INTRINSIC_SIZE_HPP
+#include <boost/mirror/meta_attributes.hpp>
+#include <boost/mirror/meta_inheritance.hpp>
+
namespace boost {
namespace mirror {
namespace detail {
Modified: sandbox/mirror/boost/mirror/meta_attributes.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_attributes.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_attributes.hpp 2008-12-13 11:39:31 EST (Sat, 13 Dec 2008)
@@ -371,7 +371,7 @@
* attributes from the base classes.
*/
template <int I, typename CharT>
- static const ::std::basic_string<CharT>& get_name(
+ static inline const ::std::basic_string<CharT>& get_name(
mpl::int_<I> pos,
mpl::false_ full_name,
::std::char_traits<CharT> cht,
@@ -391,7 +391,7 @@
}
template <int I, typename CharT>
- static const ::std::basic_string<CharT>& get_name(
+ static inline const ::std::basic_string<CharT>& get_name(
mpl::int_<I> pos,
mpl::false_ full_name,
::std::char_traits<CharT> cht,
@@ -413,7 +413,7 @@
* from the base classes.
*/
template <class Class, int I>
- static typename result_of_get<I>::type
+ static inline typename result_of_get<I>::type
get(Class instance, mpl::int_<I> pos, mpl::bool_<true>)
{
typedef typename inherited_attrib_meta_class_and_pos<I>
@@ -425,7 +425,7 @@
}
template <class Class, int I>
- static typename result_of_get<I>::type
+ static inline typename result_of_get<I>::type
get(Class instance, mpl::int_<I> pos, mpl::bool_<false>)
{
typedef typename own_attrib_meta_class_and_pos<I>
@@ -438,7 +438,7 @@
* from the base classes.
*/
template <class Class, int I, typename DestType>
- static DestType&
+ static inline DestType&
query(Class instance, mpl::int_<I> pos, DestType& dest, mpl::bool_<true>)
{
typedef typename inherited_attrib_meta_class_and_pos<I>
@@ -451,7 +451,7 @@
}
template <class Class, int I, typename DestType>
- static DestType&
+ static inline DestType&
query(Class instance, mpl::int_<I> pos, DestType& dest, mpl::bool_<false>)
{
typedef typename own_attrib_meta_class_and_pos<I>
@@ -464,7 +464,7 @@
* from the base classes.
*/
template <class Class, int I, typename ValueType>
- static void
+ static inline void
set(Class& instance, mpl::int_<I> pos, ValueType value, mpl::bool_<true>)
{
typedef typename inherited_attrib_meta_class_and_pos<I>
@@ -476,7 +476,7 @@
}
template <class Class, int I, typename ValueType>
- static void
+ static inline void
set(Class& instance, mpl::int_<I> pos, ValueType value, mpl::bool_<false>)
{
typedef typename own_attrib_meta_class_and_pos<I>
@@ -587,7 +587,7 @@
* the inherited ones)
*/
template <int I, typename CharT>
- static const ::std::basic_string<CharT>& get_name(
+ static inline const ::std::basic_string<CharT>& get_name(
mpl::int_<I> pos,
mpl::false_ full_name,
::std::char_traits<CharT> cht
@@ -605,7 +605,7 @@
* the inherited ones)
*/
template <class Class, int I>
- static typename detail::template result_of_get<I>::type
+ static inline typename detail::template result_of_get<I>::type
get(Class instance, mpl::int_<I> pos)
{
return detail::get(
@@ -619,7 +619,7 @@
* the inherited ones)
*/
template <class Class, int I, typename DestType>
- static DestType&
+ static inline DestType&
query(Class instance, mpl::int_<I> pos, DestType& dest)
{
return detail::query(
@@ -634,7 +634,7 @@
* the inherited ones)
*/
template <class Class, int I, typename ValueType>
- static void
+ static inline void
set(Class& instance, mpl::int_<I> pos, ValueType value)
{
detail::set(
Added: sandbox/mirror/boost/mirror/meta_constructors.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/meta_constructors.hpp 2008-12-13 11:39:31 EST (Sat, 13 Dec 2008)
@@ -0,0 +1,137 @@
+/**
+ * \file boost/mirror/meta_constructors.hpp
+ * Meta data concerning class' constructors
+ *
+ * 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_CONSTRUCTORS_HPP
+#define BOOST_MIRROR_META_CONSTRUCTORS_HPP
+
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/preprocessor/seq/size.hpp>
+#include <boost/preprocessor/seq/seq.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/comparison/not_equal.hpp>
+#include <boost/preprocessor/seq/for_each.hpp>
+#include <boost/preprocessor/punctuation/comma_if.hpp>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+
+
+namespace boost {
+namespace mirror {
+
+template <class Class /*, class VariantTag*/ >
+struct meta_constructors;
+
+#define BOOST_MIRROR_REG_CONSTRUCTORS_BEGIN(CLASS) \
+template <> \
+struct meta_constructors< CLASS > \
+{ \
+ typedef mpl::vector0<>
+
+#define BOOST_MIRROR_REG_CONSTRUCTOR_PARAM_NAME(CONSTRUCTOR, PARAM, NAME) \
+inline static const ::std::string& get_param_name( \
+ mpl::false_, \
+ const ::std::char_traits<char>&, \
+ mpl::int_< CONSTRUCTOR >, \
+ mpl::int_< PARAM > \
+) \
+{ \
+ static ::std::string result( BOOST_PP_STRINGIZE( NAME ) ); \
+ return result; \
+} \
+inline static const ::std::wstring& get_param_name( \
+ mpl::false_, \
+ const ::std::char_traits<wchar_t>&, \
+ mpl::int_< CONSTRUCTOR >, \
+ mpl::int_< PARAM > \
+) \
+{ \
+ static ::std::wstring result( BOOST_PP_WSTRINGIZE( NAME ) ); \
+ return result; \
+}
+
+#define BOOST_MIRROR_REG_CONSTRUCTORS_END \
+ param_type_lists; \
+ template <class ConstrIndex, class ParamIndex> \
+ inline static const cts::bstring& base_param_name(ConstrIndex ci, ParamIndex pi) \
+ {\
+ return get_param_name( \
+ mpl::false_(), \
+ ::std::char_traits< cts::bchar >(), \
+ ci, \
+ pi \
+ ); \
+ } \
+};
+
+#define BOOST_MIRROR_REG_CONSTR_EXTRACT_PARAM_TYPE(R, X, TYPE_AND_NAME) \
+ BOOST_PP_COMMA_IF(BOOST_PP_NOT_EQUAL(R, 2) ) \
+ BOOST_PP_SEQ_HEAD(TYPE_AND_NAME)
+
+
+#define BOOST_MIRROR_REG_CONSTR_REG_CALL_PARAM_NAME(R, CONSTR_INDEX, TYPE_AND_NAME) \
+ BOOST_MIRROR_REG_CONSTRUCTOR_PARAM_NAME( \
+ CONSTR_INDEX, \
+ R-2, \
+ BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(TYPE_AND_NAME)) \
+ )
+
+#define BOOST_MIRROR_REG_DEFAULT_CONSTRUCTOR(CONSTR_INDEX) \
+ param_type_lists_ ## CONSTR_INDEX ; \
+ typedef mpl::vector0< \
+ > BOOST_PP_CAT(BOOST_PP_CAT(constr_, CONSTR_INDEX), _params) ;\
+ typedef mpl::push_back< \
+ BOOST_PP_CAT(param_type_lists_, CONSTR_INDEX), \
+ BOOST_PP_CAT(BOOST_PP_CAT(constr_, CONSTR_INDEX), _params) \
+ >::type
+
+#define BOOST_MIRROR_REG_CONSTRUCTOR(CONSTR_INDEX, PARAM_SEQ) \
+ param_type_lists_ ## CONSTR_INDEX ; \
+ typedef BOOST_PP_CAT(mpl::vector, BOOST_PP_SEQ_SIZE(PARAM_SEQ)) < \
+ BOOST_PP_SEQ_FOR_EACH(BOOST_MIRROR_REG_CONSTR_EXTRACT_PARAM_TYPE, 0, PARAM_SEQ) \
+ > BOOST_PP_CAT(BOOST_PP_CAT(constr_, CONSTR_INDEX), _params) ;\
+ BOOST_PP_SEQ_FOR_EACH(BOOST_MIRROR_REG_CONSTR_REG_CALL_PARAM_NAME, CONSTR_INDEX, PARAM_SEQ) \
+ typedef mpl::push_back< \
+ BOOST_PP_CAT(param_type_lists_, CONSTR_INDEX), \
+ BOOST_PP_CAT(BOOST_PP_CAT(constr_, CONSTR_INDEX), _params) \
+ >::type
+
+
+#define BOOST_MIRROR_REGISTER_NATIVE_TYPE_CONSTRUCTORS(TYPE)\
+BOOST_MIRROR_REG_CONSTRUCTORS_BEGIN( TYPE ) \
+ BOOST_MIRROR_REG_DEFAULT_CONSTRUCTOR(0) \
+ BOOST_MIRROR_REG_CONSTRUCTOR(1, ((TYPE)(init))) \
+BOOST_MIRROR_REG_CONSTRUCTORS_END
+
+BOOST_MIRROR_REGISTER_NATIVE_TYPE_CONSTRUCTORS(void)
+BOOST_MIRROR_REGISTER_NATIVE_TYPE_CONSTRUCTORS(bool)
+BOOST_MIRROR_REGISTER_NATIVE_TYPE_CONSTRUCTORS(char)
+BOOST_MIRROR_REGISTER_NATIVE_TYPE_CONSTRUCTORS(unsigned char)
+BOOST_MIRROR_REGISTER_NATIVE_TYPE_CONSTRUCTORS(signed char)
+BOOST_MIRROR_REGISTER_NATIVE_TYPE_CONSTRUCTORS(wchar_t)
+BOOST_MIRROR_REGISTER_NATIVE_TYPE_CONSTRUCTORS(short int)
+BOOST_MIRROR_REGISTER_NATIVE_TYPE_CONSTRUCTORS(unsigned short int)
+BOOST_MIRROR_REGISTER_NATIVE_TYPE_CONSTRUCTORS(int)
+BOOST_MIRROR_REGISTER_NATIVE_TYPE_CONSTRUCTORS(unsigned int)
+BOOST_MIRROR_REGISTER_NATIVE_TYPE_CONSTRUCTORS(long int)
+BOOST_MIRROR_REGISTER_NATIVE_TYPE_CONSTRUCTORS(unsigned long int)
+BOOST_MIRROR_REGISTER_NATIVE_TYPE_CONSTRUCTORS(float)
+BOOST_MIRROR_REGISTER_NATIVE_TYPE_CONSTRUCTORS(double)
+
+BOOST_MIRROR_REGISTER_NATIVE_TYPE_CONSTRUCTORS(::std::string)
+BOOST_MIRROR_REGISTER_NATIVE_TYPE_CONSTRUCTORS(::std::wstring)
+
+#undef BOOST_MIRROR_REGISTER_NATIVE_TYPE_CONSTRUCTORS
+
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+
Modified: sandbox/mirror/boost/mirror/meta_namespace.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_namespace.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_namespace.hpp 2008-12-13 11:39:31 EST (Sat, 13 Dec 2008)
@@ -133,6 +133,7 @@
template < >
struct meta_namespace< namespace_ :: _ > : namespace_ :: _
{
+ typedef meta_namespace< namespace_ :: _ > scope;
typedef mpl::vector0<> ancestors;
};
@@ -191,7 +192,7 @@
_, \
BOOST_PP_SEQ_POP_BACK(NAME_SEQUENCE) \
) :: _ parent_placeholder; /* -4- */ \
- static const ::std::string& get_name( \
+ static inline const ::std::string& get_name( \
mpl::false_, \
::std::char_traits<char> \
) \
@@ -203,7 +204,7 @@
)); \
return s_name; \
} \
- static const ::std::wstring& get_name( \
+ static inline const ::std::wstring& get_name( \
mpl::false_, \
::std::char_traits<wchar_t> \
) \
Modified: sandbox/mirror/boost/mirror/traversal.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/traversal.hpp (original)
+++ sandbox/mirror/boost/mirror/traversal.hpp 2008-12-13 11:39:31 EST (Sat, 13 Dec 2008)
@@ -31,7 +31,7 @@
>::type* InstancePtr;
public:
template <class VisitorType>
- static void accept(
+ static inline void accept(
VisitorType visitor,
InstancePtr ptr_to_inst = 0
)
@@ -40,7 +40,7 @@
}
template <class VisitorType>
- static void accept(
+ static inline void accept(
reference_wrapper<VisitorType> visitor,
InstancePtr ptr_to_inst = 0
)
@@ -49,7 +49,7 @@
}
private:
template <class VisitorType>
- static void do_accept(
+ static inline void do_accept(
reference_wrapper<VisitorType> visitor,
InstancePtr ptr_to_inst
)
@@ -100,7 +100,7 @@
>::type* InstancePtr;
public:
template <class VisitorType>
- static void accept(
+ static inline void accept(
VisitorType visitor,
InstancePtr ptr_to_inst = 0
)
@@ -108,7 +108,7 @@
do_accept(ref<VisitorType>(visitor), ptr_to_inst);
}
template <class VisitorType>
- static void accept(
+ static inline void accept(
reference_wrapper<VisitorType> visitor,
InstancePtr ptr_to_inst = 0
)
@@ -117,7 +117,7 @@
}
private:
template <class VisitorType>
- static void do_accept(
+ static inline void do_accept(
reference_wrapper<VisitorType> visitor,
InstancePtr ptr_to_inst
)
Modified: sandbox/mirror/doc/html/mirror/non_boost_book/concepts/ontology.xml
==============================================================================
--- sandbox/mirror/doc/html/mirror/non_boost_book/concepts/ontology.xml (original)
+++ sandbox/mirror/doc/html/mirror/non_boost_book/concepts/ontology.xml 2008-12-13 11:39:31 EST (Sat, 13 Dec 2008)
@@ -341,9 +341,9 @@
>
</role>
- <!-- MetaScope is MetaNamedObject -->
+ <!-- MetaScope is MetaNamedScopedObject -->
<role
- subject="MetaNamedObject"
+ subject="MetaNamedScopedObject"
type="Specialization"
object="MetaScope"
>
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