OpenMS
ToolHandler.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Chris Bielow $
6 // $Authors: Chris Bielow $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
13 
14 #include <map>
15 
16 class QStringList;
17 
18 namespace OpenMS
19 {
34  /*
35  internal details & discussion:
36 
37  We could create the list of TOPP tools from a set of files in /share
38  instead of hard coding them here.
39  Advantage: - no recompile if new tool is added (but the new tool will necessitate that anyway)
40  - quickly changing a tool's category (e.g. from PreProcessing to Quantitation) and thus its place in TOPPAS
41  even users could rearrange tools themselves...
42  Disadvantage:
43  - when to library loads, we'd need to parse all the files. Making our start-up time even longer...
44  - when files are broken/missing, we will have a hard time initializing the lib
45  */
46 
48  typedef std::map<String, Internal::ToolDescription> ToolListType;
49 
50  class OPENMS_DLLAPI ToolHandler
51  {
52 public:
53 
55  static ToolListType getTOPPToolList(const bool includeGenericWrapper = false);
56 
58  static StringList getTypes(const String& toolname);
59 
62  static String getCategory(const String& toolname);
63 
66 
69 
70 private:
71 
73  static QStringList getExternalToolConfigFiles_();
74  static void loadExternalToolConfig_();
77 
78  static std::vector<Internal::ToolDescription> getInternalTools_();
79  static QStringList getInternalToolConfigFiles_();
80  static void loadInternalToolConfig_();
81  static std::vector<Internal::ToolDescription> tools_internal_;
83  };
84 
85 } // namespace OpenMS
86 
A more convenient string class.
Definition: String.h:34
Definition: ToolHandler.h:51
static String getInternalToolsPath()
get File::getOpenMSDataPath() + "/TOOLS/INTERNAL"
static String getExternalToolsPath()
get getOpenMSDataPath() + "/TOOLS/EXTERNAL"
static void loadExternalToolConfig_()
static QStringList getInternalToolConfigFiles_()
static String getCategory(const String &toolname)
static bool tools_internal_loaded_
Definition: ToolHandler.h:82
static std::vector< Internal::ToolDescription > tools_internal_
Definition: ToolHandler.h:81
static QStringList getExternalToolConfigFiles_()
static Internal::ToolDescription tools_external_
Definition: ToolHandler.h:75
static StringList getTypes(const String &toolname)
get all types of a tool (empty if none)
static ToolListType getTOPPToolList(const bool includeGenericWrapper=false)
Returns the list of official TOPP tools contained in the OpenMS/TOPP release.
static Internal::ToolDescription getExternalTools_()
static bool tools_external_loaded_
Definition: ToolHandler.h:76
static std::vector< Internal::ToolDescription > getInternalTools_()
static void loadInternalToolConfig_()
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:44
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::map< String, Internal::ToolDescription > ToolListType
Handles lists of TOPP tools and their categories (for TOPPAS)
Definition: ToolHandler.h:48
Definition: ToolDescription.h:112