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

« back to all changes in this revision

Viewing changes to source/METADATA/Digestion.C

  • 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: Marc Sturm $
 
26
// --------------------------------------------------------------------------
 
27
 
 
28
#include <OpenMS/METADATA/Digestion.h>
 
29
 
 
30
using namespace std;
 
31
 
 
32
namespace OpenMS
 
33
{
 
34
        
 
35
        
 
36
        Digestion::Digestion() :
 
37
                SampleTreatment("Digestion"),
 
38
                enzyme_(""), 
 
39
                digestion_time_(0.0), 
 
40
                temperature_(0.0), 
 
41
                ph_(0.0)
 
42
        {
 
43
 
 
44
        }
 
45
        
 
46
        Digestion::Digestion(const Digestion& source):
 
47
                SampleTreatment(source),
 
48
                enzyme_(source.enzyme_), 
 
49
                digestion_time_(source.digestion_time_), 
 
50
                temperature_(source.temperature_), 
 
51
                ph_(source.ph_)
 
52
        {
 
53
 
 
54
        }
 
55
        
 
56
        Digestion::~Digestion()
 
57
        {
 
58
 
 
59
        }
 
60
        
 
61
        SampleTreatment* Digestion::clone() const
 
62
        {
 
63
                SampleTreatment* tmp = new Digestion(*this);
 
64
                return tmp;
 
65
        }
 
66
        
 
67
        Digestion& Digestion::operator = (const Digestion& source)
 
68
        {
 
69
          if (&source == this) return *this;
 
70
          
 
71
          SampleTreatment::operator=(source);
 
72
                enzyme_ = source.enzyme_;
 
73
                digestion_time_ = source.digestion_time_;
 
74
                temperature_ = source.temperature_;
 
75
                ph_ = source.ph_;
 
76
          
 
77
          return *this;
 
78
        }
 
79
 
 
80
  bool Digestion::operator== (const SampleTreatment& rhs) const
 
81
  {
 
82
        if (type_!=rhs.getType()) return false;
 
83
        
 
84
        const Digestion* tmp = dynamic_cast<const Digestion*>(&rhs);
 
85
        return
 
86
                SampleTreatment::operator==(*tmp) &&
 
87
                        enzyme_ == tmp->enzyme_ &&
 
88
                        digestion_time_ == tmp->digestion_time_ &&
 
89
                        temperature_ == tmp->temperature_ &&
 
90
                        ph_ == tmp->ph_
 
91
                ;
 
92
  }
 
93
        
 
94
  const String& Digestion::getEnzyme() const
 
95
  {
 
96
    return enzyme_;
 
97
  }
 
98
 
 
99
  void Digestion::setEnzyme(const String& enzyme)
 
100
  {
 
101
    enzyme_ = enzyme;
 
102
  }
 
103
 
 
104
 
 
105
  DoubleReal Digestion::getDigestionTime() const
 
106
  {
 
107
    return digestion_time_;
 
108
  }
 
109
 
 
110
  void Digestion::setDigestionTime(DoubleReal digestion_time)
 
111
  {
 
112
    digestion_time_ = digestion_time;
 
113
  }
 
114
 
 
115
 
 
116
  DoubleReal Digestion::getTemperature() const
 
117
  {
 
118
    return temperature_;
 
119
  }
 
120
 
 
121
  void Digestion::setTemperature(DoubleReal temperature)
 
122
  {
 
123
    temperature_ = temperature;
 
124
  }
 
125
 
 
126
 
 
127
  DoubleReal Digestion::getPh() const
 
128
  {
 
129
    return ph_;
 
130
  }
 
131
 
 
132
  void Digestion::setPh(DoubleReal ph)
 
133
  {
 
134
    ph_ = ph;
 
135
  }
 
136
 
 
137
}
 
138