source: XIOS/trunk/src/filter/source_filter.hpp @ 643

Last change on this file since 643 was 643, checked in by rlacroix, 9 years ago

Use the filter infrastructure to handle the temporal operations.

Add a temporal filter to do so.

File size: 1.7 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 grid the grid to which the data is attached
22       */
23      CSourceFilter(CGrid* grid);
24
25      /*!
26       * Transforms the data received from the model into a packet and send it
27       * in the filter graph. The array containing the data can safely be reused
28       * immediately after this method returns.
29       *
30       * \param date the date associated to the data
31       * \param data an array containing the data
32       */
33      template <int N>
34      void streamData(CDate date, const CArray<double, N>& data);
35
36      /*!
37       * Transforms the data received from the server into a packet and send it
38       * in the filter graph. The array containing the data can safely be reused
39       * immediately after this method returns.
40       *
41       * \param date the date associated to the data
42       * \param data an array containing the data
43       */
44      void streamDataFromServer(CDate date, const std::map<int, CArray<double, 1> >& data);
45
46      /*!
47       * Signals the filter graph that the end of stream was reached.
48       *
49       * \param date the date at which the end of stream occurred
50       */
51      void signalEndOfStream(CDate date);
52
53    private:
54      CGrid* grid; //!< The grid attached to the data the filter can accept
55  }; // class CSourceFilter
56} // namespace xios
57
58#endif //__XIOS_CSourceFilter__
Note: See TracBrowser for help on using the repository browser.