public Cursor(StatefulFilterTransform <TSrc, TDst, TState> parent, IRowCursor <TSrc> input, Func <int, bool> predicate)
                : base(parent.Host)
            {
                Ch.AssertValue(input);
                Ch.AssertValue(predicate);

                _parent = parent;
                _input  = input;

                _src   = new TSrc();
                _dst   = new TDst();
                _state = new TState();

                CursorChannelAttribute.TrySetCursorChannel(_parent.Host, _src, Ch);
                CursorChannelAttribute.TrySetCursorChannel(_parent.Host, _dst, Ch);
                CursorChannelAttribute.TrySetCursorChannel(_parent.Host, _state, Ch);

                if (parent._initStateAction != null)
                {
                    parent._initStateAction(_state);
                }

                var appendedDataView = new DataViewConstructionUtils.SingleRowLoopDataView <TDst>(parent.Host, _parent._addedSchema);

                appendedDataView.SetCurrentRowObject(_dst);

                Func <int, bool> appendedPredicate =
                    col =>
                {
                    col = _parent._bindings.AddedColumnIndices[col];
                    return(predicate(col));
                };

                _appendedRow = appendedDataView.GetRowCursor(appendedPredicate);
            }
Example #2
0
            public Cursor(IHost host, MapTransform <TSrc, TDst> owner, IRowCursor <TSrc> input, Func <int, bool> predicate)
                : base(host, input)
            {
                Ch.AssertValue(owner);
                Ch.AssertValue(input);
                Ch.AssertValue(predicate);

                _src = new TSrc();
                _dst = new TDst();
                _row = new Row(input, owner, predicate, _src, _dst);

                CursorChannelAttribute.TrySetCursorChannel(host, _src, Ch);
                CursorChannelAttribute.TrySetCursorChannel(host, _dst, Ch);
            }