return detail::VariableNodeCreator<Variable>::add(node, name, var.get());
}
+template <class Variable, class Owner>
+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 *)
+{
+ return detail::VariableNodeCreator<Variable>::add(node, name, var);
+}
+
#endif
///////////////////////////////cti.e///////////////////////////////////////
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(
+ DirectoryNode & node, Owner & owner, std::string const & name, Variable & var, int,
+ typename boost::disable_if< boost::is_convertible<Variable*, ScopedDirectoryBase*> >::type * = 0);
+
#endif
/** \brief Variable command attributes (const)
.formatter(&testFormatter);
}
+namespace {
+
+ class Test2
+ {
+ public:
+ senf::console::ScopedDirectory<Test2> dir;
+
+ Test2() : dir(this), var_(0)
+ { dir.add("var", var_); }
+
+ private:
+ int var_;
+ };
+
+}
+
+BOOST_AUTO_UNIT_TEST(memberVariables)
+{
+ Test2 test2ob;
+}
+
#ifdef COMPILE_CHECK
COMPILE_FAIL(constVariable)