|
static std::set< actualOption > | getAllOptions () |
| Provides a way to iterate over the possible options.
|
|
static std::set< actualOption > | getMostOptions () |
| Provides a way to iterate over the possible options minus those that are very unlikely to be on interest.
|
|
static size_t | maxStringLength () |
| Returns the number of characters in the string representation of the longest option.
|
|
template<class OutputContainer = std::set<actualOption>> |
static OutputContainer | parseOptions (const std::string &optionsString) |
| Converts a string of options to a set of enums.
|
|
template<bool lowercase = false> |
static actualOption | parseOptionExact (const std::string &optionString) |
| Converts a string to an enum.
|
|
template<typename actualOption>
class autopas::options::Option< actualOption >
Base class for autopas options.
- Template Parameters
-
actualOption | Curiously recurring template pattern. |
template<typename actualOption >
template<bool lowercase = false>
Converts a string to an enum.
This function works faster than parseOptions, however, the given string needs to match exactly an option.
- Template Parameters
-
lowercase | if set to true all option names are transformed to lower case. |
- Parameters
-
- Returns
- Option enum.
template<typename actualOption >
template<class OutputContainer = std::set<actualOption>>
Converts a string of options to a set of enums.
For best results, the options are expected to be lower case.
Allowed delimiters can be found in autopas::utils::StringUtils::delimiters. Possible options can be found in getAllOptions().
This function uses the Needleman-Wunsch algorithm to find the closest matching options. If an option is ambiguous an exception is thrown.
- Note
- If the only token in the string is "all", all options will be returned.
- Template Parameters
-
OutputContainer | Type of the container in which the parsed values are stored. By default this will be a std::set to avoid duplicated but if ordering is important a std::vector could be used. |
- Parameters
-
optionsString | String containing traversal options. |
- Returns
- Container of option enums. If no valid option was found the empty set is returned.