4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief ParsedCommand internal header */
26 #ifndef IH_ParsedCommand_
27 #define IH_ParsedCommand_ 1
31 ///////////////////////////////ih.p////////////////////////////////////////
37 template <class Function, bool isFN=senf::is_any_function<Function>::value>
38 struct ParsedCommandTraits
41 template <class Traits, bool flag=(Traits::arity>0)>
47 template <class Traits>
48 struct FirstArgType<Traits,true>
50 typedef typename Traits::arg1_type type;
53 template <class Function>
54 struct ParsedCommandTraits<Function, true>
56 typedef Function base_type;
57 typedef typename senf::remove_member_pointer<
58 typename boost::remove_pointer<base_type>::type>::type function_type;
59 typedef boost::function_traits<function_type> base_traits;
61 typedef typename FirstArgType<base_traits>::type first_arg_type;
63 static const bool has_ostream_arg = boost::is_same<first_arg_type, std::ostream &>::value;
65 typedef typename boost::mpl::if_c<
67 typename function_traits_remove_arg<base_traits>::type,
71 static const bool is_member = boost::is_member_pointer<base_type>::value;
73 typedef typename senf::member_class<base_type>::type class_type;
78 ///////////////////////////////ih.e////////////////////////////////////////
86 // c-file-style: "senf"
87 // indent-tabs-mode: nil
88 // ispell-local-dictionary: "american"
89 // compile-command: "scons -u test"