source: XIOS/dev/branch_yushan/src/filter/filter.hpp @ 1037

Last change on this file since 1037 was 1037, checked in by yushan, 7 years ago

initialize the branch

File size: 1.3 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 gc the associated garbage collector
23       * \param inputSlotsCount the number of input slots
24       * \param engine the filter engine
25       */
26      CFilter(CGarbageCollector& gc, size_t inputSlotsCount, IFilterEngine* engine);
27
28    protected:
29      IFilterEngine* engine; //!< The filter engine, might be the filter itself
30      size_t inputSlotCount; //!< Number of slot on filter
31
32      /*!
33       * Generic implementation of the input pin notification function, processes
34       * the data using the filter engine and passes the resulting packet (if any)
35       * to the downstreams filters.
36       *
37       * \param data a vector of packets corresponding to each slot
38       */
39      void virtual onInputReady(std::vector<CDataPacketPtr> data);
40  }; // class CFilter
41} // namespace xios
42
43#endif //__XIOS_CFilter__
Note: See TracBrowser for help on using the repository browser.