OpenMS
|
Scans for tools/utils and generates a param for each asynchronously. More...
#include <OpenMS/VISUAL/TVToolDiscovery.h>
Public Member Functions | |
TVToolDiscovery () | |
TVToolDiscovery (const TVToolDiscovery &)=delete | |
TVToolDiscovery & | operator= (const TVToolDiscovery &)=delete |
~TVToolDiscovery ()=default | |
void | loadToolParams () |
Start creating params for each tool/util asynchronously. More... | |
void | waitForToolParams () |
Wait for all future params to finish evaluating. More... | |
void | waitForPluginParams () |
const Param & | getToolParams () |
Returns a Param object containing the params for each tool/util. More... | |
const Param & | getPluginParams () |
Returns a param containing the params for each plugin. More... | |
const std::vector< std::string > & | getPlugins () |
Returns the list of read plugin names as saved in the ini. More... | |
bool | setPluginPath (const String &path, bool create=false) |
Sets the path that will be searched for Plugins. More... | |
void | setVerbose (int verbosity_level) |
set the verbosity level of the tool discovery for debug purposes More... | |
const std::string | getPluginPath () |
Returns the current set path to search plugins in. More... | |
std::string | findPluginExecutable (const std::string &name) |
Returns the path to the plugin executable or an empty string if the plugin name is unknown. More... | |
Private Member Functions | |
void | loadPluginParams () |
const StringList | getPlugins_ () |
Returns a list of executables that are found at the plugin path. More... | |
Static Private Member Functions | |
static Param | getParamFromIni_ (const String &tool_path, bool plugins=false) |
Private Attributes | |
std::string | plugin_path_ |
The filepath to search pugins in. More... | |
std::vector< std::future< Param > > | tool_param_futures_ |
The futures for asyncronous loading of the tools/utils and plugins. More... | |
std::vector< std::future< Param > > | plugin_param_futures_ |
Param | tool_params_ |
Contains all the params of the tools/utils. More... | |
Param | plugin_params_ |
Contains all the params of the plugins. More... | |
std::vector< std::string > | plugins_ |
The names of all loaded plugins, this is used to add the plugins to the list in the ToolsDialog. More... | |
int | verbosity_level_ = 0 |
Set to value > 0 to output tool discovery debug information. More... | |
Scans for tools/utils and generates a param for each asynchronously.
All tools and utils listed in the ToolHandler class are considered.
|
inline |
|
delete |
|
default |
std::string findPluginExecutable | ( | const std::string & | name | ) |
Returns the path to the plugin executable or an empty string if the plugin name is unknown.
Referenced by TOPPViewBase::runTOPPTool_().
Returns param for a given tool/util. This function is thread-safe. Additionally inserts names of tools into plugin list
const Param& getPluginParams | ( | ) |
Returns a param containing the params for each plugin.
This function will ALWAYS trigger a reload of the plugins.
const std::string getPluginPath | ( | ) |
Returns the current set path to search plugins in.
Referenced by TOPPViewBase::savePreferences().
const std::vector<std::string>& getPlugins | ( | ) |
Returns the list of read plugin names as saved in the ini.
|
private |
Returns a list of executables that are found at the plugin path.
const Param& getToolParams | ( | ) |
Returns a Param object containing the params for each tool/util.
Note that it is possible that not all param futures have been finished (or loaded) yet if this function is called. In that case, the function starts param parsing (loadParam()) and waits for completion (waitForToolParams()) before returning the result.
Referenced by TOPPViewBase::savePreferences(), and TOPPViewBase::showTOPPDialog_().
|
private |
Start creating params for each plugin in the set plugin path asynchronously This should only be called from waitForPluginParams() or the names in the plugins vector are not correct
void loadToolParams | ( | ) |
Start creating params for each tool/util asynchronously.
Referenced by TOPPViewBase::loadPreferences().
|
delete |
bool setPluginPath | ( | const String & | path, |
bool | create = false |
||
) |
Sets the path that will be searched for Plugins.
path | The new path to set |
create | Attempt to create the directory if it does not already exist |
Referenced by TOPPViewBase::loadPreferences(), TOPPViewBase::savePreferences(), and TOPPViewBase::TOPPViewBase().
void setVerbose | ( | int | verbosity_level | ) |
set the verbosity level of the tool discovery for debug purposes
Referenced by TOPPViewBase::TOPPViewBase().
void waitForPluginParams | ( | ) |
void waitForToolParams | ( | ) |
Wait for all future params to finish evaluating.
While waiting the GUI remains responsive. After waiting it is safe to access the params without further waiting.
Referenced by TOPPViewBase::savePreferences(), and TOPPViewBase::showTOPPDialog_().
|
private |
|
private |
Contains all the params of the plugins.
|
private |
The filepath to search pugins in.
|
private |
The names of all loaded plugins, this is used to add the plugins to the list in the ToolsDialog.
|
private |
The futures for asyncronous loading of the tools/utils and plugins.
|
private |
Contains all the params of the tools/utils.
|
private |
Set to value > 0 to output tool discovery debug information.