Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

Sample Class Reference
[Metadata]

#include <OpenMS/METADATA/Sample.h>

Inheritance diagram for Sample:

MetaInfoInterface

List of all members.


Detailed Description

Meta information about the sample.

It contains basic descriptions like name, number (i.e. order number), mass, volume, concentration, state and a comment.

Additionally sample treatments like Digestion, Modification or Tagging can be added.

A Sample can be composed of other samples.

Public Types

enum  SampleState {
  SAMPLENULL, SOLID, LIQUID, GAS,
  SOLUTION, EULSION, SUSPENSION, SIZE_OF_SAMPLESTATE
}
 state of aggregation of the sample More...

Public Member Functions

 Sample ()
 default constructor
 Sample (const Sample &source)
 copy constructor
 ~Sample ()
 desctuctor
Sampleoperator= (const Sample &source)
 assignment operator
bool operator== (const Sample &rhs) const
 Equality operator.
const StringgetName () const
 retuns the sample name (default: "")
void setName (const String &name)
 sets the sample name
const StringgetOrganism () const
 retuns the sample name (default: "")
void setOrganism (const String &organism)
 sets the sample name
const StringgetNumber () const
 returns the sample number (default: "")
void setNumber (const String &number)
 sets the sample number (e.g. sample ID)
const StringgetComment () const
 returns the comment (default: "")
void setComment (const String &comment)
 sets the comment (may contain newline characters)
SampleState getState () const
 returns the state of aggregation (default: SAMPLENULL)
void setState (SampleState state)
 sets the state of aggregation
float getMass () const
 returns the mass (in mg) (default: 0.0)
void setMass (float mass)
 sets the mass (in mg)
float getVolume () const
 returns the volume (in ml) (default: 0.0)
void setVolume (float volume)
 sets the volume (in ml)
float getConcentration () const
 returns the concentration (in mg/ml) (default: 0.0)
void setConcentration (float concentration)
 sets the concentration (in mg/ml)
std::vector< Sample > & getSubsamples ()
 returns a mutable reference to the vector of subsamples that were combined to create this sample
const std::vector< Sample > & getSubsamples () const
 returns a const referenct to the vector of subsamples that were combined to create this sample
void setSubsamples (const std::vector< Sample > &subsamples)
 sets the vector of subsamples that were combined to create this sample
void addTreatment (const SampleTreatment &treatment, Int before_position=-1) throw (Exception::IndexOverflow)
 adds a sample treatment before the given postion (default is the end of the list). Sample treatments are ordered in the order of application to the sample. If before_position is smaller than 0, the sample treatment is appended to the list.
SampleTreatmentgetTreatment (UInt position) throw (Exception::IndexOverflow)
 returns a mutable reference to the sample treatment at the given position
const SampleTreatmentgetTreatment (UInt position) const throw (Exception::IndexOverflow)
 returns a const reference to the sample treatment at the given position
void removeTreatment (UInt position) throw (Exception::IndexOverflow)
 removes the sample treatment at the given position
Int countTreatments () const
 returns the number of sample treatments

Static Public Attributes

static const std::string NamesOfSampleState [SIZE_OF_SAMPLESTATE]
 Names of sample states.

Protected Attributes

String name_
String number_
String comment_
String organism_
SampleState state_
float mass_
float volume_
float concentration_
std::vector< Samplesubsamples_
std::list< SampleTreatment * > treatments_


Member Enumeration Documentation

enum SampleState

state of aggregation of the sample

Enumerator:
SAMPLENULL 
SOLID 
LIQUID 
GAS 
SOLUTION 
EULSION 
SUSPENSION 
SIZE_OF_SAMPLESTATE 


Constructor & Destructor Documentation

Sample (  ) 

default constructor

Sample ( const Sample source  ) 

copy constructor

~Sample (  ) 

desctuctor


Member Function Documentation

Sample& operator= ( const Sample source  ) 

assignment operator

bool operator== ( const Sample rhs  )  const

Equality operator.

const String& getName (  )  const

retuns the sample name (default: "")

void setName ( const String name  ) 

sets the sample name

const String& getOrganism (  )  const

retuns the sample name (default: "")

void setOrganism ( const String organism  ) 

sets the sample name

const String& getNumber (  )  const

returns the sample number (default: "")

void setNumber ( const String number  ) 

sets the sample number (e.g. sample ID)

const String& getComment (  )  const

returns the comment (default: "")

void setComment ( const String comment  ) 

sets the comment (may contain newline characters)

SampleState getState (  )  const

returns the state of aggregation (default: SAMPLENULL)

void setState ( SampleState  state  ) 

sets the state of aggregation

float getMass (  )  const

returns the mass (in mg) (default: 0.0)

void setMass ( float  mass  ) 

sets the mass (in mg)

float getVolume (  )  const

returns the volume (in ml) (default: 0.0)

void setVolume ( float  volume  ) 

sets the volume (in ml)

float getConcentration (  )  const

returns the concentration (in mg/ml) (default: 0.0)

void setConcentration ( float  concentration  ) 

sets the concentration (in mg/ml)

std::vector<Sample>& getSubsamples (  ) 

returns a mutable reference to the vector of subsamples that were combined to create this sample

const std::vector<Sample>& getSubsamples (  )  const

returns a const referenct to the vector of subsamples that were combined to create this sample

void setSubsamples ( const std::vector< Sample > &  subsamples  ) 

sets the vector of subsamples that were combined to create this sample

void addTreatment ( const SampleTreatment treatment,
Int  before_position = -1 
) throw (Exception::IndexOverflow)

adds a sample treatment before the given postion (default is the end of the list). Sample treatments are ordered in the order of application to the sample. If before_position is smaller than 0, the sample treatment is appended to the list.

SampleTreatment& getTreatment ( UInt  position  )  throw (Exception::IndexOverflow)

returns a mutable reference to the sample treatment at the given position

const SampleTreatment& getTreatment ( UInt  position  )  const throw (Exception::IndexOverflow)

returns a const reference to the sample treatment at the given position

void removeTreatment ( UInt  position  )  throw (Exception::IndexOverflow)

removes the sample treatment at the given position

Int countTreatments (  )  const

returns the number of sample treatments


Member Data Documentation

const std::string NamesOfSampleState[SIZE_OF_SAMPLESTATE] [static]

Names of sample states.

String name_ [protected]

String number_ [protected]

String comment_ [protected]

String organism_ [protected]

SampleState state_ [protected]

float mass_ [protected]

float volume_ [protected]

float concentration_ [protected]

std::vector<Sample> subsamples_ [protected]

std::list<SampleTreatment*> treatments_ [protected]


The documentation for this class was generated from the following file:
Generated Tue Apr 1 15:36:47 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1