OpenMS
CVTermList.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: Mathias Walzer $
6 // $Authors: Andreas Bertsch, Mathias Walzer $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <OpenMS/METADATA/CVTerm.h>
13 #include <map>
14 
15 namespace OpenMS
16 {
26  class OPENMS_DLLAPI CVTermList :
27  public MetaInfoInterface
28  {
29 public:
30 
32  CVTermList() = default;
33 
35  CVTermList(const CVTermList&) = default;
36 
37  // note: we implement the move constructor ourselves due to a bug in MSVS
38  // 2015/2017 which cannot produce a default move constructor for classes
39  // that contain STL containers (other than vector).
40 
42  CVTermList(CVTermList&&) noexcept;
43 
45  virtual ~CVTermList();
46 
48  CVTermList& operator=(const CVTermList& rhs) & = default;
49 
51  CVTermList& operator=(CVTermList&&) & = default;
52 
57  void setCVTerms(const std::vector<CVTerm>& terms);
58 
60  void replaceCVTerm(const CVTerm& cv_term);
61 
63  void replaceCVTerms(const std::vector<CVTerm>& cv_terms, const String& accession);
64 
66  void replaceCVTerms(const std::map<String, std::vector<CVTerm> >& cv_term_map);
67 
69  void consumeCVTerms(const std::map<String, std::vector<CVTerm> >& cv_term_map);
70 
72  const std::map<String, std::vector<CVTerm> >& getCVTerms() const;
73 
75  void addCVTerm(const CVTerm& term);
76 
78  //bool checkCVTerms(const ControlledVocabulary& cv) const;
79 
81  //void correctCVTermNames();
83 
88  bool operator==(const CVTermList& cv_term_list) const;
89 
91  bool operator!=(const CVTermList& cv_term_list) const;
92 
94  bool hasCVTerm(const String& accession) const;
95 
98  //bool checkCVTerms(const CVMappingRule & rule, const ControlledVocabulary & cv) const;
99 
101  bool empty() const;
102  //}
103 
104 protected:
105 
106  std::map<String, std::vector<CVTerm> > cv_terms_;
107 
108  };
109 
110 } // namespace OpenMS
111 
Representation of controlled vocabulary term list.
Definition: CVTermList.h:28
CVTermList()=default
Defaults constructor.
CVTermList(const CVTermList &)=default
Copy constructor.
CVTermList(CVTermList &&) noexcept
Move constructor.
Representation of controlled vocabulary term.
Definition: CVTerm.h:27
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition: MetaInfoInterface.h:35
A more convenient string class.
Definition: String.h:34
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19