template<typename T = std::monostate>
class seastar::program_options::selection_value< T >
A selection value, allows selection from multiple candidates.
The candidates objects are of an opaque type which may not accessible to whoever is choosing between the available candidates. This allows the user selecting between seastar internal types without exposing them. Each candidate has a name, which is what the users choose based on. Each candidate can also have an associated option_group containing related candidate-specific configuration options, allowing further configuring the selected candidate. The code exposing the candidates should document the concrete types these can be down-casted to.
|
| selection_value (option_group &group, std::string name, candidates candidates, std::string default_candidate, std::string description) |
|
| selection_value (option_group &group, std::string name, candidates candidates, std::string description) |
|
| selection_value (option_group &group, std::string name, unused) |
| Construct an unused value.
|
|
| operator bool () const |
| Was there a candidate selected (default also counts)?
|
|
bool | defaulted () const |
| Is the currently selected candidate the default one?
|
|
const std::string & | get_selected_candidate_name () const |
| Get the name of the currently selected candidate (assumes there is one selected, see \operator bool()).
|
|
const option_group * | get_selected_candidate_opts () const |
| Get the options of the currently selected candidate (assumes there is one selected, see \operator bool()).
|
|
option_group * | get_selected_candidate_opts () |
| Get the options of the currently selected candidate (assumes there is one selected, see \operator bool()).
|
|
T & | get_selected_candidate () const |
|
option_group * | select_candidate (std::string candidate_name) |
|
option_group * | select_default_candidate (std::string candidate_name) |
|
bool | used () const |
|
const std::string & | name () const |
|
const std::string & | description () const |
|
void | describe (options_descriptor &descriptor) const |
|
void | mutate (options_mutator &mutator) |
|