source: XIOS/dev/dev_trunk_omp/src/filter/file_writer_filter.hpp @ 1681

Last change on this file since 1681 was 1681, checked in by yushan, 5 years ago

MARK: Dynamic workflow graph developement. Branch up to date with trunk @1676. Bug fixed

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