OpenMS
ToolHandler.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- 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 #include <QtCore/qcontainerfwd.h> // for QStringList
17 
18 
19 namespace OpenMS
20 {
35  /*
36  internal details & discussion:
37 
38  We could create the list of TOPP tools from a set of files in /share
39  instead of hard coding them here.
40  Advantage: - no recompile if new tool is added (but the new tool will necessitate that anyway)
41  - quickly changing a tool's category (e.g. from PreProcessing to Quantitation) and thus its place in TOPPAS
42  even users could rearrange tools themselves...
43  Disadvantage:
44  - when to library loads, we'd need to parse all the files. Making our start-up time even longer...
45  - when files are broken/missing, we will have a hard time initializing the lib
46  */
47 
49  typedef std::map<String, Internal::ToolDescription> ToolListType;
50 
51  class OPENMS_DLLAPI ToolHandler
52  {
53 public:
54 
56  static ToolListType getTOPPToolList(const bool includeGenericWrapper = false);
57 
59  static StringList getTypes(const String& toolname);
60 
63  static String getCategory(const String& toolname);
64 
67 
70 
71 private:
72 
74  static QStringList getExternalToolConfigFiles_();
75  static void loadExternalToolConfig_();
78 
79  static std::vector<Internal::ToolDescription> getInternalTools_();
80  static QStringList getInternalToolConfigFiles_();
81  static void loadInternalToolConfig_();
82  static std::vector<Internal::ToolDescription> tools_internal_;
84  };
85 
86 } // namespace OpenMS
87 
A more convenient string class.
Definition: String.h:34
Definition: ToolHandler.h:52
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:83
static std::vector< Internal::ToolDescription > tools_internal_
Definition: ToolHandler.h:82
static QStringList getExternalToolConfigFiles_()
static Internal::ToolDescription tools_external_
Definition: ToolHandler.h:76
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:77
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:49
Definition: ToolDescription.h:112