1 | #ifndef __XIOS_CFileWriterFilter__ |
---|
2 | #define __XIOS_CFileWriterFilter__ |
---|
3 | |
---|
4 | #include "input_pin.hpp" |
---|
5 | |
---|
6 | namespace 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 CFileWriterFilter : 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 | CFileWriterFilter(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_CFileWriterFilter__ |
---|