/****************************************************************************** License: GNU General Public License v3.0 only Copyright: (C) 2008 - 2021 Alexander Shaduri ******************************************************************************/ /// \file /// \author Alexander Shaduri /// \ingroup applib /// \weakgroup applib /// @{ #include "hz/debug.h" #include "executor_factory.h" #include "smartctl_executor_gui.h" #include "cli_executors.h" ExecutorFactory::ExecutorFactory(bool use_gui, Gtk::Window* parent) : use_gui_(use_gui), parent_(parent) { } std::shared_ptr ExecutorFactory::create_executor(ExecutorFactory::ExecutorType type) { switch (type) { case ExecutorType::Smartctl: { if (use_gui_) { auto ex = std::make_shared(); ex->create_running_dialog(parent_); // dialog parent return ex; } return std::make_shared(); } case ExecutorType::TwCli: { if (use_gui_) { auto ex = std::make_shared(); ex->create_running_dialog(parent_); // dialog parent return ex; } return std::make_shared(); } case ExecutorType::ArecaCli: { if (use_gui_) { auto ex = std::make_shared(); ex->create_running_dialog(parent_); // dialog parent return ex; } return std::make_shared(); } } DBG_ASSERT(0); return std::make_shared(); } /// @}