public void EncodeKey <T1>(ref SliceWriter writer, T1 item1)
        {
            var tw = new TupleWriter(writer);

            TuplePacker <T1> .SerializeTo(ref tw, item1);

            writer = tw.Output;
        }
Пример #2
0
 public T Last <T>()
 {
     if (m_count == 0)
     {
         throw new InvalidOperationException("Tuple is empty");
     }
     return(TuplePacker <T> .Deserialize(m_slices[m_offset + m_count - 1]));
 }
        public T Last <T>()
        {
            int count = m_slices.Length;

            if (count == 0)
            {
                throw new InvalidOperationException("Tuple is empty");
            }
            return(TuplePacker <T> .Deserialize(m_slices.Span[count - 1]));
        }
        public void EncodeKey <T1, T2, T3>(ref SliceWriter writer, T1 item1, T2 item2, T3 item3)
        {
            var tw = new TupleWriter(writer);

            TuplePacker <T1> .SerializeTo(ref tw, item1);

            TuplePacker <T2> .SerializeTo(ref tw, item2);

            TuplePacker <T3> .SerializeTo(ref tw, item3);

            writer = tw.Output;
        }
        public void EncodeKey <T1, T2, T3, T4, T5, T6>(ref SliceWriter writer, T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6)
        {
            var tw = new TupleWriter(writer);

            TuplePacker <T1> .SerializeTo(ref tw, item1);

            TuplePacker <T2> .SerializeTo(ref tw, item2);

            TuplePacker <T3> .SerializeTo(ref tw, item3);

            TuplePacker <T4> .SerializeTo(ref tw, item4);

            TuplePacker <T5> .SerializeTo(ref tw, item5);

            TuplePacker <T6> .SerializeTo(ref tw, item6);

            writer = tw.Output;
        }
Пример #6
0
 public T Get <T>(int index)
 {
     return(TuplePacker <T> .Deserialize(GetSlice(index)));
 }