00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // -------------------------------------------------------------------------- 00005 // OpenMS Mass Spectrometry Framework 00006 // -------------------------------------------------------------------------- 00007 // Copyright (C) 2003-2008 -- Oliver Kohlbacher, Knut Reinert 00008 // 00009 // This library is free software; you can redistribute it and/or 00010 // modify it under the terms of the GNU Lesser General Public 00011 // License as published by the Free Software Foundation; either 00012 // version 2.1 of the License, or (at your option) any later version. 00013 // 00014 // This library is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 // Lesser General Public License for more details. 00018 // 00019 // You should have received a copy of the GNU Lesser General Public 00020 // License along with this library; if not, write to the Free Software 00021 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 // 00023 // -------------------------------------------------------------------------- 00024 // $Maintainer: Marc Sturm $ 00025 // -------------------------------------------------------------------------- 00026 00027 #ifndef OPENMS_METADATA_SAMPLE_H 00028 #define OPENMS_METADATA_SAMPLE_H 00029 00030 #include <list> 00031 00032 #include <OpenMS/DATASTRUCTURES/String.h> 00033 #include <OpenMS/METADATA/MetaInfoInterface.h> 00034 #include <OpenMS/CONCEPT/Exception.h> 00035 00036 namespace OpenMS 00037 { 00038 class SampleTreatment; 00039 00052 class Sample: public MetaInfoInterface 00053 { 00054 public: 00056 enum SampleState {SAMPLENULL,SOLID,LIQUID,GAS,SOLUTION,EULSION,SUSPENSION,SIZE_OF_SAMPLESTATE}; 00058 static const std::string NamesOfSampleState[SIZE_OF_SAMPLESTATE]; 00059 00061 Sample(); 00063 Sample(const Sample& source); 00065 ~Sample(); 00066 00068 Sample& operator= (const Sample& source); 00069 00071 bool operator== (const Sample& rhs) const; 00072 00074 const String& getName() const; 00076 void setName(const String& name); 00077 00079 const String& getOrganism() const; 00081 void setOrganism(const String& organism); 00082 00084 const String& getNumber() const; 00086 void setNumber(const String& number); 00087 00089 const String& getComment() const; 00091 void setComment(const String& comment); 00092 00094 SampleState getState() const; 00096 void setState(SampleState state); 00097 00099 float getMass() const; 00101 void setMass(float mass); 00102 00104 float getVolume() const; 00106 void setVolume(float volume); 00107 00109 float getConcentration() const; 00111 void setConcentration(float concentration); 00112 00114 std::vector<Sample>& getSubsamples(); 00116 const std::vector<Sample>& getSubsamples() const; 00118 void setSubsamples(const std::vector<Sample>& subsamples); 00119 00121 void addTreatment(const SampleTreatment& treatment,Int before_position=-1) throw (Exception::IndexOverflow); 00123 SampleTreatment& getTreatment(UInt position) throw (Exception::IndexOverflow); 00125 const SampleTreatment& getTreatment(UInt position) const throw (Exception::IndexOverflow); 00127 void removeTreatment(UInt position) throw (Exception::IndexOverflow); 00129 Int countTreatments() const; 00130 00131 protected: 00132 String name_; 00133 String number_; 00134 String comment_; 00135 String organism_; 00136 SampleState state_; 00137 float mass_; 00138 float volume_; 00139 float concentration_; 00140 std::vector<Sample> subsamples_; 00141 std::list<SampleTreatment*> treatments_; 00142 00143 }; 00144 } // namespace OpenMS 00145 00146 #endif // OPENMS_METADATA_SAMPLE_H
Generated Tue Apr 1 15:36:37 2008 -- using doxygen 1.5.4 | OpenMS / TOPP 1.1 |