Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Sample.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2017.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Timo Sachsenberg $
32 // $Authors: Marc Sturm $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_METADATA_SAMPLE_H
36 #define OPENMS_METADATA_SAMPLE_H
37 
38 #include <list>
39 
43 
44 namespace OpenMS
45 {
46  class SampleTreatment;
47 
60  class OPENMS_DLLAPI Sample :
61  public MetaInfoInterface
62  {
63 public:
65  enum SampleState {SAMPLENULL, SOLID, LIQUID, GAS, SOLUTION, EMULSION, SUSPENSION, SIZE_OF_SAMPLESTATE};
67  static const std::string NamesOfSampleState[SIZE_OF_SAMPLESTATE];
68 
70  Sample();
72  Sample(const Sample & source);
74  ~Sample();
75 
77  Sample & operator=(const Sample & source);
78 
80  bool operator==(const Sample & rhs) const;
81 
83  const String & getName() const;
85  void setName(const String & name);
86 
88  const String & getOrganism() const;
90  void setOrganism(const String & organism);
91 
93  const String & getNumber() const;
95  void setNumber(const String & number);
96 
98  const String & getComment() const;
100  void setComment(const String & comment);
101 
103  SampleState getState() const;
105  void setState(SampleState state);
106 
108  double getMass() const;
110  void setMass(double mass);
111 
113  double getVolume() const;
115  void setVolume(double volume);
116 
118  double getConcentration() const;
120  void setConcentration(double concentration);
121 
123  std::vector<Sample> & getSubsamples();
125  const std::vector<Sample> & getSubsamples() const;
127  void setSubsamples(const std::vector<Sample> & subsamples);
128 
134  void addTreatment(const SampleTreatment & treatment, Int before_position = -1);
140  SampleTreatment & getTreatment(UInt position);
146  const SampleTreatment & getTreatment(UInt position) const;
152  void removeTreatment(UInt position);
154  Int countTreatments() const;
155 
156 protected:
162  double mass_;
163  double volume_;
165  std::vector<Sample> subsamples_;
166  std::list<SampleTreatment *> treatments_;
167 
168  };
169 } // namespace OpenMS
170 
171 #endif // OPENMS_METADATA_SAMPLE_H
A more convenient string class.
Definition: String.h:57
Definition: Sample.h:65
String organism_
Definition: Sample.h:160
Base class for sample treatments (Digestion, Modification, Tagging, ...)
Definition: SampleTreatment.h:52
unsigned int UInt
Unsigned integer type.
Definition: Types.h:95
bool operator==(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:806
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
SampleState state_
Definition: Sample.h:161
double mass_
Definition: Sample.h:162
std::list< SampleTreatment * > treatments_
Definition: Sample.h:166
Meta information about the sample.
Definition: Sample.h:60
String comment_
Definition: Sample.h:159
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition: MetaInfoInterface.h:56
String number_
Definition: Sample.h:158
String name_
Definition: Sample.h:157
SampleState
state of aggregation of the sample
Definition: Sample.h:65
double volume_
Definition: Sample.h:163
double concentration_
Definition: Sample.h:164
std::vector< Sample > subsamples_
Definition: Sample.h:165
int Int
Signed integer type.
Definition: Types.h:103

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:03 using doxygen 1.8.13