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

Method run_callback

simcore/framework/src/cli/cli.hpp:6363–6386  ·  view source on GitHub ↗

Internal function to run (App) callback, bottom up

Source from the content-addressed store, hash-verified

6361 }
6362 /// Internal function to run (App) callback, bottom up
6363 void run_callback(bool final_mode = false) {
6364 pre_callback();
6365 // in the main app if immediate_callback_ is set it runs the main callback before the used subcommands
6366 if (!final_mode && parse_complete_callback_) {
6367 parse_complete_callback_();
6368 }
6369 // run the callbacks for the received subcommands
6370 for (App *subc : get_subcommands()) {
6371 subc->run_callback(true);
6372 }
6373 // now run callbacks for option_groups
6374 for (auto &subc : subcommands_) {
6375 if (subc->name_.empty() && subc->count_all() > 0) {
6376 subc->run_callback(true);
6377 }
6378 }
6379
6380 // finally run the main callback
6381 if (final_callback_ && (parsed_ > 0)) {
6382 if (!name_.empty() || count_all() > 0) {
6383 final_callback_();
6384 }
6385 }
6386 }
6387
6388 /// Check to see if a subcommand is valid. Give up immediately if subcommand max has been reached.
6389 bool _valid_subcommand(const std::string &current, bool ignore_used = true) const {

Callers 2

_process_callbacksMethod · 0.45
_parse_single_configMethod · 0.45

Calls 2

count_allMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected