template <class Owner>
template <class Object>
-prefix_ typename senf::console::OwnerNodeCreateTraits<Owner, Object>::result_type
+prefix_ typename senf::console::OwnerNodeCreateTraits<Owner, Object const>::result_type
senf::console::ScopedDirectory<Owner>::add(std::string const & name, Object const & ob)
{
return OwnerNodeCreateTraits<Owner, Object const>::Creator::create(node(), *owner_, name, ob);
///////////////////////////////////////////////////////////////////////////
template <class Object>
- typename OwnerNodeCreateTraits<Owner, Object>::result_type add(std::string const & name,
- Object const & ob);
+ typename OwnerNodeCreateTraits<Owner, Object const>::result_type add(
+ std::string const & name, Object const & ob);
///< Create new child node
/**< Adds a new child node to the (proxied)
DirectoryNode. How the node is added is configured
directory node. */
template <class Object>
- typename OwnerNodeCreateTraits<Owner, Object>::result_type add(std::string const & name,
- Object & ob);
+ typename OwnerNodeCreateTraits<Owner, Object>::result_type add(
+ std::string const & name, Object & ob);
///< Create new child node
/**< \see add() */
prefix_ senf::console::ConstVariableAttributor<Variable>
senf::console::detail::VariableNodeCreator<Variable, true>::add(DirectoryNode & node,
std::string const & name,
- Variable & var)
+ Variable const & var)
{
typename VariableAttributor<Variable>::QueryOverload & queryOverload (
node.add(name, typename detail::QueryVariable<Variable>::Function(
#ifndef DOXYGEN
template <class Variable>
-prefix_ senf::console::VariableAttributor<Variable> senf::console::
+prefix_ typename senf::console::detail::VariableNodeCreator<Variable>::result_type
+senf::console::
senf_console_add_node(DirectoryNode & node, std::string const & name, Variable & var, int,
typename boost::disable_if< boost::is_convertible<Variable*, ScopedDirectoryBase*> >::type *,
typename boost::disable_if< boost::is_convertible<Variable*, GenericNode*> >::type *,
}
template <class Variable>
+prefix_ typename senf::console::detail::VariableNodeCreator<Variable const>::result_type
+senf::console::
+senf_console_add_node(DirectoryNode & node, std::string const & name, Variable const & var, int,
+ typename boost::disable_if< boost::is_convertible<Variable*, ScopedDirectoryBase*> >::type *,
+ typename boost::disable_if< boost::is_convertible<Variable*, GenericNode*> >::type *,
+ typename boost::disable_if_c<detail::ParsedCommandTraits<Variable>::is_callable>::type *)
+{
+ return detail::VariableNodeCreator<Variable const>::add(node, name, var);
+}
+
+template <class Variable>
prefix_ typename senf::console::detail::VariableNodeCreator<Variable>::result_type
-senf::console::senf_console_add_node(DirectoryNode & node, std::string const & name,
- boost::reference_wrapper<Variable> var, int)
+senf::console::
+senf_console_add_node(DirectoryNode & node, std::string const & name,
+ boost::reference_wrapper<Variable> var, int)
{
return detail::VariableNodeCreator<Variable>::add(node, name, var.get());
}
template <class Variable, class Owner>
-prefix_ senf::console::VariableAttributor<Variable> senf::console::
+prefix_ typename senf::console::detail::VariableNodeCreator<Variable>::result_type
+senf::console::
senf_console_add_node(DirectoryNode & node, Owner & owner, std::string const & name,
Variable & var, int,
typename boost::disable_if< boost::is_convertible<Variable*, ScopedDirectoryBase*> >::type *,
}
template <class Variable, class Owner>
+prefix_ typename senf::console::detail::VariableNodeCreator<Variable const>::result_type
+senf::console::
+senf_console_add_node(DirectoryNode & node, Owner & owner, std::string const & name,
+ Variable const & var, int,
+ typename boost::disable_if< boost::is_convertible<Variable*, ScopedDirectoryBase*> >::type *,
+ typename boost::disable_if< boost::is_convertible<Variable*, GenericNode*> >::type *,
+ typename boost::disable_if_c<detail::ParsedCommandTraits<Variable>::is_callable>::type *)
+{
+ return detail::VariableNodeCreator<Variable const>::add(node, name, var);
+}
+
+template <class Variable, class Owner>
prefix_ typename senf::console::detail::VariableNodeCreator<Variable>::result_type
senf::console::senf_console_add_node(DirectoryNode & node, Owner &,
std::string const & name,
#ifndef DOXYGEN
template <class Variable>
- VariableAttributor<Variable> senf_console_add_node(
+ typename detail::VariableNodeCreator<Variable>::result_type
+ senf_console_add_node(
DirectoryNode & node, std::string const & name, Variable & var, int,
typename boost::disable_if< boost::is_convertible<Variable*, ScopedDirectoryBase*> >::type * = 0,
typename boost::disable_if< boost::is_convertible<Variable*, GenericNode*> >::type * = 0,
typename boost::disable_if_c<detail::ParsedCommandTraits<Variable>::is_callable>::type * = 0);
template <class Variable>
+ typename detail::VariableNodeCreator<Variable const>::result_type
+ senf_console_add_node(
+ DirectoryNode & node, std::string const & name, Variable const & var, int,
+ typename boost::disable_if< boost::is_convertible<Variable*, ScopedDirectoryBase*> >::type * = 0,
+ typename boost::disable_if< boost::is_convertible<Variable*, GenericNode*> >::type * = 0,
+ typename boost::disable_if_c<detail::ParsedCommandTraits<Variable>::is_callable>::type * = 0);
+
+ template <class Variable>
typename detail::VariableNodeCreator<Variable>::result_type
senf_console_add_node(DirectoryNode & node, std::string const & name,
boost::reference_wrapper<Variable> var, int);
template <class Variable, class Owner>
- VariableAttributor<Variable> senf_console_add_node(
+ typename detail::VariableNodeCreator<Variable>::result_type
+ senf_console_add_node(
DirectoryNode & node, Owner & owner, std::string const & name, Variable & var, int,
typename boost::disable_if< boost::is_convertible<Variable*, ScopedDirectoryBase*> >::type * = 0,
typename boost::disable_if< boost::is_convertible<Variable*, GenericNode*> >::type * = 0,
typename boost::disable_if_c<detail::ParsedCommandTraits<Variable>::is_callable>::type * = 0);
template <class Variable, class Owner>
+ typename detail::VariableNodeCreator<Variable const>::result_type
+ senf_console_add_node(
+ DirectoryNode & node, Owner & owner, std::string const & name, Variable const & var, int,
+ typename boost::disable_if< boost::is_convertible<Variable*, ScopedDirectoryBase*> >::type * = 0,
+ typename boost::disable_if< boost::is_convertible<Variable*, GenericNode*> >::type * = 0,
+ typename boost::disable_if_c<detail::ParsedCommandTraits<Variable>::is_callable>::type * = 0);
+
+ template <class Variable, class Owner>
typename detail::VariableNodeCreator<Variable>::result_type
senf_console_add_node(DirectoryNode & node, Owner & owner, std::string const & name,
boost::reference_wrapper<Variable> var, int);
{
typedef ConstVariableAttributor<Variable> result_type;
static ConstVariableAttributor<Variable> add(DirectoryNode & node, std::string const & name,
- Variable & var);
+ Variable const & var);
};
#endif
void timeout();
enum Command {
- CMD_NONE = 0,
- CMD_SE = 240,
- CMD_NOP = 241,
- CMD_DM = 242,
- CMD_BRK = 243,
- CMD_IP = 244,
- CMD_AO = 245,
- CMD_AYT = 246,
- CMD_EC = 247,
- CMD_EL = 248,
- CMD_GA = 249,
- CMD_SB = 250,
- CMD_WILL = 251,
- CMD_WONT = 252,
- CMD_DO = 253,
- CMD_DONT = 254,
- CMD_IAC = 255,
+ CMD_NONE = static_cast<char>(0),
+ CMD_SE = static_cast<char>(240),
+ CMD_NOP = static_cast<char>(241),
+ CMD_DM = static_cast<char>(242),
+ CMD_BRK = static_cast<char>(243),
+ CMD_IP = static_cast<char>(244),
+ CMD_AO = static_cast<char>(245),
+ CMD_AYT = static_cast<char>(246),
+ CMD_EC = static_cast<char>(247),
+ CMD_EL = static_cast<char>(248),
+ CMD_GA = static_cast<char>(249),
+ CMD_SB = static_cast<char>(250),
+ CMD_WILL = static_cast<char>(251),
+ CMD_WONT = static_cast<char>(252),
+ CMD_DO = static_cast<char>(253),
+ CMD_DONT = static_cast<char>(254),
+ CMD_IAC = static_cast<char>(255),
};
struct OptInfo
typedef typename Traits::mpp_CurArg() type;
};
+template <class C, class T mpp_TrailTplArgs() >
+struct remove_member_pointer <T (C::*)( mpp_Args() ) const>
+{
+ typedef T type (mpp_Args());
+};
+
+template <class C, class T mpp_TrailTplArgs() >
+struct remove_member_pointer <T (C::* const)( mpp_Args() ) const>
+{
+ typedef T type (mpp_Args());
+};
+
// ////////////////////////////////////////////////////////////////////////
#endif // /////////////////////////////////////////////////////////////////
// ////////////////////////////////////////////////////////////////////////
///////////////////////////////cc.p////////////////////////////////////////
namespace {
- struct Class {};
+ struct Class;
}
BOOST_AUTO_UNIT_TEST(typeTraits)
>::value ));
BOOST_STATIC_ASSERT(( boost::is_same<
- senf::remove_member_pointer< int (Class::*) >::type,
- int
+ senf::remove_member_pointer< Class (Class::*) >::type,
+ Class
>::value ));
BOOST_STATIC_ASSERT(( boost::is_same<
- senf::remove_member_pointer< void (Class::*)(int) >::type,
+ senf::remove_member_pointer< Class const (Class::*) >::type,
+ Class const
+ >::value ));
+ BOOST_STATIC_ASSERT(( boost::is_same<
+ senf::remove_member_pointer< Class (Class::*)(int) >::type,
+ Class (int)
+ >::value ));
+ BOOST_STATIC_ASSERT(( boost::is_same<
+ senf::remove_member_pointer< Class const (Class::*)(int) >::type,
+ Class const (int)
+ >::value ));
+ BOOST_STATIC_ASSERT(( boost::is_same<
+ senf::remove_member_pointer< void (Class::*)(int) const>::type,
+ void (int)
+ >::value ));
+ BOOST_STATIC_ASSERT(( boost::is_same<
+ senf::remove_member_pointer< Class const (Class::*)(int) const>::type,
+ Class const (int)
+ >::value ));
+ BOOST_STATIC_ASSERT(( boost::is_same<
+ senf::remove_member_pointer< void (Class::* const)(int)>::type,
+ void (int)
+ >::value ));
+ BOOST_STATIC_ASSERT(( boost::is_same<
+ senf::remove_member_pointer< void (Class::* const)(int) const>::type,
void (int)
>::value ));
BOOST_STATIC_ASSERT(( senf::is_any_function< void () >::value ));
BOOST_STATIC_ASSERT(( senf::is_any_function< void (*)(int) >::value ));
BOOST_STATIC_ASSERT(( senf::is_any_function< void (Class::*)() >::value ));
+ BOOST_STATIC_ASSERT(( senf::is_any_function< void (Class::*)() const >::value ));
BOOST_STATIC_ASSERT(( ! senf::is_any_function< int * >::value ));
BOOST_STATIC_ASSERT(( boost::is_same<