source: XIOS/dev/dev_trunk_graph/src/filter/server_to_client_store_filter.hpp @ 2027

Last change on this file since 2027 was 2019, checked in by yushan, 3 years ago

Graph intermedia commit to a tmp branch

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#ifndef __XIOS_SERVER_TO_CLIENT_FILTER_HPP__
2#define __XIOS_SERVER_TO_CLIENT_FILTER_HPP__
3
4#include "input_pin.hpp"
5#include "graph_package.hpp"
6
7namespace xios
8{
9  class CField;
10  class CGrid ;
11  class CContextClient ;
12
13  /*!
14   * A terminal filter which transmits the packets it receives to a field for writting in a file.
15   */
16  class CServerToClientStoreFilter : public CInputPin
17  {
18    public:
19      /*!
20       * Constructs the filter (with one input slot) associated to the specified field
21       * and a garbage collector.
22       *
23       * \param gc the associated garbage collector
24       * \param field the associated field
25       */
26      CServerToClientStoreFilter(CGarbageCollector& gc, CField* field, CContextClient* client);
27
28      /*!
29       * Tests if the filter must auto-trigger.
30       *
31       * \return true if the filter must auto-trigger
32       */
33      bool virtual mustAutoTrigger() const;
34
35      /*!
36       * Tests whether data is expected for the specified date.
37       *
38       * \param date the date associated to the data
39       */
40      bool virtual isDataExpected(const CDate& date) const;
41      CGraphPackage * graphPackage;
42      bool graphEnabled;
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      CGrid* grid_; //<! The associated grid
55      CContextClient* client_ ; //! the associated context client
56      std::map<Time, CDataPacketPtr> packets; //<! The stored packets
57      int nStep_ = 0 ;
58  }; // class CServerToClientStoreFilter
59} // namespace xios
60
61#endif // XIOS_SERVER_TO_CLIENT_FILTER_HPP
Note: See TracBrowser for help on using the repository browser.