public Cursor(PerGroupTransformBase <TLabel, TScore, TState> parent, DataViewRowCursor input, DataViewRowCursor groupCursor, bool[] active) : base(parent.Host) { Ch.AssertValue(parent); // REVIEW: Try to see if we can relax this requirement in case there are no // active columns from the input (that are not required for output computation). Ch.AssertValue(input); Ch.AssertValue(groupCursor); Ch.AssertValue(active); _parent = parent; _input = input; _groupCursor = groupCursor; _active = active; _state = _parent.InitializeState(_input); var bindings = _parent.GetBindings(); _getters = _parent.CreateGetters(_state, iinfo => active[bindings.MapIinfoToCol(iinfo)]); _newGroupInGroupCursorDel = RowCursorUtils.GetIsNewGroupDelegate(_groupCursor, bindings.GroupIndex); _newGroupInInputCursorDel = RowCursorUtils.GetIsNewGroupDelegate(_input, bindings.GroupIndex); _labelGetter = _parent.GetLabelGetter(_groupCursor); _scoreGetter = _parent.GetScoreGetter(_groupCursor); }
public override bool IsColumnActive(int col) { Ch.Check(0 <= col && col < _parent.GetBindings().ColumnCount); return(_active[col]); }
/// <summary> /// Returns whether the given column is active in this row. /// </summary> public override bool IsColumnActive(DataViewSchema.Column column) { Ch.Check(column.Index < _parent.GetBindings().ColumnCount); return(_active[column.Index]); }