namespace console {
namespace detail {
+#ifndef DOXYGEN
+
+ struct ArgumentInfoBase
+ : public intrusive_refcount
+ {
+ typedef boost::intrusive_ptr<ArgumentInfoBase> ptr;
+
+ std::string type;
+ std::string name;
+ bool hasDefault;
+ std::string doc;
+
+ ArgumentInfoBase(std::string const & type);
+
+ virtual std::string defaultValueStr() const = 0;
+ };
+
+ template <class ParameterType>
+ struct ArgumentInfo
+ : public ArgumentInfoBase
+ {
+ typedef boost::intrusive_ptr<ArgumentInfo> ptr;
+
+ static ptr create();
+ ArgumentInfo();
+
+ ParameterType defaultValue;
+
+ virtual std::string defaultValueStr() const;
+ };
+
template <class Function, bool isFN=senf::is_any_function<Function>::value>
struct ParsedCommandTraits
{};
+ // FirstArgType returns void, if the function has no arguments, otherwise it returns arg1_type
+
template <class Traits, bool flag=(Traits::arity>0)>
struct FirstArgType
{
struct ParsedCommandTraits<Function, true>
{
typedef Function base_type;
- typedef typename senf::remove_member_pointer<
- typename boost::remove_pointer<base_type>::type>::type function_type;
+ typedef typename senf::remove_any_pointer<base_type>::type function_type;
typedef boost::function_traits<function_type> base_traits;
-
typedef typename FirstArgType<base_traits>::type first_arg_type;
static const bool has_ostream_arg = boost::is_same<first_arg_type, std::ostream &>::value;
typedef typename senf::member_class<base_type>::type class_type;
};
+ template <class Type>
+ struct CheckVoidReturn
+ {
+ template <class Fn>
+ static void call(Fn fn, std::ostream & os);
+ };
+
+ template <>
+ struct CheckVoidReturn<void>
+ {
+ template <class Fn>
+ static void call(Fn fn, std::ostream & os);
+ };
+
+#endif
+
}}}
///////////////////////////////ih.e////////////////////////////////////////