1
// -*- mode: C++; tab-width: 2; -*-
4
// --------------------------------------------------------------------------
5
// OpenMS Mass Spectrometry Framework
6
// --------------------------------------------------------------------------
7
// Copyright (C) 2003-2011 -- Oliver Kohlbacher, Knut Reinert
9
// This library is free software; you can redistribute it and/or
10
// modify it under the terms of the GNU Lesser General Public
11
// License as published by the Free Software Foundation; either
12
// version 2.1 of the License, or (at your option) any later version.
14
// This library is distributed in the hope that it will be useful,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
// Lesser General Public License for more details.
19
// You should have received a copy of the GNU Lesser General Public
20
// License along with this library; if not, write to the Free Software
21
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
// --------------------------------------------------------------------------
24
// $Maintainer: Andreas Bertsch $
25
// $Authors: Andreas Bertsch $
26
// --------------------------------------------------------------------------
28
#ifndef OPENMS_METADATA_CVTERMLIST_H
29
#define OPENMS_METADATA_CVTERMLIST_H
31
#include <OpenMS/METADATA/CVTerm.h>
32
#include <OpenMS/METADATA/MetaInfoInterface.h>
33
#include <OpenMS/DATASTRUCTURES/CVMappingRule.h>
34
#include <OpenMS/FORMAT/ControlledVocabulary.h>
39
@brief Representation of controlled vocabulary term list
41
This class should be used to inherit from, to allow to add
42
an arbitrary number of CV terms to the inherited class
46
///Represenation of a CV term used by CVMappings
47
class OPENMS_DLLAPI CVTermList
48
: public MetaInfoInterface
52
/// Defaults constructor
56
CVTermList(const CVTermList& rhs);
59
virtual ~CVTermList();
61
/// Assignment operator
62
CVTermList& operator = (const CVTermList& rhs);
68
void setCVTerms(const std::vector<CVTerm>& terms);
70
/// returns the accession string of the term
71
const Map<String, std::vector<CVTerm> >& getCVTerms() const;
74
void addCVTerm(const CVTerm& term);
76
/// checks whether the spellings of the CV terms stored are correct
77
//bool checkCVTerms(const ControlledVocabulary& cv) const;
79
/// corrects the CVTerm names, according to the loaded CV
80
//void correctCVTermNames();
87
bool operator == (const CVTermList& cv_term_list) const;
89
/// inequality operator
90
bool operator != (const CVTermList& cv_term_list) const;
92
/// checks whether the term has a value
93
bool hasCVTerm(const String& accession) const;
95
/// checks whether the stored terms fullfil a given CVMappingRule
96
bool checkCVTerms(const CVMappingRule& rule, const ControlledVocabulary& cv) const;
98
/// return true if no terms are available
104
Map<String, std::vector<CVTerm> > cv_terms_;
108
} // namespace OpenMS
110
#endif // OPENMS_DATASTRUCTURES_CVTERMLIST_H