#ifndef __XIOS_CSourceFilter__ #define __XIOS_CSourceFilter__ #include #include "output_pin.hpp" namespace xios { class CGrid; /*! * A source filter is the entry point of the data in the graph of filters. */ class CSourceFilter : public COutputPin { public: /*! * Constructs a source filter accepting data attached to the specified grid. * * \param gc the garbage collector associated with this filter * \param grid the grid to which the data is attached * \param offset the offset applied to the timestamp of all packets * \param manualTrigger whether the output should be triggered manually */ CSourceFilter(CGarbageCollector& gc, CGrid* grid, const CDuration offset = NoneDu, bool manualTrigger = false); /*! * Transforms the data received from the model into a packet and send it * in the filter graph. The array containing the data can safely be reused * immediately after this method returns. * * \param date the date associated to the data * \param data an array containing the data */ template void streamData(CDate date, const CArray& data); /*! * Transforms the data received from the server into a packet and send it * in the filter graph. The array containing the data can safely be reused * immediately after this method returns. * * \param date the date associated to the data * \param data an array containing the data */ void streamDataFromServer(CDate date, const std::map >& data); /*! * Signals the filter graph that the end of stream was reached. * * \param date the date at which the end of stream occurred */ void signalEndOfStream(CDate date); private: CGrid* grid; //!< The grid attached to the data the filter can accept const CDuration offset; //!< The offset applied to the timestamp of all packets }; // class CSourceFilter } // namespace xios #endif //__XIOS_CSourceFilter__