예제 #1
0
        unsafe public void Add(TransactionPairBinary trade)
        {
            if (count >= capacity)
            {
                throw new ApplicationException("Only " + capacity + " items allows per transaction page.");
            }

            fixed(byte *bptr = buffer)
            {
                TransactionPairBinary *tptr = (TransactionPairBinary *)bptr;

                *(tptr + count) = trade;
            }

            count++;
        }
예제 #2
0
        unsafe public TransactionPairBinary this[int index] {
            get {
                CheckIndex(index);
                fixed(byte *bptr = buffer)
                {
                    TransactionPairBinary *tptr = (TransactionPairBinary *)bptr;

                    return(*(tptr + index));
                }
            }
            set {
                CheckIndex(index);
                fixed(byte *bptr = buffer)
                {
                    TransactionPairBinary *tptr = (TransactionPairBinary *)bptr;

                    *(tptr + index) = value;
                }
            }
        }