1 #ifndef STAN_SERVICES_ARGUMENTS_SINGLETON_ARGUMENT_HPP
2 #define STAN_SERVICES_ARGUMENTS_SINGLETON_ARGUMENT_HPP
5 #include <boost/lexical_cast.hpp>
15 static std::string
name() {
return typeid(T).
name(); }
21 static std::string
name() {
return "int"; }
26 static std::string
name() {
return "unsigned int"; }
31 static std::string
name() {
return "double"; }
36 static std::string
name() {
return "boolean"; }
41 static std::string
name() {
return "string"; }
64 if ( (args.back() ==
"help") || (args.back() ==
"help-all") ) {
78 T proposed_value = boost::lexical_cast<T>(
value);
81 std::stringstream message;
82 message << proposed_value
83 <<
" is not a valid value for "
84 <<
"\"" <<
_name <<
"\"";
100 base_arg->
print(w, 0,
"");
106 base_arg->
print(w, 0,
"");
114 const std::string& prefix,
115 std::vector<std::string>& valid_paths) {
132 return boost::lexical_cast<std::string>(
_value);
singleton_argument< unsigned int > u_int_argument
Probability, optimization and sampling library.
static std::string name()
singleton_argument(const std::string name)
static void split_arg(const std::string &arg, std::string &name, std::string &value)
Template specification of functions in std for Stan.
static std::string name()
virtual void print_help(interface_callbacks::writer::base_writer &w, const int depth, const bool recurse=false)
static std::string name()
std::string print_valid()
singleton_argument< std::string > string_argument
singleton_argument< bool > bool_argument
base_writer is an abstract base class defining the interface for Stan writer callbacks.
singleton_argument< double > real_argument
void find_arg(const std::string &name, const std::string &prefix, std::vector< std::string > &valid_paths)
bool parse_args(std::vector< std::string > &args, interface_callbacks::writer::base_writer &info, interface_callbacks::writer::base_writer &err, bool &help_flag)
static std::string name()
virtual void probe_args(argument *base_arg, stan::interface_callbacks::writer::base_writer &w)
bool set_value(const T &value)
virtual void print(interface_callbacks::writer::base_writer &w, const int depth, const std::string &prefix)=0
virtual bool is_valid(T value)
static std::string name()
singleton_argument< int > int_argument
static std::string name()
std::string print_value()