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_DATASTRUCTURES_CVMAPPINGRULE_H
29
#define OPENMS_DATASTRUCTURES_CVMAPPINGRULE_H
31
#include <OpenMS/DATASTRUCTURES/String.h>
32
#include <OpenMS/DATASTRUCTURES/CVMappingTerm.h>
38
@brief Representation of a CV Mapping rule used by CVMappings
40
Representation of a controlled vocabulary mapping rule.
42
@ingroup Datastructures
44
class OPENMS_DLLAPI CVMappingRule
48
/// enum to specify the requirement level
56
/// enum to specify the combination operator
57
enum CombinationsLogic
64
/// Default constructor
68
CVMappingRule(const CVMappingRule& rhs);
71
virtual ~CVMappingRule();
73
/// Assignment operator
74
CVMappingRule& operator = (const CVMappingRule& rhs);
79
/// sets the identifier of the rule
80
void setIdentifier(const String& identifier);
82
/// returns the identifier of the rule
83
const String& getIdentifier() const;
85
/// sets the path of the element, where this rule is allowed
86
void setElementPath(const String& element_path);
88
/// returns the path of the element, where this rule is allowed
89
const String& getElementPath() const;
91
/// sets the requirement level of this rule
92
void setRequirementLevel(RequirementLevel level);
94
/// returns the requirement level of this rule
95
RequirementLevel getRequirementLevel() const;
97
/// sets the combination operator of the rule
98
void setCombinationsLogic(CombinationsLogic combinations_logic);
100
/// returns the combinations operator of the rule
101
CombinationsLogic getCombinationsLogic() const;
103
/// sets the scope path of the rule
104
void setScopePath(const String& path);
106
/// returns the scope path of the rule
107
const String& getScopePath() const;
109
/// sets the terms which are allowed
110
void setCVTerms(const std::vector<CVMappingTerm>& cv_terms);
112
/// returns the allowed terms
113
const std::vector<CVMappingTerm>& getCVTerms() const;
115
/// adds a term to the allowed terms
116
void addCVTerm(const CVMappingTerm& cv_terms);
122
/// equality operator
123
bool operator == (const CVMappingRule& rhs) const;
125
/// inequality operator
126
bool operator != (const CVMappingRule& rhs) const;
133
String element_path_;
135
RequirementLevel requirement_level_;
139
CombinationsLogic combinations_logic_;
141
std::vector<CVMappingTerm> cv_terms_;
144
} // namespace OpenMS
146
#endif // OPENMS_DATASTRUCTURES_CVMAPPINGRULE_H