Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
CVTerm.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2017.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Timo Sachsenberg $
32 // $Authors: Andreas Bertsch $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_METADATA_CVTERM_H
36 #define OPENMS_METADATA_CVTERM_H
37 
40 
41 namespace OpenMS
42 {
50  class OPENMS_DLLAPI CVTerm
52  {
53 public:
54 
55 
56  struct Unit
57  {
58  Unit()
59  {
60  }
61 
62  Unit(const String & p_accession, const String & p_name, const String & p_cv_ref) :
63  accession(p_accession),
64  name(p_name),
65  cv_ref(p_cv_ref)
66  {
67  }
68 
69  Unit(const Unit & rhs) :
70  accession(rhs.accession),
71  name(rhs.name),
72  cv_ref(rhs.cv_ref)
73  {
74  }
75 
76  virtual ~Unit()
77  {
78  }
79 
80  Unit & operator=(const Unit & rhs)
81  {
82  if (this != &rhs)
83  {
84  accession = rhs.accession;
85  name = rhs.name;
86  cv_ref = rhs.cv_ref;
87  }
88  return *this;
89  }
90 
91  bool operator==(const Unit & rhs) const
92  {
93  return accession == rhs.accession &&
94  name == rhs.name &&
95  cv_ref == rhs.cv_ref;
96  }
97 
98  bool operator!=(const Unit & rhs) const
99  {
100  return !(*this == rhs);
101  }
102 
106  };
107 
108 
110  CVTerm();
111 
113  CVTerm(const String & accession, const String & name, const String & cv_identifier_ref, const String & value, const Unit & unit);
114 
116  CVTerm(const CVTerm & rhs);
117 
119  virtual ~CVTerm();
120 
122  CVTerm & operator=(const CVTerm & rhs);
123 
127  void setAccession(const String & accession);
129 
131  const String & getAccession() const;
132 
134  void setName(const String & name);
135 
137  const String & getName() const;
138 
140  void setCVIdentifierRef(const String & cv_identifier_ref);
141 
143  const String & getCVIdentifierRef() const;
144 
146  void setValue(const DataValue & value);
147 
149  const DataValue & getValue() const;
150 
152  void setUnit(const Unit & unit);
153 
155  const Unit & getUnit() const;
157 
161  bool operator==(const CVTerm & rhs) const;
163 
165  bool operator!=(const CVTerm & rhs) const;
166 
168  bool hasValue() const;
169 
171  bool hasUnit() const;
172  //}
173 
174 protected:
175 
177 
179 
181 
183 
185  };
186 
187 } // namespace OpenMS
188 
189 #endif // OPENMS_DATASTRUCTURES_CVTERM_H
Unit unit_
Definition: CVTerm.h:182
A more convenient string class.
Definition: String.h:57
String name_
Definition: CVTerm.h:178
bool operator==(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:806
Unit()
Definition: CVTerm.h:58
String accession
Definition: CVTerm.h:103
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
bool operator!=(const Unit &rhs) const
Definition: CVTerm.h:98
Unit(const String &p_accession, const String &p_name, const String &p_cv_ref)
Definition: CVTerm.h:62
Class to hold strings, numeric values, lists of strings and lists of numeric values.
Definition: DataValue.h:57
String accession_
Definition: CVTerm.h:176
Definition: CVTerm.h:56
bool operator==(const Unit &rhs) const
Definition: CVTerm.h:91
String cv_identifier_ref_
Definition: CVTerm.h:180
Representation of controlled vocabulary term.
Definition: CVTerm.h:51
DataValue value_
Definition: CVTerm.h:184
bool operator!=(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:824
Unit & operator=(const Unit &rhs)
Definition: CVTerm.h:80
Unit(const Unit &rhs)
Definition: CVTerm.h:69
virtual ~Unit()
Definition: CVTerm.h:76
String cv_ref
Definition: CVTerm.h:105
String name
Definition: CVTerm.h:104

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:21:59 using doxygen 1.8.13