~ubuntu-branches/ubuntu/wily/openms/wily

« back to all changes in this revision

Viewing changes to include/OpenMS/METADATA/CVTermList.h

  • Committer: Package Import Robot
  • Author(s): Filippo Rusconi
  • Date: 2012-11-12 15:58:12 UTC
  • Revision ID: package-import@ubuntu.com-20121112155812-vr15wtg9b50cuesg
Tags: upstream-1.9.0
ImportĀ upstreamĀ versionĀ 1.9.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- mode: C++; tab-width: 2; -*-
 
2
// vi: set ts=2:
 
3
//
 
4
// --------------------------------------------------------------------------
 
5
//                   OpenMS Mass Spectrometry Framework
 
6
// --------------------------------------------------------------------------
 
7
//  Copyright (C) 2003-2011 -- Oliver Kohlbacher, Knut Reinert
 
8
//
 
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.
 
13
//
 
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.
 
18
//
 
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
 
22
//
 
23
// --------------------------------------------------------------------------
 
24
// $Maintainer: Andreas Bertsch $
 
25
// $Authors: Andreas Bertsch $
 
26
// --------------------------------------------------------------------------
 
27
 
 
28
#ifndef OPENMS_METADATA_CVTERMLIST_H
 
29
#define OPENMS_METADATA_CVTERMLIST_H
 
30
 
 
31
#include <OpenMS/METADATA/CVTerm.h>
 
32
#include <OpenMS/METADATA/MetaInfoInterface.h>
 
33
#include <OpenMS/DATASTRUCTURES/CVMappingRule.h>
 
34
#include <OpenMS/FORMAT/ControlledVocabulary.h>
 
35
 
 
36
namespace OpenMS
 
37
{
 
38
        /**
 
39
                @brief Representation of controlled vocabulary term list
 
40
                
 
41
                This class should be used to inherit from, to allow to add
 
42
                an arbitrary number of CV terms to the inherited class
 
43
                
 
44
                @ingroup Metadata
 
45
        */
 
46
                        ///Represenation of a CV term used by CVMappings
 
47
                        class OPENMS_DLLAPI CVTermList
 
48
                                :       public MetaInfoInterface
 
49
                        {
 
50
                                public:
 
51
                        
 
52
                                /// Defaults constructor
 
53
                                CVTermList();
 
54
 
 
55
                                /// Copy constructor
 
56
                                CVTermList(const CVTermList& rhs);
 
57
 
 
58
                                /// Destructor
 
59
                                virtual ~CVTermList();
 
60
 
 
61
                                /// Assignment operator
 
62
                                CVTermList& operator = (const CVTermList& rhs);
 
63
 
 
64
                                /** @name Accessors
 
65
                                */
 
66
                                //@{
 
67
                                /// sets the CV terms 
 
68
                                void setCVTerms(const std::vector<CVTerm>& terms);
 
69
 
 
70
                                /// returns the accession string of the term
 
71
                                const Map<String, std::vector<CVTerm> >& getCVTerms() const;
 
72
 
 
73
                                /// adds a CV term
 
74
                                void addCVTerm(const CVTerm& term);
 
75
 
 
76
                                /// checks whether the spellings of the CV terms stored are correct
 
77
                                //bool checkCVTerms(const ControlledVocabulary& cv) const;
 
78
 
 
79
                                /// corrects the CVTerm names, according to the loaded CV
 
80
                                //void correctCVTermNames();
 
81
                                //@}
 
82
                        
 
83
                                /** @name Predicates
 
84
                                */
 
85
                                //@{
 
86
                                /// equality operator 
 
87
                                bool operator == (const CVTermList& cv_term_list) const;
 
88
 
 
89
                                /// inequality operator 
 
90
                                bool operator != (const CVTermList& cv_term_list) const;
 
91
                                
 
92
                                /// checks whether the term has a value
 
93
                                bool hasCVTerm(const String& accession) const;
 
94
                                
 
95
                                /// checks whether the stored terms fullfil a given CVMappingRule
 
96
                                bool checkCVTerms(const CVMappingRule& rule, const ControlledVocabulary& cv) const;
 
97
 
 
98
                                /// return true if no terms are available
 
99
                                bool empty() const;
 
100
                                //}
 
101
 
 
102
                                protected:
 
103
                                
 
104
                                Map<String, std::vector<CVTerm> > cv_terms_;
 
105
 
 
106
                        };
 
107
                                                
 
108
} // namespace OpenMS
 
109
 
 
110
#endif // OPENMS_DATASTRUCTURES_CVTERMLIST_H