source: XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/server_to_client_store_filter.hpp @ 2010

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

Big update on on going work related to data distribution and transfer between clients and servers.
Revisite of the source and store filter using "connectors".

-> inputs work again

YM

  • Property svn:executable set to *
File size: 1.7 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
6namespace xios
7{
8  class CField;
9  class CGrid ;
10  class CContextClient ;
11
12  /*!
13   * A terminal filter which transmits the packets it receives to a field for writting in a file.
14   */
15  class CServerToClientStoreFilter : public CInputPin
16  {
17    public:
18      /*!
19       * Constructs the filter (with one input slot) associated to the specified field
20       * and a garbage collector.
21       *
22       * \param gc the associated garbage collector
23       * \param field the associated field
24       */
25      CServerToClientStoreFilter(CGarbageCollector& gc, CField* field, CContextClient* client);
26
27      /*!
28       * Tests if the filter must auto-trigger.
29       *
30       * \return true if the filter must auto-trigger
31       */
32      bool virtual mustAutoTrigger() const;
33
34      /*!
35       * Tests whether data is expected for the specified date.
36       *
37       * \param date the date associated to the data
38       */
39      bool virtual isDataExpected(const CDate& date) const;
40
41    protected:
42      /*!
43       * Callbacks a field to write a packet to a file.
44       *
45       * \param data a vector of packets corresponding to each slot
46       */
47      void virtual onInputReady(std::vector<CDataPacketPtr> data);
48
49    private:
50      CField* field_; //<! The associated field
51      CGrid* grid_; //<! The associated grid
52      CContextClient* client_ ; //! the associated context client
53      std::map<Time, CDataPacketPtr> packets; //<! The stored packets
54      int nStep_ = 0 ;
55  }; // class CServerToClientStoreFilter
56} // namespace xios
57
58#endif // XIOS_SERVER_TO_CLIENT_FILTER_HPP
Note: See TracBrowser for help on using the repository browser.