00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // $Id: experiment.h,v 1.11 2005/12/23 17:01:56 amoll Exp $ 00005 // 00006 00007 #ifndef BALL_NMR_EXPERIMENT_H 00008 #define BALL_NMR_EXPERIMENT_H 00009 00010 #ifndef BALL_NMR_PEAKLIST_H 00011 # include <BALL/NMR/peakList.h> 00012 #endif 00013 00014 #ifndef BALL_NMR_SHIFTMODULE_H 00015 # include <BALL/NMR/shiftModule.h> 00016 #endif 00017 00018 #ifndef BALL_KERNEL_EXPRESSION_H 00019 # include <BALL/KERNEL/expression.h> 00020 #endif 00021 00022 namespace BALL 00023 { 00033 template <typename PeakListType> 00034 class BALL_EXPORT Experiment 00035 : public ShiftModule 00036 { 00037 public: 00038 00039 BALL_CREATE(Experiment) 00040 00041 00044 00045 typedef typename PeakListType::PeakType PeakType; 00047 00051 00054 Experiment(); 00057 Experiment(const Experiment& experiment); 00060 virtual ~Experiment() 00061 ; 00063 00069 const PeakListType& getPeakList() const; 00070 00077 const PeakType& getDefaultPeak() const; 00078 00082 void setDefaultPeak(const PeakType& peak); 00084 00085 protected: 00086 PeakListType peak_list_; 00087 PeakType default_peak_; 00088 }; 00089 00090 template <typename PeakListType> 00091 Experiment<PeakListType>::Experiment() 00092 : ShiftModule(), 00093 peak_list_(), 00094 default_peak_() 00095 { 00096 } 00097 00098 template <typename PeakListType> 00099 Experiment<PeakListType>::Experiment(const Experiment<PeakListType>& experiment) 00100 : ShiftModule(experiment), 00101 peak_list_(experiment.peak_list_), 00102 default_peak_(experiment.default_peak_) 00103 { 00104 } 00105 00106 template <typename PeakListType> 00107 Experiment<PeakListType>::~Experiment() 00108 00109 { 00110 } 00111 00112 template <typename PeakListType> 00113 const PeakListType& Experiment<PeakListType>::getPeakList() const 00114 { 00115 return peak_list_; 00116 } 00117 00118 template <typename PeakListType> 00119 const typename Experiment<PeakListType>::PeakType& Experiment<PeakListType>::getDefaultPeak() const 00120 { 00121 return default_peak_; 00122 } 00123 00124 template <typename PeakListType> 00125 void Experiment<PeakListType>::setDefaultPeak(const typename Experiment<PeakListType>::PeakType& peak) 00126 { 00127 default_peak_ = peak; 00128 } 00129 00136 typedef Experiment<PeakList1D> Experiment1D; 00137 00140 // ????? 00141 //typedef Experiment<PeakList2D> Experiment2D; 00142 00145 typedef Experiment<PeakList3D> Experiment3D; 00147 00157 class BALL_EXPORT SimpleExperiment1D 00158 : public Experiment1D 00159 { 00160 public: 00161 00165 00166 SimpleExperiment1D(); 00167 00169 SimpleExperiment1D(const SimpleExperiment1D& experiment); 00170 00172 virtual ~SimpleExperiment1D() 00173 ; 00175 00183 virtual bool start() 00184 ; 00193 virtual Processor::Result operator () (Composite& composite) 00194 ; 00196 00202 void setExpression(const String& expression); 00205 const Expression& getExpression() const; 00207 00208 protected: 00209 Expression expression_; 00210 }; 00211 00212 } //namespace BALL 00213 00214 #endif // BALL_NMR_EXPERIMENT_H