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

« back to all changes in this revision

Viewing changes to include/OpenMS/DATASTRUCTURES/CVMappingRule.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_DATASTRUCTURES_CVMAPPINGRULE_H
 
29
#define OPENMS_DATASTRUCTURES_CVMAPPINGRULE_H
 
30
 
 
31
#include <OpenMS/DATASTRUCTURES/String.h>
 
32
#include <OpenMS/DATASTRUCTURES/CVMappingTerm.h>
 
33
#include <vector>
 
34
 
 
35
namespace OpenMS
 
36
{
 
37
        /**
 
38
                @brief Representation of a CV Mapping rule used by CVMappings
 
39
                
 
40
                Representation of a controlled vocabulary mapping rule.
 
41
 
 
42
                @ingroup Datastructures
 
43
        */
 
44
                        class OPENMS_DLLAPI CVMappingRule
 
45
                        {
 
46
                                public:
 
47
 
 
48
                                /// enum to specify the requirement level
 
49
                                enum RequirementLevel
 
50
                                {
 
51
                                        MUST = 0,
 
52
                                        SHOULD = 1,
 
53
                                        MAY = 2
 
54
                                };
 
55
 
 
56
                                /// enum to specify the combination operator
 
57
                                enum CombinationsLogic
 
58
                                {
 
59
                                        OR = 0,
 
60
                                        AND = 1,
 
61
                                        XOR = 2
 
62
                                };
 
63
                                                                
 
64
                                /// Default constructor
 
65
                                CVMappingRule();
 
66
 
 
67
                                /// Copy constructor
 
68
                                CVMappingRule(const CVMappingRule& rhs);
 
69
 
 
70
                                /// Destructor
 
71
                                virtual ~CVMappingRule();
 
72
 
 
73
                                /// Assignment operator
 
74
                                CVMappingRule& operator = (const CVMappingRule& rhs);
 
75
 
 
76
                                /** @name Accessors
 
77
                                */
 
78
                                //@{
 
79
                                /// sets the identifier of the rule
 
80
                                void setIdentifier(const String& identifier);
 
81
 
 
82
                                /// returns the identifier of the rule
 
83
                                const String& getIdentifier() const;
 
84
 
 
85
                                /// sets the path of the element, where this rule is allowed
 
86
                                void setElementPath(const String& element_path);
 
87
 
 
88
                                /// returns the path of the element, where this rule is allowed
 
89
                                const String& getElementPath() const;
 
90
        
 
91
                                /// sets the requirement level of this rule
 
92
                                void setRequirementLevel(RequirementLevel level);
 
93
                                
 
94
                                /// returns the requirement level of this rule
 
95
                                RequirementLevel getRequirementLevel() const; 
 
96
                        
 
97
                                /// sets the combination operator of the rule
 
98
                                void setCombinationsLogic(CombinationsLogic combinations_logic);
 
99
 
 
100
                                /// returns the combinations operator of the rule
 
101
                                CombinationsLogic getCombinationsLogic() const;
 
102
                        
 
103
                                /// sets the scope path of the rule
 
104
                                void setScopePath(const String& path);
 
105
 
 
106
                                /// returns the scope path of the rule
 
107
                                const String& getScopePath() const;
 
108
                                
 
109
                                /// sets the terms which are allowed
 
110
                                void setCVTerms(const std::vector<CVMappingTerm>& cv_terms);
 
111
 
 
112
                                /// returns the allowed terms
 
113
                                const std::vector<CVMappingTerm>& getCVTerms() const;
 
114
 
 
115
                                /// adds a term to the allowed terms
 
116
                                void addCVTerm(const CVMappingTerm& cv_terms);
 
117
                                //@}
 
118
 
 
119
                                /** @name Predicates
 
120
                                */
 
121
                                //@{
 
122
                                /// equality operator
 
123
                                bool operator == (const CVMappingRule& rhs) const;
 
124
 
 
125
                                /// inequality operator
 
126
                                bool operator != (const CVMappingRule& rhs) const;
 
127
                                //@}
 
128
                                
 
129
                                protected:
 
130
 
 
131
                                String identifier_;
 
132
 
 
133
                                String element_path_;
 
134
 
 
135
                                RequirementLevel requirement_level_;
 
136
 
 
137
                                String scope_path_;
 
138
 
 
139
                                CombinationsLogic combinations_logic_;
 
140
 
 
141
                                std::vector<CVMappingTerm> cv_terms_;
 
142
                        };
 
143
 
 
144
} // namespace OpenMS
 
145
 
 
146
#endif // OPENMS_DATASTRUCTURES_CVMAPPINGRULE_H