//#include "Config.test.ih"
// Custom includes
-#include "Config.hh"
-#include "ScopedDirectory.hh"
-#include "ParsedCommand.hh"
-#include "ConfigFile.hh"
-#include "ProgramOptions.hh"
+#include "Console.hh"
#include <boost/filesystem/operations.hpp>
#include <senf/Utils/auto_unit_test.hh>
//#include "ConfigFile.test.ih"
// Custom includes
-#include "ConfigFile.hh"
+#include "Console.hh"
#include <fstream>
-#include "ScopedDirectory.hh"
-#include "ParsedCommand.hh"
#include <boost/filesystem/operations.hpp>
#include <senf/Utils/auto_unit_test.hh>
// Custom includes
#include <sstream>
#include <vector>
-#include "Executor.hh"
+#include "Console.hh"
#include <senf/Utils/auto_unit_test.hh>
#include <boost/test/test_tools.hpp>
// Custom includes
#include <sstream>
-#include "Node.hh"
+#include "Console.hh"
#include <boost/iterator/transform_iterator.hpp>
#include <senf/Utils/auto_unit_test.hh>
BOOST_AUTO_UNIT_TEST(senfConsoleAddNode)
{
senf::console::root().add("fn1", &callback);
- senf::console::root().add("fn2", Functor());
+ senf::console::root().add("fn2", boost::function<void(std::ostream&,senf::console::ParseCommandInfo const &)>(Functor()));
senf::console::ParseCommandInfo info;
// Custom includes
#include <sstream>
-#include "OverloadedCommand.hh"
+#include "Console.hh"
#include <senf/Utils/auto_unit_test.hh>
#include <boost/test/test_tools.hpp>
// Custom includes
#include <sstream>
-#include "Parse.hh"
+#include "Console.hh"
#include "Parse.ih"
#include <senf/Utils/String.hh>
// Custom includes
#include <iostream>
#include <sstream>
-#include "ParsedCommand.hh"
-#include "Executor.hh"
-#include "Parse.hh"
-#include "ScopedDirectory.hh"
+#include "Console.hh"
#include <senf/Utils/auto_unit_test.hh>
#include <boost/test/test_tools.hpp>
//#include "ProgramOptions.test.ih"
// Custom includes
-#include "ProgramOptions.hh"
-#include "ScopedDirectory.hh"
-#include "ParsedCommand.hh"
+#include "Console.hh"
#include <senf/Utils/auto_unit_test.hh>
#include <boost/test/test_tools.hpp>
// Custom includes
#include <boost/assign/list_of.hpp>
-#include "STLSupport.hh"
-#include "ParsedCommand.hh"
-#include "Executor.hh"
-#include "Parse.hh"
-#include "ScopedDirectory.hh"
+#include "Console.hh"
#include <senf/Utils/auto_unit_test.hh>
#include <boost/test/test_tools.hpp>
senf_console_add_node(DirectoryNode & node, Owner & owner, std::string const & name,
void (Owner::*fn)(std::ostream &, ParseCommandInfo const &), int)
{
- return node.add(name, boost::bind(fn,boost::ref(owner),_1,_2));
+ return node.add(name, boost::function<void (std::ostream&,ParseCommandInfo const &)>(
+ boost::bind(fn,boost::ref(owner),_1,_2)));
}
template <class Owner>
// Custom includes
#include <sstream>
-#include "ScopedDirectory.hh"
+#include "Console.hh"
#include <boost/iterator/transform_iterator.hpp>
#include <senf/Utils/auto_unit_test.hh>
//#include "Server.test.ih"
// Custom includes
-#include "Server.hh"
+#include "Console.hh"
#include <senf/Utils/auto_unit_test.hh>
#include <boost/test/test_tools.hpp>
//#include "Traits.test.ih"
// Custom includes
-#include "Traits.hh"
-#include "Utility.hh"
-#include "ParsedCommand.hh"
-#include "Executor.hh"
-#include "Parse.hh"
-#include "ScopedDirectory.hh"
+#include "Console.hh"
#include <senf/Utils/auto_unit_test.hh>
#include <boost/test/test_tools.hpp>
//#include "UDPServer.test.ih"
// Custom includes
-#include "UDPServer.hh"
+#include "Console.hh"
#include <senf/Utils/auto_unit_test.hh>
#include <boost/test/test_tools.hpp>
//#include "Utility.test.ih"
// Custom includes
-#include "Utility.hh"
-#include "Traits.hh"
-#include "ParsedCommand.hh"
-#include "Executor.hh"
-#include "Parse.hh"
-#include "ScopedDirectory.hh"
+#include "Console.hh"
#include <senf/Utils/auto_unit_test.hh>
#include <boost/test/test_tools.hpp>
prefix_ senf::console::ConstVariableAttributor<Variable>
senf::console::detail::VariableNodeCreator<Variable, true>::add(DirectoryNode & node,
std::string const & name,
- Variable const & var)
+ Variable & var)
{
typename VariableAttributor<Variable>::QueryOverload & queryOverload (
node.add(name, typename detail::QueryVariable<Variable>::Function(
#ifndef DOXYGEN
template <class Variable>
-prefix_ typename senf::console::detail::VariableNodeCreator<Variable>::result_type
-senf::console::
+prefix_ senf::console::VariableAttributor<Variable> 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_ typename senf::console::detail::VariableNodeCreator<Variable>::result_type
-senf::console::
+prefix_ senf::console::VariableAttributor<Variable> 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>
- typename detail::VariableNodeCreator<Variable>::result_type
- senf_console_add_node(
+ VariableAttributor<Variable> 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>
- typename detail::VariableNodeCreator<Variable>::result_type
- senf_console_add_node(
+ VariableAttributor<Variable> 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 const & var);
+ Variable & var);
};
#endif
senf::console::ScopedDirectory<Test2> dir;
Test2() : dir(this), var_(0)
- { dir.add("var", var_); }
+ { dir.add("var", boost::ref(var_)); }
private:
int var_;