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

#include <OpenMS/APPLICATIONS/ToolHandler.h>

Static Public Member Functions

static ToolListType getTOPPToolList ()
 List every TOPP tool enabled in this build, keyed by tool name.
 
static const ToolListType & getTOPPToolListRef ()
 The registry of getTOPPToolList without copying it.
 
static StringList getTypes (const std::string &toolname)
 Return the alternative "types" / sub-commands a tool supports, or an empty list if it has none.
 
static std::string getCategory (const std::string &toolname)
 Return the category string of a tool.
 
static std::string getToolRegistryPath ()
 Resolved file-system path of the tool registry directory (root of the .tsv search).
 

Static Private Member Functions

static ToolListType loadRegistry_ ()
 
static StringList getToolRegistryFiles_ ()
 

Member Function Documentation

◆ getCategory()

static std::string getCategory ( const std::string &  toolname)
static

Return the category string of a tool.

Parameters
[in]toolnameName of the TOPP tool to query.
Returns
Category string (e.g. "Quantitation") or an empty string if toolname is unknown.

◆ getToolRegistryFiles_()

static StringList getToolRegistryFiles_ ( )
staticprivate

Enumerate the .tsv files to read: everything under getToolRegistryPath (and its OS-specific subdirectory), or under the build tree's generated registry when this build was never installed, plus the directories the environment variables add. A directory the search reaches more than once contributes its files once.

◆ getToolRegistryPath()

static std::string getToolRegistryPath ( )
static

Resolved file-system path of the tool registry directory (root of the .tsv search).

Returns
File::getOpenMSDataPath() + "/TOOLS".

◆ getTOPPToolList()

static ToolListType getTOPPToolList ( )
static

List every TOPP tool enabled in this build, keyed by tool name.

Assembled from the .tsv files under getToolRegistryPath (a name collision between two of them throws Exception::InvalidValue, naming both files). Each value carries the tool's category string (e.g. "Quantitation", "File Converter") used by TOPPAS for grouping. Every .tsv of the directory is read, so a tool of another repository is listed as soon as its file is installed there.

Prefer getTOPPToolListRef when a copy is not needed.

Returns
Map toolname -> Internal::ToolDescription for every tool enabled in this build.

Referenced by TOPPASBase::createTOPPToolsTreeWidget().

◆ getTOPPToolListRef()

static const ToolListType & getTOPPToolListRef ( )
static

The registry of getTOPPToolList without copying it.

Same content as getTOPPToolList, served from the process-wide cache. Use this for membership tests and lookups; the reference stays valid for the lifetime of the process.

Returns
Reference to the cached map toolname -> Internal::ToolDescription.

Referenced by INIUpdater::getNewToolName().

◆ getTypes()

static StringList getTypes ( const std::string &  toolname)
static

Return the alternative "types" / sub-commands a tool supports, or an empty list if it has none.

Most tools have a single behaviour; a small number expose multiple sub-modes via -type (e.g. FeatureFinderCentroided vs. FeatureFinderIsotopeWavelet sharing infrastructure).

Parameters
[in]toolnameName of the TOPP tool to query.
Returns
Type names (may be empty); empty also when the tool is unknown, so that a tool which is not in the registry can still write its CTD/CWL description.

Referenced by TOPPASBase::createTOPPToolsTreeWidget().

◆ loadRegistry_()

static ToolListType loadRegistry_ ( )
staticprivate

Parse every file of getToolRegistryFiles_ into the registry map. Throws Exception::InvalidValue when two files register the same tool name.