Last change
on this file since 2341 was
1704,
checked in by yushan, 5 years ago
|
Introducing the new graph functionality. Attribute build_workflow_graph=.TRUE. is used in the field definition section in the xml file to enable the workflow graph of the field and other fields referecing to it. A more detailed document will be available soon on the graph fuctionality.
|
File size:
1.3 KB
|
Rev | Line | |
---|
[637] | 1 | #include "filter.hpp" |
---|
| 2 | |
---|
| 3 | namespace xios |
---|
| 4 | { |
---|
[639] | 5 | CFilter::CFilter(CGarbageCollector& gc, size_t inputSlotsCount, IFilterEngine* engine) |
---|
| 6 | : CInputPin(gc, inputSlotsCount) |
---|
[1704] | 7 | , COutputPin(gc, false) |
---|
[637] | 8 | , engine(engine) |
---|
[827] | 9 | , inputSlotCount(inputSlotCount) |
---|
[637] | 10 | { /* Nothing to do */ } |
---|
| 11 | |
---|
[1704] | 12 | StdString CFilter::GetName(void) { return StdString("Filter"); } |
---|
| 13 | |
---|
[637] | 14 | void CFilter::onInputReady(std::vector<CDataPacketPtr> data) |
---|
| 15 | { |
---|
| 16 | CDataPacketPtr outputPacket = engine->apply(data); |
---|
| 17 | if (outputPacket) |
---|
[1021] | 18 | onOutputReady(outputPacket); |
---|
[637] | 19 | } |
---|
[1021] | 20 | |
---|
| 21 | void CFilter::setInputTrigger(size_t inputSlot, COutputPin* trigger) |
---|
| 22 | { |
---|
| 23 | // Was the filter already triggerable? If not, we need to inform |
---|
| 24 | // all downstream filters. |
---|
| 25 | bool wasTriggerable = canBeTriggered(); |
---|
| 26 | |
---|
| 27 | CInputPin::setInputTrigger(inputSlot, trigger); |
---|
| 28 | |
---|
| 29 | if (!wasTriggerable) |
---|
| 30 | setOutputTriggers(); |
---|
| 31 | } |
---|
| 32 | |
---|
| 33 | void CFilter::trigger(Time timestamp) |
---|
| 34 | { |
---|
| 35 | CInputPin::trigger(timestamp); |
---|
| 36 | |
---|
| 37 | COutputPin::trigger(timestamp); |
---|
| 38 | } |
---|
| 39 | |
---|
| 40 | bool CFilter::canBeTriggered() const |
---|
| 41 | { |
---|
| 42 | return (CInputPin::canBeTriggered() || COutputPin::canBeTriggered()); |
---|
| 43 | } |
---|
[1158] | 44 | |
---|
[1358] | 45 | bool CFilter::mustAutoTrigger() const |
---|
| 46 | { |
---|
| 47 | return COutputPin::mustAutoTrigger(); |
---|
| 48 | } |
---|
| 49 | |
---|
[1158] | 50 | bool CFilter::isDataExpected(const CDate& date) const |
---|
| 51 | { |
---|
| 52 | return COutputPin::isDataExpected(date); |
---|
| 53 | } |
---|
[637] | 54 | } // namespace xios |
---|
Note: See
TracBrowser
for help on using the repository browser.