source: XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/file_reader_source_filter.hpp @ 2230

Last change on this file since 2230 was 1935, checked in by ymipsl, 4 years ago

XIOS coupling.
Reorganize filters, update of the day.

YM

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#ifndef  __XIOS_FILE_READER_SOURCE_FILTER_HPP__
2#define  __XIOS_FILE_READER_SOURCE_FILTER_HPP__
3
4#include "output_pin.hpp"
5
6namespace xios
7{
8  class CField;
9  class CFile ;
10  class CGrid ;
11
12  /*!
13   * A source filter is the entry point of the data in the graph of filters.
14   */
15  class CFileReaderSourceFilter : public COutputPin
16  {
17    public:
18      /*!
19       * Constructs a source filter accepting data attached to the specified grid.
20       *
21       * \param gc the garbage collector associated with this filter
22       * \param field the field to which the data is related
23       */
24      CFileReaderSourceFilter(CGarbageCollector& gc, CField* field);
25
26      /*!
27       * Transforms the data received from the model into a packet and send it
28       * in the filter graph. The array containing the data can safely be reused
29       * immediately after this method returns.
30       *
31       * \param date the date associated to the data
32       * \param data an array containing the data
33       */
34      void streamData(void);
35      void initialize(void) ;
36      void readData(CArray<double,1>& data) ;
37
38    private:
39      CGrid* grid_;             //!< The grid attached to the data the filter can accept
40      CField* field_ ;
41      CFile* file_ ;
42      bool hasScaleFactor_ = false;
43      bool hasAddOffset_ = false ;
44      bool isInitialized_ = false ;
45      bool isCyclic_ = false ;
46      double scaleFactor_= 1.0 ;
47      double addOffset_= 0. ;
48      int nStepMax_ ;
49      int nStep_ ;
50
51  }; // class CFileReaderSourceFilter
52} // namespace xios
53
54#endif //  __XIOS_FILE_READER_SOURCE_FILTER_HPP__
Note: See TracBrowser for help on using the repository browser.