public void PackTo(ref TupleWriter writer) { for (int i = 0; i < m_count; i++) { TuplePackers.SerializeObjectTo(ref writer, m_items[i + m_offset]); } }
public IEnumerator <object> GetEnumerator() { for (int i = 0; i < m_count; i++) { yield return(TuplePackers.DeserializeBoxed(m_slices[i + m_offset])); } }
public void CopyTo(object[] array, int offset) { for (int i = 0; i < m_count; i++) { array[i + offset] = TuplePackers.DeserializeBoxed(m_slices[i + m_offset]); } }
public override void EncodeOrderedSelfTerm(ref SliceWriter output, T value) { //HACKHACK: we lose the current depth! var writer = new TupleWriter(output); TuplePackers.SerializeTo(ref writer, value); output = writer.Output; }
public IEnumerator <object?> GetEnumerator() { //note: I'm not sure if we're allowed to use a local variable of type Span<..> in here? for (int i = 0; i < m_slices.Length; i++) { yield return(TuplePackers.DeserializeBoxed(m_slices.Span[i])); } }
public void CopyTo(object?[] array, int offset) { var slices = m_slices.Span; for (int i = 0; i < slices.Length; i++) { array[i + offset] = TuplePackers.DeserializeBoxed(slices[i]); } }
/// <summary>Parse a tuple segment containing an embedded tuple</summary> public static ITuple ParseTuple(Slice slice) { Contract.Requires(slice.HasValue && slice[0] == TupleTypes.TupleStart && slice[-1] == 0); if (slice.Count <= 2) { return(STuple.Empty); } return(TuplePackers.Unpack(slice.Substring(1, slice.Count - 2), true)); }
public object this[int index] => TuplePackers.DeserializeBoxed(GetSlice(index));
public object this[int index] { get { return(TuplePackers.DeserializeBoxed(GetSlice(index))); } }
public object?this[Index index] => TuplePackers.DeserializeBoxed(m_slices.Span[index.GetOffset(m_slices.Length)]);
void ITupleSerializable.PackTo(ref TupleWriter writer) { TuplePackers.SerializeTo <T1>(ref writer, this.Item1); }