OpenMS
Loading...
Searching...
No Matches
TVToolDiscovery Class Reference

Scans for tools and generates a param for each asynchronously. More...

#include <OpenMS/VISUAL/TVToolDiscovery.h>

Collaboration diagram for TVToolDiscovery:
[legend]

Public Member Functions

 TVToolDiscovery ()=default
 
 TVToolDiscovery (const TVToolDiscovery &)=delete
 
TVToolDiscoveryoperator= (const TVToolDiscovery &)=delete
 
 ~TVToolDiscovery ()=default
 
void loadToolParams ()
 Start creating params for each tool/util asynchronously.
 
void waitForToolParams ()
 Wait for all future params to finish evaluating.
 
const ParamgetToolParams ()
 Returns a Param object containing the params for each tool/util.
 
void setVerbose (int verbosity_level)
 set the verbosity level of the tool discovery for debug purposes
 

Static Private Member Functions

static Param getParamFromIni_ (const std::string &tool_path)
 Returns param for a given tool/util. This function is thread-safe.
 

Private Attributes

std::vector< std::future< Param > > tool_param_futures_
 The futures for asyncronous loading of the tools.
 
Param tool_params_
 Contains all the params of the tools/utils.
 
int verbosity_level_ = 0
 Set to value > 0 to output tool discovery debug information.
 

Detailed Description

Scans for tools and generates a param for each asynchronously.

All tools listed in the ToolHandler class are considered.

scanner.loadToolParams();
// Do something else before explicitly waiting for the threads to finish
...
// Wait when convenient. Keeps the GUI responsive while waiting
scanner.waitForToolParams();
// Access the params. If no special timing for waiting or loading is needed this function can be safely called directly.
scanner.getToolParams();
Scans for tools and generates a param for each asynchronously.
Definition TVToolDiscovery.h:37
const Param & getToolParams()
Returns a Param object containing the params for each tool/util.
void loadToolParams()
Start creating params for each tool/util asynchronously.

Constructor & Destructor Documentation

◆ TVToolDiscovery() [1/2]

TVToolDiscovery ( )
default

◆ TVToolDiscovery() [2/2]

TVToolDiscovery ( const TVToolDiscovery )
delete

◆ ~TVToolDiscovery()

~TVToolDiscovery ( )
default

Member Function Documentation

◆ getParamFromIni_()

static Param getParamFromIni_ ( const std::string &  tool_path)
staticprivate

Returns param for a given tool/util. This function is thread-safe.

◆ getToolParams()

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_().

◆ loadToolParams()

void loadToolParams ( )

Start creating params for each tool/util asynchronously.

Referenced by TOPPViewBase::loadPreferences().

◆ operator=()

TVToolDiscovery & operator= ( const TVToolDiscovery )
delete

◆ setVerbose()

void setVerbose ( int  verbosity_level)

set the verbosity level of the tool discovery for debug purposes

Referenced by TOPPViewBase::TOPPViewBase().

◆ waitForToolParams()

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_().

Member Data Documentation

◆ tool_param_futures_

std::vector<std::future<Param> > tool_param_futures_
private

The futures for asyncronous loading of the tools.

◆ tool_params_

Param tool_params_
private

Contains all the params of the tools/utils.

◆ verbosity_level_

int verbosity_level_ = 0
private

Set to value > 0 to output tool discovery debug information.