17 #ifndef HH_SENF_Utils_Console_Variables_ 18 #define HH_SENF_Utils_Console_Variables_ 1 21 #include <boost/type_traits/is_convertible.hpp> 22 #include <boost/ref.hpp> 32 class ScopedDirectoryBase;
39 template <
class Variable>
40 class ConstVariableFactory
44 typedef typename detail::QueryVariable<Variable>::Traits::Overload QueryOverload;
45 typedef typename QueryOverload::Formatter Formatter;
49 ConstVariableFactory doc(std::string
const & doc);
50 ConstVariableFactory shortdoc(std::string
const & doc);
51 ConstVariableFactory formatter(Formatter formatter);
55 explicit ConstVariableFactory(Variable
const & var);
58 typename QueryOverload::ptr queryOverload_;
59 boost::optional<std::string> doc_;
60 boost::optional<std::string> shortdoc_;
102 class VariableFactory
103 :
public ConstVariableFactory<Variable>
107 typedef typename detail::SetVariable<Variable>::Traits::Overload
SetOverload;
111 typedef typename ConstVariableFactory<Variable>::Formatter
Formatter;
112 typedef typename ConstVariableFactory<Variable>::QueryOverload
QueryOverload;
114 VariableFactory doc(std::string
const & doc);
115 VariableFactory shortdoc(std::string
const & doc);
116 VariableFactory formatter(Formatter formatter);
136 VariableFactory typeName(std::string
const &
name);
137 VariableFactory onChange(OnChangeHandler handler);
147 explicit VariableFactory(
Variable & var);
154 typename SetOverload::ptr setOverload_;
163 VariableFactory<Var>
Variable(Var & var);
166 VariableFactory<Var>
Variable(boost::reference_wrapper<Var> var);
169 ConstVariableFactory<Var>
Variable(Var
const & var);
172 ConstVariableFactory<Var>
Variable(boost::reference_wrapper<Var const> var);
unspecified_keyword_type parser
Argument parser.
Config/console tree directory node.
Command node which allows multiple registered callbacks.
ConstVariableFactory< Variable >::Formatter Formatter
ConstVariableFactory< Variable >::QueryOverload QueryOverload
detail::SetVariable< Variable >::Traits::Overload SetOverload
unspecified_keyword_type name
Argument name.
detail::SetVariable< Variable >::OnChangeHandler OnChangeHandler
detail::ArgumentInfo< typename SetOverload::arg1_type >::Parser Parser