[638] | 1 | #ifndef __XIOS_CSourceFilter__ |
---|
| 2 | #define __XIOS_CSourceFilter__ |
---|
| 3 | |
---|
| 4 | #include <map> |
---|
| 5 | |
---|
| 6 | #include "output_pin.hpp" |
---|
| 7 | |
---|
| 8 | namespace xios |
---|
| 9 | { |
---|
| 10 | class CGrid; |
---|
| 11 | |
---|
| 12 | /*! |
---|
| 13 | * A source filter is the entry point of the data in the graph of filters. |
---|
| 14 | */ |
---|
| 15 | class CSourceFilter : public COutputPin |
---|
| 16 | { |
---|
| 17 | public: |
---|
| 18 | /*! |
---|
| 19 | * Constructs a source filter accepting data attached to the specified grid. |
---|
| 20 | * |
---|
| 21 | * \param grid the grid to which the data is attached |
---|
| 22 | */ |
---|
| 23 | CSourceFilter(CGrid* grid); |
---|
| 24 | |
---|
| 25 | /*! |
---|
| 26 | * Transforms the data received from the model into a packet and send it |
---|
| 27 | * in the filter graph. The array containing the data can safely be reused |
---|
| 28 | * immediately after this method returns. |
---|
| 29 | * |
---|
| 30 | * \param timestamp the timestamp of the data |
---|
| 31 | * \param data an array containing the data |
---|
| 32 | */ |
---|
| 33 | template <int N> |
---|
| 34 | void streamData(Time timestamp, const CArray<double, N>& data); |
---|
| 35 | |
---|
| 36 | /*! |
---|
| 37 | * Transforms the data received from the server into a packet and send it |
---|
| 38 | * in the filter graph. The array containing the data can safely be reused |
---|
| 39 | * immediately after this method returns. |
---|
| 40 | * |
---|
| 41 | * \param timestamp the timestamp of the data |
---|
| 42 | * \param data an array containing the data |
---|
| 43 | */ |
---|
| 44 | void streamDataFromServer(Time timestamp, const std::map<int, CArray<double, 1> >& data); |
---|
| 45 | |
---|
| 46 | /*! |
---|
| 47 | * Signals the filter graph that the end of stream was reached. |
---|
| 48 | * |
---|
| 49 | * \param timestamp the timestamp at which the end of stream occurred |
---|
| 50 | */ |
---|
| 51 | void signalEndOfStream(Time timestamp); |
---|
| 52 | |
---|
| 53 | private: |
---|
| 54 | CGrid* grid; //!< The grid attached to the data the filter can accept |
---|
| 55 | }; // class CSourceFilter |
---|
| 56 | } // namespace xios |
---|
| 57 | |
---|
| 58 | #endif //__XIOS_CSourceFilter__ |
---|