OpenMS
CVMappingRule.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: Timo Sachsenberg $
6 // $Authors: Andreas Bertsch $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <OpenMS/OpenMSConfig.h>
13 
14 #include <vector>
15 
16 namespace OpenMS
17 {
18  class CVMappingTerm;
19 
27  class OPENMS_DLLAPI CVMappingRule
28  {
29 public:
30 
33  {
34  MUST = 0,
35  SHOULD = 1,
36  MAY = 2
37  };
38 
41  {
42  OR = 0,
43  AND = 1,
44  XOR = 2
45  };
46 
49 
52 
54  virtual ~CVMappingRule();
55 
58 
63  void setIdentifier(const String& identifier);
64 
66  const String& getIdentifier() const;
67 
69  void setElementPath(const String& element_path);
70 
72  const String& getElementPath() const;
73 
76 
79 
81  void setCombinationsLogic(CombinationsLogic combinations_logic);
82 
85 
87  void setScopePath(const String& path);
88 
90  const String& getScopePath() const;
91 
93  void setCVTerms(const std::vector<CVMappingTerm>& cv_terms);
94 
96  const std::vector<CVMappingTerm>& getCVTerms() const;
97 
99  void addCVTerm(const CVMappingTerm& cv_terms);
101 
106  bool operator==(const CVMappingRule& rhs) const;
107 
109  bool operator!=(const CVMappingRule& rhs) const;
111 
112 protected:
113 
115 
117 
119 
121 
123 
124  std::vector<CVMappingTerm> cv_terms_;
125  };
126 
127 } // namespace OpenMS
128 
Representation of a CV Mapping rule used by CVMappings.
Definition: CVMappingRule.h:28
const String & getIdentifier() const
returns the identifier of the rule
RequirementLevel
enum to specify the requirement level
Definition: CVMappingRule.h:33
const String & getScopePath() const
returns the scope path of the rule
bool operator==(const CVMappingRule &rhs) const
equality operator
void setRequirementLevel(RequirementLevel level)
sets the requirement level of this rule
CombinationsLogic
enum to specify the combination operator
Definition: CVMappingRule.h:41
void setIdentifier(const String &identifier)
sets the identifier of the rule
void setCVTerms(const std::vector< CVMappingTerm > &cv_terms)
sets the terms which are allowed
CVMappingRule & operator=(const CVMappingRule &rhs)
Assignment operator.
bool operator!=(const CVMappingRule &rhs) const
inequality operator
void setElementPath(const String &element_path)
sets the path of the element, where this rule is allowed
CVMappingRule(const CVMappingRule &rhs)
Copy constructor.
virtual ~CVMappingRule()
Destructor.
std::vector< CVMappingTerm > cv_terms_
Definition: CVMappingRule.h:124
void setCombinationsLogic(CombinationsLogic combinations_logic)
sets the combination operator of the rule
const String & getElementPath() const
returns the path of the element, where this rule is allowed
void addCVTerm(const CVMappingTerm &cv_terms)
adds a term to the allowed terms
const std::vector< CVMappingTerm > & getCVTerms() const
returns the allowed terms
void setScopePath(const String &path)
sets the scope path of the rule
String scope_path_
Definition: CVMappingRule.h:120
RequirementLevel getRequirementLevel() const
returns the requirement level of this rule
CombinationsLogic combinations_logic_
Definition: CVMappingRule.h:122
CombinationsLogic getCombinationsLogic() const
returns the combinations operator of the rule
String element_path_
Definition: CVMappingRule.h:116
CVMappingRule()
Default constructor.
RequirementLevel requirement_level_
Definition: CVMappingRule.h:118
String identifier_
Definition: CVMappingRule.h:114
Representation of controlled vocabulary term.
Definition: CVMappingTerm.h:25
A more convenient string class.
Definition: String.h:34
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22