Last change
on this file since 2010 was
1358,
checked in by rlacroix, 7 years ago
|
Support reentrant workflows and workflows with temporal integration for fields read from files.
|
File size:
1.2 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) |
---|
[1021] | 7 | , COutputPin(gc) |
---|
[637] | 8 | , engine(engine) |
---|
[827] | 9 | , inputSlotCount(inputSlotCount) |
---|
[637] | 10 | { /* Nothing to do */ } |
---|
| 11 | |
---|
| 12 | void CFilter::onInputReady(std::vector<CDataPacketPtr> data) |
---|
| 13 | { |
---|
| 14 | CDataPacketPtr outputPacket = engine->apply(data); |
---|
| 15 | if (outputPacket) |
---|
[1021] | 16 | onOutputReady(outputPacket); |
---|
[637] | 17 | } |
---|
[1021] | 18 | |
---|
| 19 | void CFilter::setInputTrigger(size_t inputSlot, COutputPin* trigger) |
---|
| 20 | { |
---|
| 21 | // Was the filter already triggerable? If not, we need to inform |
---|
| 22 | // all downstream filters. |
---|
| 23 | bool wasTriggerable = canBeTriggered(); |
---|
| 24 | |
---|
| 25 | CInputPin::setInputTrigger(inputSlot, trigger); |
---|
| 26 | |
---|
| 27 | if (!wasTriggerable) |
---|
| 28 | setOutputTriggers(); |
---|
| 29 | } |
---|
| 30 | |
---|
| 31 | void CFilter::trigger(Time timestamp) |
---|
| 32 | { |
---|
| 33 | CInputPin::trigger(timestamp); |
---|
| 34 | |
---|
| 35 | COutputPin::trigger(timestamp); |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | bool CFilter::canBeTriggered() const |
---|
| 39 | { |
---|
| 40 | return (CInputPin::canBeTriggered() || COutputPin::canBeTriggered()); |
---|
| 41 | } |
---|
[1158] | 42 | |
---|
[1358] | 43 | bool CFilter::mustAutoTrigger() const |
---|
| 44 | { |
---|
| 45 | return COutputPin::mustAutoTrigger(); |
---|
| 46 | } |
---|
| 47 | |
---|
[1158] | 48 | bool CFilter::isDataExpected(const CDate& date) const |
---|
| 49 | { |
---|
| 50 | return COutputPin::isDataExpected(date); |
---|
| 51 | } |
---|
[637] | 52 | } // namespace xios |
---|
Note: See
TracBrowser
for help on using the repository browser.