//#include "Setup.ih"
// Custom includes
+#include "Jack.hh"
#define prefix_ inline
///////////////////////////////cti.p///////////////////////////////////////
connect(T & source, C & target,
typename boost::disable_if< boost::is_base_of<connector::Connector, T> >::type *,
typename boost::enable_if< boost::is_base_of<connector::Connector, C> >::type *,
- typename boost::disable_if< boost::is_base_of<connector::Jack, T> >:: type *)
+ typename boost::disable_if< boost::is_base_of<connector::Jack, T> >::type *)
{
connect(source.output, target);
}
connect(C & source, T & target,
typename boost::enable_if< boost::is_base_of<connector::Connector, C> >::type *,
typename boost::disable_if< boost::is_base_of<connector::Connector,T> >::type *,
- typename boost::disable_if< boost::is_base_of<connector::Jack, T> >:: type *)
+ typename boost::disable_if< boost::is_base_of<connector::Jack, T> >::type *)
{
connect(source, target.input);
}
connect(T1 & source, T2 & target,
typename boost::disable_if< boost::is_base_of<connector::Connector, T1> >::type *,
typename boost::disable_if< boost::is_base_of<connector::Connector, T2> >::type *,
- typename boost::disable_if< boost::is_base_of<connector::Jack, T1> >:: type *,
- typename boost::disable_if< boost::is_base_of<connector::Jack, T2> >:: type *)
+ typename boost::disable_if< boost::is_base_of<connector::Jack, T1> >::type *,
+ typename boost::disable_if< boost::is_base_of<connector::Jack, T2> >::type *)
{
connect(source.output, target.input);
}
return add(name, create());
}
+prefix_ senf::console::DirectoryNode &
+senf::console::DirectoryNode::provideDirectory(std::string const & name)
+{
+ return hasChild(name) ? getDirectory(name) : mkdir(name);
+}
+
prefix_ senf::console::DirectoryNode::ChildrenRange senf::console::DirectoryNode::children()
const
{
return node.add(name, SimpleCommandNode::create(fn));
}
+prefix_ senf::console::DirectoryNode &
+senf::console::senf_console_add_node(DirectoryNode & node, std::string const & name,
+ DirectoryNode & dir, int)
+{
+ return node.add(name, dir.thisptr());
+}
+
#endif
///////////////////////////////cci.e///////////////////////////////////////
DirectoryNode & mkdir(std::string const & name);
///< Create sub-directory node
+ DirectoryNode & provideDirectory(std::string const & name);
+ ///< Return subdirectory, possibly creating it
ChildrenRange children() const; ///< Return iterator range over all children.
/**< The returned range is sorted by child name. */
SimpleCommandNode & senf_console_add_node(DirectoryNode & node, std::string const & name,
SimpleCommandNode::Function fn, int);
+ DirectoryNode & senf_console_add_node(DirectoryNode & node, std::string const & name,
+ DirectoryNode & dir, int);
+
#endif
}}
return node.add(name, boost::bind(fn,boost::ref(owner),_1,_2));
}
+template <class Owner>
+prefix_ senf::console::DirectoryNode &
+senf::console::senf_console_add_node(DirectoryNode & node, Owner & owner,
+ std::string const & name, DirectoryNode & dir, int)
+{
+ return node.add(name, dir.thisptr());
+}
+
template <class Node>
prefix_ senf::console::DirectoryNode & senf::console::
senf_console_add_node(DirectoryNode & dir, std::string const & name, Node const & node, int,
DirectoryNode & node, Owner & owner, std::string const & name,
void (Owner::*fn)(std::ostream &, ParseCommandInfo const &), int);
+ template <class Owner>
+ DirectoryNode & senf_console_add_node(DirectoryNode & node, Owner & owner,
+ std::string const & name, DirectoryNode & dir, int);
+
template <class Node>
DirectoryNode & senf_console_add_node(
DirectoryNode & dir, std::string const & name, Node const & node, int,
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 *,
typename boost::disable_if_c<detail::ParsedCommandTraits<Variable>::is_callable>::type *)
{
return detail::VariableNodeCreator<Variable>::add(node, name, var);
template <class Variable, class Owner>
prefix_ senf::console::VariableAttributor<Variable> senf::console::
-senf_console_add_node(DirectoryNode & node, Owner &, std::string const & name,
+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 *,
+ 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>::add(node, name, var);
class ScopedDirectoryBase;
template <class Variable> class VariableAttributor;
+
+
#ifndef DOXYGEN
template <class Variable>
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>
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>