source: XIOS/dev/branch_openmp/src/filter/source_filter.hpp @ 1460

Last change on this file since 1460 was 1460, checked in by yushan, 6 years ago

branch_openmp merged with XIOS_DEV_CMIP6@1459

File size: 2.5 KB
Line 
1#ifndef __XIOS_CSourceFilter__
2#define __XIOS_CSourceFilter__
3
4#include <map>
5
6#include "output_pin.hpp"
7
8namespace xios
9{
10  class CGrid;
11
12  /*!
13   * A source filter is the entry point of the data in the graph of filters.
14   */
15  class CSourceFilter : 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 grid the grid to which the data is attached
23       * \param offset the offset applied to the timestamp of all packets
24       * \param manualTrigger whether the output should be triggered manually
25       * \param hasMissingValue whether data has missing value
26       * \param defaultValue missing value to detect
27       */
28      CSourceFilter(CGarbageCollector& gc, CGrid* grid,
29                    bool compression=true,
30                    const CDuration offset = NoneDu, bool manualTrigger = false,
31                    bool hasMissingValue = false,
32                    double defaultValue = 0.0);
33
34      /*!
35       * Transforms the data received from the model into a packet and send it
36       * in the filter graph. The array containing the data can safely be reused
37       * immediately after this method returns.
38       *
39       * \param date the date associated to the data
40       * \param data an array containing the data
41       */
42      template <int N>
43      void streamData(CDate date, const CArray<double, N>& data);
44
45      /*!
46       * Transforms the data received from the server into a packet and send it
47       * in the filter graph. The array containing the data can safely be reused
48       * immediately after this method returns.
49       *
50       * \param date the date associated to the data
51       * \param data an array containing the data
52       */
53      void streamDataFromServer(CDate date, const std::map<int, CArray<double, 1> >& data);
54
55      /*!
56       * Signals the filter graph that the end of stream was reached.
57       *
58       * \param date the date at which the end of stream occurred
59       */
60      void signalEndOfStream(CDate date);
61
62    private:
63      CGrid* grid; //!< The grid attached to the data the filter can accept
64      const CDuration offset; //!< The offset applied to the timestamp of all packets
65      const bool hasMissingValue;
66      const double defaultValue;
67      const bool compression ; //!< indicate if the data need to be compressed : on client size : true, on server side : false
68  }; // class CSourceFilter
69} // namespace xios
70
71#endif //__XIOS_CSourceFilter__
Note: See TracBrowser for help on using the repository browser.