1 | #ifndef __XIOS_CLIENT_TO_SERVER_STORE_FILTER__ |
---|
2 | #define __XIOS_CLIENT_TO_SERVER_STORE_FILTER__ |
---|
3 | |
---|
4 | #include "input_pin.hpp" |
---|
5 | #include "graph_package.hpp" |
---|
6 | |
---|
7 | namespace xios |
---|
8 | { |
---|
9 | class CField; |
---|
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 CClientToServerStoreFilter : 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 | CClientToServerStoreFilter(CGarbageCollector& gc, CField* field, CContextClient* client); |
---|
26 | /*! |
---|
27 | * Get the size of data transfered by call. Needed for context client buffer size evaluation |
---|
28 | * |
---|
29 | * \param size : map returning the size for each server rank |
---|
30 | * \return the associated context client |
---|
31 | */ |
---|
32 | CContextClient* getTransferedDataSize(map<int,int>& size) ; |
---|
33 | |
---|
34 | /*! |
---|
35 | * Tests if the filter must auto-trigger. |
---|
36 | * |
---|
37 | * \return true if the filter must auto-trigger |
---|
38 | */ |
---|
39 | bool virtual mustAutoTrigger() const; |
---|
40 | |
---|
41 | void buildWorkflowGraph(std::vector<CDataPacketPtr> data); |
---|
42 | |
---|
43 | /*! |
---|
44 | * Tests whether data is expected for the specified date. |
---|
45 | * |
---|
46 | * \param date the date associated to the data |
---|
47 | */ |
---|
48 | bool virtual isDataExpected(const CDate& date) const; |
---|
49 | CGraphPackage * graphPackage; |
---|
50 | bool graphEnabled; |
---|
51 | |
---|
52 | protected: |
---|
53 | /*! |
---|
54 | * Callbacks a field to write a packet to a file. |
---|
55 | * |
---|
56 | * \param data a vector of packets corresponding to each slot |
---|
57 | */ |
---|
58 | void virtual onInputReady(std::vector<CDataPacketPtr> data); |
---|
59 | |
---|
60 | private: |
---|
61 | CField* field_; //<! The associated field |
---|
62 | CContextClient* client_ ; //! the associated context client |
---|
63 | }; // class CClientToServerStoreFilter |
---|
64 | } // namespace xios |
---|
65 | |
---|
66 | #endif //__XIOS_CLIENT_TO_SERVER_STORE_FILTER__ |
---|