4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
6 // The contents of this file are subject to the Fraunhofer FOKUS Public License
7 // Version 1.0 (the "License"); you may not use this file except in compliance
8 // with the License. You may obtain a copy of the License at
9 // http://senf.berlios.de/license.html
11 // The Fraunhofer FOKUS Public License Version 1.0 is based on,
12 // but modifies the Mozilla Public License Version 1.1.
13 // See the full license text for the amendments.
15 // Software distributed under the License is distributed on an "AS IS" basis,
16 // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
17 // for the specific language governing rights and limitations under the License.
19 // The Original Code is Fraunhofer FOKUS code.
21 // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V.
22 // (registered association), Hansastraße 27 c, 80686 Munich, Germany.
25 // Stefan Bund <g0dil@berlios.de>
29 \brief type_traits Boost.Preprocesser external iteration include */
31 #if !BOOST_PP_IS_ITERATING && !defined(MPP_type_traits_)
32 #define MPP_type_traits_ 1
35 #include <boost/preprocessor/iteration/iterate.hpp>
36 #include <boost/preprocessor/repetition/enum.hpp>
37 #include <boost/preprocessor/cat.hpp>
38 #include <boost/preprocessor/arithmetic/inc.hpp>
39 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
40 #include <boost/preprocessor/punctuation/comma_if.hpp>
41 #include <boost/preprocessor/arithmetic/dec.hpp>
42 #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
43 #include <boost/preprocessor/repetition/enum_params.hpp>
45 //-///////////////////////////mpp.p////////////////////////////////////////
46 #elif BOOST_PP_IS_ITERATING //-////////////////////////////////////////////
47 //-////////////////////////////////////////////////////////////////////////
50 #define mpp_Arg(n) BOOST_PP_CAT(BOOST_PP_CAT(arg, BOOST_PP_INC(n)), _type)
52 #define mpp_OtherArgs_(z,n,d) BOOST_PP_COMMA_IF( BOOST_PP_DEC(n) ) typename traits::mpp_Arg(n)
53 #define mpp_OtherArgs() BOOST_PP_REPEAT_FROM_TO( 1, BOOST_PP_ITERATION(), mpp_OtherArgs_, _ )
55 #define mpp_ArgN() BOOST_PP_ITERATION()
56 #define mpp_CurArg() mpp_Arg(BOOST_PP_ITERATION())
58 #define mpp_TrailTplArgs() BOOST_PP_ENUM_TRAILING_PARAMS( BOOST_PP_ITERATION(), class A )
59 #define mpp_Args() BOOST_PP_ENUM_PARAMS( BOOST_PP_ITERATION(), A )
61 //-////////////////////////////////////////////////////////////////////////
62 #if BOOST_PP_ITERATION_FLAGS()==1 //-//////////////////////////////////////
63 //-////////////////////////////////////////////////////////////////////////
65 template <class Traits>
66 struct function_traits_remove_arg<Traits, mpp_ArgN()>
68 typedef Traits traits;
69 typedef boost::function_traits<typename traits::result_type( mpp_OtherArgs() )> type;
72 template < class C, class RV mpp_TrailTplArgs()>
73 struct remove_member_pointer<RV (C::*)(mpp_Args())>
75 typedef RV type (mpp_Args());
78 template < class C, class RV mpp_TrailTplArgs() >
79 struct member_class<RV (C::*)(mpp_Args())>
84 template <class Traits>
85 struct function_traits_arg_type<Traits, mpp_ArgN(), true>
87 typedef typename Traits::mpp_CurArg() type;
90 template <class C, class T mpp_TrailTplArgs() >
91 struct remove_member_pointer <T (C::*)( mpp_Args() ) const>
93 typedef T type (mpp_Args());
96 template <class C, class T mpp_TrailTplArgs() >
97 struct remove_member_pointer <T (C::* const)( mpp_Args() ) const>
99 typedef T type (mpp_Args());
102 //-////////////////////////////////////////////////////////////////////////
103 #endif //-/////////////////////////////////////////////////////////////////
104 //-////////////////////////////////////////////////////////////////////////
105 // Undefine local Macros
108 #undef mpp_TrailTplArgs
112 #undef mpp_OtherArgs_
115 //-////////////////////////////////////////////////////////////////////////
117 (save-excursion (re-search-backward "^// Undefine local Macros")
118 (forward-line 1) (delete-region (point) (progn (search-forward
119 "//-////") (forward-line -1) (point))) (insert "\n") (let ((b (point))
120 (e (progn (insert (save-excursion (re-search-backward
121 "^// Local Macros") (search-forward "#define") (beginning-of-line)
122 (buffer-substring (point) (progn (search-forward "//-////")
123 (search-backward "#define") (forward-line 1) (point))))) (point))))
124 (reverse-region b e) (shell-command-on-region b e "grep -F '#define'" nil
125 t) (goto-char b) (while (looking-at "#define") (delete-char 7) (insert
126 "#undef") (skip-chars-forward " ") (re-search-forward "[^a-zA-Z0-9_]")
127 (delete-region (1- (point)) (progn (end-of-line) (point))) (forward-line
130 #endif //-/////////////////////////////////////////////////////////////////
131 //-///////////////////////////mpp.e////////////////////////////////////////
137 // comment-column: 40
138 // c-file-style: "senf"
139 // indent-tabs-mode: nil
140 // ispell-local-dictionary: "american"
141 // compile-command: "scons -u test"