public void SetStructBegin(int colno) { _valueholder._colidx = colno; Logger.Assert(_valueholder.DataType.HasHeading); var cols = _valueholder._types[colno].Heading.Columns.ToArray(); //var cols = _valueholder._types[colno].Heading.Columns.Select(c => c.DataType).ToArray(); _valueholder = new ValueHolder { _types = cols.Select(c => c.DataType).ToArray(), _values = new TypedValue[cols.Length], _parent = _valueholder, }; }
public void GetStructBegin(int colno) { _valueholder._colidx = colno; Logger.Assert(_valueholder.DataType.HasHeading); var cols = _valueholder._types[colno].Heading.Columns; var value = _valueholder._values[colno]; var tuple = (value is TupleValue) ? value.AsRow().Values : (value is UserValue) ? value.AsUser() : _valueholder._list[_valueholder._rowidx++]; _valueholder = new ValueHolder { _types = cols.Select(c => c.DataType).ToArray(), _names = cols.Select(c => c.Name).ToArray(), _values = tuple, _parent = _valueholder, }; }
public void SetStructEnd() { var tuple = FilledValues(); _valueholder = _valueholder._parent; var datatype = _valueholder.DataType; if (datatype is DataTypeUser) { _valueholder._values[_valueholder._colidx] = UserValue.Create(tuple, datatype as DataTypeUser); } else if (datatype is DataTypeTuple) { var row = DataRow.Create(datatype.Heading, tuple); _valueholder._values[_valueholder._colidx] = TupleValue.Create(row); } else { Logger.Assert(_valueholder.DataType is DataTypeRelation); _valueholder._list.Add(tuple); } }
public void GetStructEnd() { _valueholder = _valueholder._parent; Logger.Assert(_valueholder.DataType.HasHeading); }