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

« back to all changes in this revision

Viewing changes to source/METADATA/ExperimentalSettings.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/ExperimentalSettings.h>
 
29
 
 
30
using namespace std;
 
31
 
 
32
namespace OpenMS
 
33
{
 
34
 
 
35
        ExperimentalSettings::ExperimentalSettings():
 
36
                MetaInfoInterface(),
 
37
                DocumentIdentifier(),
 
38
                sample_(),
 
39
                source_files_(),
 
40
                contacts_(),
 
41
                instrument_(),
 
42
                hplc_(),
 
43
                datetime_(),
 
44
                comment_(),
 
45
                protein_identifications_(),
 
46
                fraction_identifier_()
 
47
        {
 
48
        }
 
49
        
 
50
        ExperimentalSettings::ExperimentalSettings(const ExperimentalSettings& source):
 
51
                MetaInfoInterface(source),
 
52
                DocumentIdentifier(source),
 
53
          sample_(source.sample_),
 
54
          source_files_(source.source_files_),
 
55
          contacts_(source.contacts_),
 
56
          instrument_(source.instrument_),
 
57
          hplc_(source.hplc_),
 
58
          datetime_(source.datetime_),
 
59
          comment_(source.comment_),
 
60
                protein_identifications_(source.protein_identifications_),
 
61
                fraction_identifier_(source.fraction_identifier_)
 
62
        {
 
63
        }
 
64
        
 
65
        ExperimentalSettings::~ExperimentalSettings()
 
66
        {
 
67
        }
 
68
        
 
69
        ExperimentalSettings& ExperimentalSettings::operator = (const ExperimentalSettings& source)
 
70
        {
 
71
          if (&source == this) return *this;
 
72
          
 
73
    sample_ = source.sample_;
 
74
    source_files_ = source.source_files_;
 
75
    contacts_ = source.contacts_;
 
76
    instrument_ = source.instrument_;
 
77
    hplc_ = source.hplc_;
 
78
    datetime_ = source.datetime_;
 
79
    comment_ = source.comment_;
 
80
    protein_identifications_ = source.protein_identifications_;
 
81
                fraction_identifier_ = source.fraction_identifier_;
 
82
    MetaInfoInterface::operator=(source);
 
83
                DocumentIdentifier::operator=(source);
 
84
          
 
85
          return *this;
 
86
        }
 
87
 
 
88
  bool ExperimentalSettings::operator== (const ExperimentalSettings& rhs) const
 
89
  {
 
90
        return
 
91
            sample_ == rhs.sample_ &&
 
92
            source_files_ == rhs.source_files_ &&
 
93
            contacts_ == rhs.contacts_ &&
 
94
            instrument_ == rhs.instrument_ &&
 
95
            hplc_ == rhs.hplc_ &&
 
96
            datetime_ == rhs.datetime_ &&
 
97
        protein_identifications_ == rhs.protein_identifications_ &&
 
98
        comment_ == rhs.comment_ &&
 
99
                        fraction_identifier_ == rhs.fraction_identifier_ &&
 
100
                MetaInfoInterface::operator==(rhs) &&
 
101
                        DocumentIdentifier::operator==(rhs)
 
102
                ;
 
103
  }
 
104
 
 
105
  bool ExperimentalSettings::operator!= (const ExperimentalSettings& rhs) const
 
106
  {
 
107
        return !(operator==(rhs));
 
108
        }
 
109
 
 
110
        const Sample& ExperimentalSettings::getSample() const 
 
111
        {
 
112
          return sample_; 
 
113
        }
 
114
        
 
115
        Sample&  ExperimentalSettings::getSample()
 
116
        {
 
117
          return sample_; 
 
118
        }
 
119
        
 
120
        void ExperimentalSettings::setSample(const Sample& sample)
 
121
        {
 
122
          sample_ = sample; 
 
123
        }
 
124
        
 
125
        const vector<SourceFile>& ExperimentalSettings::getSourceFiles() const 
 
126
        {
 
127
          return source_files_; 
 
128
        }
 
129
        
 
130
        vector<SourceFile>& ExperimentalSettings::getSourceFiles()
 
131
        {
 
132
          return source_files_; 
 
133
        }
 
134
        
 
135
        void ExperimentalSettings::setSourceFiles(const vector<SourceFile>& source_file)
 
136
        {
 
137
          source_files_ = source_file; 
 
138
        }
 
139
        
 
140
        const vector<ContactPerson>& ExperimentalSettings::getContacts() const 
 
141
        {
 
142
          return contacts_; 
 
143
        }
 
144
        
 
145
        vector<ContactPerson>&  ExperimentalSettings::getContacts()
 
146
        {
 
147
          return contacts_; 
 
148
        }
 
149
        
 
150
        void ExperimentalSettings::setContacts(const std::vector<ContactPerson>& contacts)
 
151
        {
 
152
          contacts_ = contacts; 
 
153
        }
 
154
        
 
155
        const Instrument& ExperimentalSettings::getInstrument() const 
 
156
        {
 
157
          return instrument_; 
 
158
        }
 
159
        
 
160
        Instrument&  ExperimentalSettings::getInstrument()
 
161
        {
 
162
          return instrument_; 
 
163
        }
 
164
        
 
165
        void ExperimentalSettings::setInstrument(const Instrument& instrument)
 
166
        {
 
167
          instrument_ = instrument; 
 
168
        }
 
169
        
 
170
        const DateTime& ExperimentalSettings::getDateTime() const
 
171
        {
 
172
                return datetime_;
 
173
        }
 
174
        
 
175
        void ExperimentalSettings::setDateTime(const DateTime& date)
 
176
        {
 
177
                datetime_ = date;
 
178
        }
 
179
 
 
180
 
 
181
        const HPLC& ExperimentalSettings::getHPLC() const
 
182
        {
 
183
                return hplc_;
 
184
        }
 
185
        
 
186
        HPLC& ExperimentalSettings::getHPLC()
 
187
        {
 
188
                return hplc_;
 
189
        }
 
190
        
 
191
        void ExperimentalSettings::setHPLC(const HPLC& hplc)
 
192
        {
 
193
                hplc_ = hplc;
 
194
        }
 
195
 
 
196
        std::ostream& operator << (std::ostream& os, const ExperimentalSettings& /*exp*/)
 
197
        {
 
198
                os << "-- EXPERIMENTALSETTINGS BEGIN --"<<std::endl;
 
199
                os << "-- EXPERIMENTALSETTINGS END --"<<std::endl;
 
200
                return os;
 
201
        }
 
202
        
 
203
        const vector<ProteinIdentification>& ExperimentalSettings::getProteinIdentifications() const
 
204
        {
 
205
        return protein_identifications_;                        
 
206
        }       
 
207
                        
 
208
  vector<ProteinIdentification>& ExperimentalSettings::getProteinIdentifications()
 
209
  {
 
210
        return protein_identifications_;        
 
211
  }
 
212
  
 
213
  void ExperimentalSettings::setProteinIdentifications(const vector<ProteinIdentification>& protein_identifications)
 
214
  {
 
215
        protein_identifications_ = protein_identifications;
 
216
  }
 
217
  
 
218
        const String& ExperimentalSettings::getComment() const 
 
219
        {
 
220
          return comment_; 
 
221
        }
 
222
        
 
223
        void ExperimentalSettings::setComment(const String& comment)
 
224
        {
 
225
          comment_ = comment; 
 
226
        }
 
227
 
 
228
        const String& ExperimentalSettings::getFractionIdentifier() const 
 
229
        {
 
230
          return fraction_identifier_; 
 
231
        }
 
232
        
 
233
        void ExperimentalSettings::setFractionIdentifier(const String& fraction_identifier)
 
234
        {
 
235
          fraction_identifier_ = fraction_identifier; 
 
236
        }
 
237
        
 
238
}
 
239