source: XIOS/dev/dev_olga/src/filter/file_server_writer_filter.hpp @ 1653

Last change on this file since 1653 was 1653, checked in by oabramkina, 5 years ago

Developments for visualization of XIOS workflow.

Branch is spawned from trunk r1649.

Boost library is used for producing Graphviz DOT files. Current results: a DOT file representing a static workflow. For a complete proof of concept, DOT files for each timestamp should be generated. The necessary information has been collected by XIOS, it only requires rearranging the information for graphing (changes in classes CWorkflowGraph and CGraphviz).

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