OpenMS
CVMappings.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: Timo Sachsenberg $
6 // $Authors: Andreas Bertsch $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <OpenMS/OpenMSConfig.h>
13 #include <map>
14 #include <vector>
15 
16 namespace OpenMS
17 {
18  class CVMappingRule;
19  class CVReference;
20 
30  class OPENMS_DLLAPI CVMappings
31  {
32 public:
33 
36 
38  CVMappings(const CVMappings& rhs);
39 
41  virtual ~CVMappings();
42 
45 
50  void setMappingRules(const std::vector<CVMappingRule>& cv_mapping_rules);
51 
53  const std::vector<CVMappingRule>& getMappingRules() const;
54 
56  void addMappingRule(const CVMappingRule& cv_mapping_rule);
57 
59  void setCVReferences(const std::vector<CVReference>& cv_references);
60 
62  const std::vector<CVReference>& getCVReferences() const;
63 
65  void addCVReference(const CVReference& cv_reference);
67 
72  bool hasCVReference(const String& identifier);
73 
75  bool operator==(const CVMappings& rhs) const;
76 
78  bool operator!=(const CVMappings& rhs) const;
80 
81 protected:
82 
83  std::vector<CVMappingRule> mapping_rules_;
84 
85  std::map<String, CVReference> cv_references_;
86 
87  std::vector<CVReference> cv_references_vector_;
88  };
89 } // namespace OpenMS
90 
Representation of a CV Mapping rule used by CVMappings.
Definition: CVMappingRule.h:28
Representation of controlled vocabulary mapping rules (for PSI formats)
Definition: CVMappings.h:31
void addMappingRule(const CVMappingRule &cv_mapping_rule)
adds a mapping rule
virtual ~CVMappings()
Destructor.
bool hasCVReference(const String &identifier)
returns true if a CV reference is given
const std::vector< CVReference > & getCVReferences() const
returns the CV references
CVMappings()
Default constructor.
CVMappings & operator=(const CVMappings &rhs)
Assignment operator.
const std::vector< CVMappingRule > & getMappingRules() const
returns the mapping rules
bool operator==(const CVMappings &rhs) const
equality operator
std::vector< CVReference > cv_references_vector_
Definition: CVMappings.h:87
bool operator!=(const CVMappings &rhs) const
inequality operator
void setMappingRules(const std::vector< CVMappingRule > &cv_mapping_rules)
sets the mapping rules of the mapping file
void addCVReference(const CVReference &cv_reference)
adds a CV reference
void setCVReferences(const std::vector< CVReference > &cv_references)
sets the CV references
CVMappings(const CVMappings &rhs)
Copy constructor.
std::map< String, CVReference > cv_references_
Definition: CVMappings.h:85
std::vector< CVMappingRule > mapping_rules_
Definition: CVMappings.h:83
Controlled Vocabulary Reference.
Definition: CVReference.h:27
A more convenient string class.
Definition: String.h:34
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19