6 #ifndef TURI_OPTION_MANAGER_H_ 7 #define TURI_OPTION_MANAGER_H_ 13 #include <model_server/lib/extensions/option_info.hpp> 35 bool allowed_overwrite =
false);
39 const std::string& description,
43 bool allowed_overwrite =
false);
47 const std::string& description,
49 const std::vector<flexible_type>& allowed_possible_values,
50 bool allowed_overwrite =
false);
54 const std::string& description,
56 bool allowed_overwrite =
false);
60 const std::string& description,
62 bool allowed_overwrite =
false);
68 const std::string& description,
70 bool allowed_overwrite =
false);
90 void set_options(
const std::map<std::string, flexible_type>& options);
121 const std::vector<option_handling::option_info>&
get_option_info()
const;
136 const std::string&
description(
const std::string& name)
const;
139 bool is_option(
const std::string& name)
const;
150 std::map<std::string, size_t> options_reference_lookup_map;
152 std::vector<option_handling::option_info> options_reference;
154 std::map<std::string, flexible_type> _current_option_values;
std::map< std::string, flexible_type > get_default_options() const
void create_integer_option(const std::string &name, const std::string &description, flexible_type default_value, flex_int lower_bound, flex_int upper_bound, bool allowed_overwrite=false)
Convenience overload for create_option.
bool is_option(const std::string &name) const
Returns true if an option exists and false otherwise.
The serialization input archive object which, provided with a reference to an istream, will read from the istream, providing deserialization capabilities.
void update_option_names(const std::map< std::string, std::string > &name_map)
void create_option(const option_handling::option_info &, bool allowed_overwrite=false)
const std::map< std::string, flexible_type > & current_option_values() const
void save(turi::oarchive &oarc) const
Serialization – save.
void create_boolean_option(const std::string &name, const std::string &description, bool default_value, bool allowed_overwrite=false)
Convenience overload for create_option.
void delete_option(const std::string &name)
const flexible_type & value(const std::string &name) const
Returns the value of the option.
void create_categorical_option(const std::string &name, const std::string &description, const flexible_type &default_value, const std::vector< flexible_type > &allowed_possible_values, bool allowed_overwrite=false)
Convenience overload for create_option.
void load(turi::iarchive &iarc)
Serialization – load.
void delete_options(const std::vector< std::string > &names)
void set_option(const std::string &name, const flexible_type &value)
void set_options(const std::map< std::string, flexible_type > &options)
The serialization output archive object which, provided with a reference to an ostream, will write to the ostream, providing serialization capabilities.
const std::vector< option_handling::option_info > & get_option_info() const
const std::string & description(const std::string &name) const
Returns the description of the option name.
void update_option_name(const std::string &old_name, const std::string &new_name)
void create_string_option(const std::string &name, const std::string &description, const flexible_type &default_value, bool allowed_overwrite=false)
Convenience overload for create_option.
void create_real_option(const std::string &name, const std::string &description, flexible_type default_value, double lower_bound, double upper_bound, bool allowed_overwrite=false)
Convenience overload for create_option.
void create_flexible_type_option(const std::string &name, const std::string &description, const flexible_type &default_value, bool allowed_overwrite=false)
Convenience overload for create_option.