OpenMS
ToolDescription.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, 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, Mathias Walzer $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
14 
15 #include <OpenMS/OpenMSConfig.h>
16 
17 #include <map>
18 
19 namespace OpenMS
20 {
21  namespace Internal
22  {
27  struct FileMapping
28  {
31  // thus: move location -> target
32 
34  FileMapping() = default;
35 
37  FileMapping(const FileMapping& other) = default;
38 
40  FileMapping& operator=(const FileMapping& rhs) = default;
41  };
42 
47  struct MappingParam
48  {
49  std::map<Int, String> mapping;
50  std::vector<FileMapping> pre_moves;
51  std::vector<FileMapping> post_moves;
52 
54  MappingParam() = default;
55 
57  MappingParam(const MappingParam& other) = default;
58 
60  MappingParam& operator=(const MappingParam& other) = default;
61  };
62 
70  struct OPENMS_DLLAPI ToolDescriptionInternal
71  {
72  bool is_internal = false;
76 
79 
81  ToolDescriptionInternal(const bool p_is_internal, const String& p_name, const String& p_category, const StringList& p_types);
82 
84  ToolDescriptionInternal(const String& p_name, const StringList& p_types);
85 
88 
89  bool operator==(const ToolDescriptionInternal& rhs) const;
90 
91  bool operator<(const ToolDescriptionInternal& rhs) const;
92  };
93 
94  struct OPENMS_DLLAPI ToolExternalDetails
95  {
105  };
106 
110  struct OPENMS_DLLAPI ToolDescription :
112  {
114  std::vector<ToolExternalDetails> external_details;
115 
117  ToolDescription() = default;
118 
120  ToolDescription(const ToolDescription& other) = default;
121 
123  ToolDescription(const String& p_name, const String& p_category, const StringList& p_types = StringList());
124 
126  ToolDescription& operator=(const ToolDescription& rhs) = default;
127 
128  void addExternalType(const String& type, const ToolExternalDetails& details);
129 
130  void append(const ToolDescription& other);
131  };
132  } // namespace Internal
133 } // namespace OPENMS
Management and storage of parameters / INI files.
Definition: Param.h:44
A more convenient string class.
Definition: String.h:34
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:44
String commandline
Definition: ToolDescription.h:100
String text_startup
Definition: ToolDescription.h:96
String category
Definition: ToolDescription.h:99
String text_finish
Definition: ToolDescription.h:98
String text_fail
Definition: ToolDescription.h:97
String working_directory
folder where the command will be executed from
Definition: ToolDescription.h:102
Param param
Definition: ToolDescription.h:104
String path
filename to external tool
Definition: ToolDescription.h:101
MappingParam tr_table
Definition: ToolDescription.h:103
Definition: ToolDescription.h:95
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
Maps input/output files to filenames for the external program.
Definition: ToolDescription.h:28
FileMapping(const FileMapping &other)=default
Copy constructor.
String location
a regex/macro mix; to be expanded by tool;
Definition: ToolDescription.h:29
String target
TOPP parameter that determines the desired name.
Definition: ToolDescription.h:30
FileMapping()=default
Default constructor.
FileMapping & operator=(const FileMapping &rhs)=default
Copy assignment.
Filename mappings for all input/output files.
Definition: ToolDescription.h:48
MappingParam & operator=(const MappingParam &other)=default
Copy assignment.
std::vector< FileMapping > post_moves
Definition: ToolDescription.h:51
MappingParam(const MappingParam &other)=default
Copy constructor.
std::map< Int, String > mapping
Definition: ToolDescription.h:49
MappingParam()=default
Default constructor.
std::vector< FileMapping > pre_moves
Definition: ToolDescription.h:50
ToolDescription Class.
Definition: ToolDescription.h:71
ToolDescriptionInternal()=default
default C'Tor
String category
Definition: ToolDescription.h:74
ToolDescriptionInternal & operator=(const ToolDescriptionInternal &rhs)=default
Copy assignment.
bool operator<(const ToolDescriptionInternal &rhs) const
StringList types
-types of the tool (if any, e.g. ['centroided','wavelet'])
Definition: ToolDescription.h:75
String name
Definition: ToolDescription.h:73
ToolDescriptionInternal(const String &p_name, const StringList &p_types)
short C'Tor
ToolDescriptionInternal(const bool p_is_internal, const String &p_name, const String &p_category, const StringList &p_types)
C'Tor with arguments.
bool operator==(const ToolDescriptionInternal &rhs) const
Definition: ToolDescription.h:112
ToolDescription()=default
default CTor
ToolDescription & operator=(const ToolDescription &rhs)=default
Copy assignment.
void append(const ToolDescription &other)
std::vector< ToolExternalDetails > external_details
additional details for external tools (one entry for each 'type')
Definition: ToolDescription.h:114
void addExternalType(const String &type, const ToolExternalDetails &details)
ToolDescription(const String &p_name, const String &p_category, const StringList &p_types=StringList())
C'Tor for internal TOPP tools.
ToolDescription(const ToolDescription &other)=default
Copy C'Tor.