Gyoto
GyotoSpectrometer.h
Go to the documentation of this file.
1 
8 /*
9  Copyright 2011, 2013 Thibaut Paumard
10 
11  This file is part of Gyoto.
12 
13  Gyoto is free software: you can redistribute it and/or modify
14  it under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  Gyoto is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  GNU General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
25  */
26 
27 #ifndef __GyotoSpectrometer_H_
28 #define __GyotoSpectrometer_H_
29 
30 #include <GyotoDefs.h>
31 #include <GyotoSmartPointer.h>
32 #include <GyotoRegister.h>
33 #include <GyotoHooks.h>
34 #include <string>
35 
49 namespace Gyoto{
50  namespace Spectrometer {
68  class Generic;
69 
82  typedef char const * kind_t;
83 
84 #if defined GYOTO_USE_XERCES
85 
96 
110  int errmode = 1);
111 
123  SmartPointer<T> spectro = new T();
124  if (fmp) spectro -> setParameters(fmp);
125  return spectro;
126  }
127 
136 
142  void initRegister();
143 
163  void Register(std::string name, Gyoto::Spectrometer::Subcontractor_t* scp);
164 #endif
165 
166  }
167 }
168 
170 : protected Gyoto::SmartPointee,
171  public Gyoto::Hook::Teller
172 {
173  friend class Gyoto::SmartPointer<Gyoto::Spectrometer::Generic>;
174  protected:
184  public:
187 
203  double* boundaries_;
204 
211 
217  double* midpoints_;
218 
224  double* widths_;
225 
226  public:
232  Generic();
233 
254  Generic(kind_t kind);
255 
261  Generic(const Generic& ) ;
262 
276  virtual Generic * clone() const =0;
277 
283  virtual ~Generic();
284 
299  virtual kind_t getKind() const ;
300 
321  virtual void setKind(kind_t) ;
322 
323  virtual size_t getNSamples() const ;
324  virtual size_t getNBoundaries() const ;
325  virtual double const * getMidpoints() const ;
326 
331  virtual void getMidpoints( double data[], std::string unit);
337  virtual void getChannelBoundaries( double data[], std::string unit);
338  virtual double const * getChannelBoundaries() const ;
339  virtual size_t const * getChannelIndices() const ;
340  virtual double const * getWidths() const ;
341 
351  virtual void getWidths( double data[], std::string unit);
352 
378  virtual int setParameter(std::string name,
379  std::string content,
380  std::string unit);
381 #ifdef GYOTO_USE_XERCES
382 
383 
407  virtual void setParameters(Gyoto::FactoryMessenger *fmp) ;
408 
419  virtual void fillElement(FactoryMessenger *fmp) const ;
420 
421 #endif
422 };
423 
424 
425 #endif