source: XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/file_writer_filter.hpp @ 1853

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

Coupling branch : replace hasServer and hasClient combination by the name of correct service : CLIENT, GATHERER or OUT_SERVER.

YM

File size: 1.5 KB
Line 
1#ifndef __XIOS_CFileWriterFilter__
2#define __XIOS_CFileWriterFilter__
3
4#include "input_pin.hpp"
5
6namespace xios
7{
8  class CField;
9  class CContextClient ;
10
11  /*!
12   * A terminal filter which transmits the packets it receives to a field for writting in a file.
13   */
14  class CFileWriterFilter : public CInputPin
15  {
16    public:
17      /*!
18       * Constructs the filter (with one input slot) associated to the specified field
19       * and a garbage collector.
20       *
21       * \param gc the associated garbage collector
22       * \param field the associated field
23       */
24      CFileWriterFilter(CGarbageCollector& gc, CField* field, CContextClient* client);
25
26      /*!
27       * Tests if the filter must auto-trigger.
28       *
29       * \return true if the filter must auto-trigger
30       */
31      bool virtual mustAutoTrigger() const;
32
33      /*!
34       * Tests whether data is expected for the specified date.
35       *
36       * \param date the date associated to the data
37       */
38      bool virtual isDataExpected(const CDate& date) const;
39
40    protected:
41      /*!
42       * Callbacks a field to write a packet to a file.
43       *
44       * \param data a vector of packets corresponding to each slot
45       */
46      void virtual onInputReady(std::vector<CDataPacketPtr> data);
47
48    private:
49      CField* field; //<! The associated field
50      CContextClient* client_ ; //! the associated context client
51      std::map<Time, CDataPacketPtr> packets; //<! The stored packets
52  }; // class CFileWriterFilter
53} // namespace xios
54
55#endif //__XIOS_CFileWriterFilter__
Note: See TracBrowser for help on using the repository browser.