source: XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/client_to_server_store_filter.hpp @ 2130

Last change on this file since 2130 was 2130, checked in by ymipsl, 3 years ago

New management of client-server buffers.

  • buffers can grow automatically in intialization phase
  • buffers is evaluated after the close context definition phase and fixed at optimal value.

YM

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#ifndef __XIOS_CLIENT_TO_SERVER_STORE_FILTER__
2#define __XIOS_CLIENT_TO_SERVER_STORE_FILTER__
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 CClientToServerStoreFilter : 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      CClientToServerStoreFilter(CGarbageCollector& gc, CField* field, CContextClient* client);
25      /*!
26       * Get the size of data transfered by call. Needed for context client buffer size evaluation
27       *
28       * \param size : map returning the size for each server rank 
29       * \return the associated context client
30       */
31      CContextClient* getTransferedDataSize(map<int,int>& size) ;
32
33      /*!
34       * Tests if the filter must auto-trigger.
35       *
36       * \return true if the filter must auto-trigger
37       */
38      bool virtual mustAutoTrigger() const;
39
40      /*!
41       * Tests whether data is expected for the specified date.
42       *
43       * \param date the date associated to the data
44       */
45      bool virtual isDataExpected(const CDate& date) const;
46
47    protected:
48      /*!
49       * Callbacks a field to write a packet to a file.
50       *
51       * \param data a vector of packets corresponding to each slot
52       */
53      void virtual onInputReady(std::vector<CDataPacketPtr> data);
54
55    private:
56      CField* field_; //<! The associated field
57      CContextClient* client_ ; //! the associated context client
58  }; // class CClientToServerStoreFilter
59} // namespace xios
60
61#endif //__XIOS_CLIENT_TO_SERVER_STORE_FILTER__
Note: See TracBrowser for help on using the repository browser.