MCPcopy Create free account
hub / github.com/Tencent/TAD_Sim / get_options

Method get_options

simcore/framework/src/cli/cli.hpp:6016–6028  ·  view source on GitHub ↗

Get the list of options (user facing function, so returns raw pointers), has optional filter function

Source from the content-addressed store, hash-verified

6014
6015 /// Get the list of options (user facing function, so returns raw pointers), has optional filter function
6016 std::vector<const Option *> get_options(const std::function<bool(const Option *)> filter = {}) const {
6017 std::vector<const Option *> options(options_.size());
6018 std::transform(std::begin(options_), std::end(options_), std::begin(options),
6019 [](const Option_p &val) { return val.get(); });
6020
6021 if (filter) {
6022 options.erase(
6023 std::remove_if(std::begin(options), std::end(options), [&filter](const Option *opt) { return !filter(opt); }),
6024 std::end(options));
6025 }
6026
6027 return options;
6028 }
6029
6030 /// Non-const version of the above
6031 std::vector<Option *> get_options(const std::function<bool(Option *)> filter = {}) {

Callers 4

to_configMethod · 0.80
make_positionalsMethod · 0.80
make_groupsMethod · 0.80
make_usageMethod · 0.80

Calls 5

beginFunction · 0.85
endFunction · 0.85
sizeMethod · 0.45
getMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected