Last change
on this file since 756 was
639,
checked in by rlacroix, 9 years ago
|
Add a basic garbage collector to ensure no packets linger in the filter graph.
|
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 | |
---|
8 | namespace 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 | |
---|
31 | /*! |
---|
32 | * Generic implementation of the input pin notification function, processes |
---|
33 | * the data using the filter engine and passes the resulting packet (if any) |
---|
34 | * to the downstreams filters. |
---|
35 | * |
---|
36 | * \param data a vector of packets corresponding to each slot |
---|
37 | */ |
---|
38 | void virtual onInputReady(std::vector<CDataPacketPtr> data); |
---|
39 | }; // class CFilter |
---|
40 | } // namespace xios |
---|
41 | |
---|
42 | #endif //__XIOS_CFilter__ |
---|
Note: See
TracBrowser
for help on using the repository browser.