source: XIOS/trunk/src/filter/filter.hpp @ 638

Last change on this file since 638 was 637, checked in by rlacroix, 9 years ago

Add the base classes for the new filter framework.

File size: 1.2 KB
Line 
1#ifndef __XIOS_CFilter__
2#define __XIOS_CFilter__
3
4#include "input_pin.hpp"
5#include "output_pin.hpp"
6#include "filter_engine.hpp"
7
8namespace xios
9{
10  /*!
11   * A generic filter with an input pin and an output pin.
12   * A filter can delegate the internal work to an engine
13   * which may be shared by multiple filter instances.
14   */
15  class CFilter : public CInputPin, public COutputPin
16  {
17    public:
18      /*!
19       * Constructs a filter with the specified number of input slots
20       * and the specified engine.
21       *
22       * \param inputSlotsCount the number of input slots
23       * \param engine the filter engine
24       */
25      CFilter(size_t inputSlotsCount, IFilterEngine* engine);
26
27    protected:
28      IFilterEngine* engine; //!< The filter engine, might be the filter itself
29
30      /*!
31       * Generic implementation of the input pin notification function, processes
32       * the data using the filter engine and passes the resulting packet (if any)
33       * to the downstreams filters.
34       *
35       * \param data a vector of packets corresponding to each slot
36       */
37      void virtual onInputReady(std::vector<CDataPacketPtr> data);
38  }; // class CFilter
39} // namespace xios
40
41#endif //__XIOS_CFilter__
Note: See TracBrowser for help on using the repository browser.