MCPcopy Create free account
hub / github.com/ashaduri/gsmartcontrol / create_executor

Method create_executor

src/applib/command_executor_factory.cpp:26–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25
26std::shared_ptr<CommandExecutor> CommandExecutorFactory::create_executor(CommandExecutorFactory::ExecutorType type)
27{
28 switch (type) {
29 case ExecutorType::Smartctl:
30 {
31 if (use_gui_) {
32 auto ex = std::make_shared<SmartctlExecutorGui>();
33 ex->create_running_dialog(parent_); // dialog parent
34 return ex;
35 }
36 return std::make_shared<SmartctlExecutor>();
37 }
38 case ExecutorType::TwCli:
39 {
40 if (use_gui_) {
41 auto ex = std::make_shared<TwCliExecutorGui>();
42 ex->create_running_dialog(parent_); // dialog parent
43 return ex;
44 }
45 return std::make_shared<TwCliExecutor>();
46 }
47 case ExecutorType::ArecaCli:
48 {
49 if (use_gui_) {
50 auto ex = std::make_shared<ArecaCliExecutorGui>();
51 ex->create_running_dialog(parent_); // dialog parent
52 return ex;
53 }
54 return std::make_shared<ArecaCliExecutor>();
55 }
56 }
57
58 DBG_ASSERT(0);
59 return std::make_shared<CommandExecutor>();
60}
61
62
63

Callers 12

execute_tw_cliFunction · 0.80
execute_areca_cliFunction · 0.80
detect_drives_win32Function · 0.80
detect_drives_linux_hpsaFunction · 0.80
fetch_basic_dataMethod · 0.80

Calls 1

create_running_dialogMethod · 0.80

Tested by

no test coverage detected