Options metadata for a class. More...
#include <options.hpp>
Extra doc: https://github.com/casadi/casadi/wiki/L_x9
Definition at line 40 of file options.hpp.
Classes | |
struct | Entry |
Public Member Functions | |
const Options::Entry * | find (const std::string &name) const |
std::vector< std::string > | all () const |
std::string | type (const std::string &name) const |
std::string | info (const std::string &name) const |
void | disp (std::ostream &stream) const |
std::vector< std::string > | suggestions (const std::string &word, casadi_int amount=5) const |
Get the best suggestions for a misspelled word. More... | |
void | best_matches (const std::string &word, std::vector< std::pair< double, std::string > > &best) const |
Find best matches. More... | |
void | check (const Dict &opts) const |
Check if options exist. More... | |
void | print_all (std::ostream &stream) const |
Print list of options. More... | |
void | print_one (const std::string &name, std::ostream &stream) const |
Print all information there is to know about a certain option. More... | |
Static Public Member Functions | |
static double | word_distance (const std::string &a, const std::string &b) |
A distance metric between two words. More... | |
static bool | has_dot (const Dict &opts) |
Does the dictionary contain a dot. More... | |
static bool | has_null (const Dict &opts) |
Does the dictionary has null objects. More... | |
static bool | is_sane (const Dict &opts) |
Is the dictionary sane. More... | |
static Dict | sanitize (const Dict &opts, bool top_level=true) |
Sanitize a options dictionary. More... | |
Public Attributes | |
std::vector< const Options * > | bases |
std::map< std::string, Entry > | entries |
std::vector< std::string > casadi::Options::all | ( | ) | const |
Definition at line 283 of file options.cpp.
References entries.
Referenced by casadi::conic_options(), casadi::nlpsol_options(), and casadi::rootfinder_options().
void casadi::Options::best_matches | ( | const std::string & | word, |
std::vector< std::pair< double, std::string > > & | best | ||
) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_xc
Definition at line 127 of file options.cpp.
References bases, entries, and word_distance().
Referenced by suggestions().
void casadi::Options::check | ( | const Dict & | opts | ) | const |
Definition at line 240 of file options.cpp.
References find(), casadi::GenericType::get_type_description(), print_one(), suggestions(), and casadi::Options::Entry::type.
Referenced by casadi::ProtoFunction::construct(), and casadi::ImporterInternal::construct().
void casadi::Options::disp | ( | std::ostream & | stream | ) | const |
Definition at line 57 of file options.cpp.
References bases, and entries.
Referenced by print_all().
const Options::Entry * casadi::Options::find | ( | const std::string & | name | ) | const |
Definition at line 32 of file options.cpp.
References bases, and entries.
Referenced by check(), casadi::ProtoFunction::has_option(), info(), print_one(), and type().
|
static |
Definition at line 151 of file options.cpp.
Referenced by is_sane(), and sanitize().
|
static |
std::string casadi::Options::info | ( | const std::string & | name | ) | const |
Definition at line 295 of file options.cpp.
References casadi::Options::Entry::description, and find().
Referenced by casadi::conic_option_info(), casadi::nlpsol_option_info(), and casadi::rootfinder_option_info().
|
static |
Definition at line 169 of file options.cpp.
References has_dot(), and has_null().
Referenced by casadi::ProtoFunction::construct(), and casadi::ImporterInternal::construct().
void casadi::Options::print_all | ( | std::ostream & | stream | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_xd
Definition at line 268 of file options.cpp.
References disp().
Referenced by casadi::ProtoFunction::print_options().
void casadi::Options::print_one | ( | const std::string & | name, |
std::ostream & | stream | ||
) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_xe
Definition at line 274 of file options.cpp.
References casadi::Options::Entry::disp(), and find().
Referenced by check(), and casadi::ProtoFunction::print_option().
Definition at line 173 of file options.cpp.
References has_dot(), has_null(), casadi::GenericType::is_dict(), and casadi::update_dict().
Referenced by casadi::IpoptInterface::codegen_body(), casadi::ProtoFunction::construct(), casadi::ImporterInternal::construct(), casadi::AlpaqaInterface::init(), and casadi::IpoptInterface::init_mem().
std::vector< std::string > casadi::Options::suggestions | ( | const std::string & | word, |
casadi_int | amount = 5 |
||
) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_xb
Definition at line 105 of file options.cpp.
References best_matches(), and casadi::inf.
Referenced by check().
std::string casadi::Options::type | ( | const std::string & | name | ) | const |
Definition at line 289 of file options.cpp.
References find(), casadi::GenericType::get_type_description(), and casadi::Options::Entry::type.
Referenced by casadi::conic_option_type(), casadi::nlpsol_option_type(), and casadi::rootfinder_option_type().
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_xa
Levenshtein edit distance
Definition at line 69 of file options.cpp.
Referenced by best_matches().
std::vector<const Options*> casadi::Options::bases |
Definition at line 43 of file options.hpp.
Referenced by best_matches(), disp(), and find().
std::map<std::string, Entry> casadi::Options::entries |
Definition at line 55 of file options.hpp.
Referenced by all(), best_matches(), disp(), and find().