source: XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/server_to_client_filter.hpp @ 1883

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

XIOS coupling branch
Adopt infrastructure based on filter for reading data on server side and sending it to the client, in a similar way on what is done for other case.

YM

  • Property svn:executable set to *
File size: 1.6 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 CContextClient ;
10
11  /*!
12   * A terminal filter which transmits the packets it receives to a field for writting in a file.
13   */
14  class CServerToClientFilter : 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      CServerToClientFilter(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_SERVER_TO_CLIENT_FILTER_HPP
Note: See TracBrowser for help on using the repository browser.