Exemplo n.º 1
0
        /// <summary>
        /// Used to indicate that this buffer is being abandoned so that its storage may be relcaimed during a future GC cycle.
        /// Sets the byteArray to null and the byteArraySize to zero.
        /// </summary>
        public void Release(QpcTimeStamp qpcTimeStamp, string reason = null)
        {
            header = BufferHeaderV1.Empty;

            bufferPool    = null;
            byteArray     = null;
            byteArraySize = 0;

            SetState(qpcTimeStamp, Buffers.BufferState.Released, reason);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Sets the byteCount to the headerSize and sets the header's BufferSeqNum to zero.
        /// </summary>
        public void Clear(QpcTimeStamp qpcTimeStamp, bool clearByteArrayContents = false, string reason = null)
        {
            header           = BufferHeaderV1.Empty;
            byteCount        = header.Length;
            Message          = null;
            NotifyOnSetState = null;

            if (clearByteArrayContents)
            {
                System.Array.Clear(byteArray, 0, byteArraySize);
            }

            SetState(qpcTimeStamp, Buffers.BufferState.Clear, reason);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Copies the initial contents of the byteArray into the header
 /// </summary>
 public void UpdateHeaderFromByteArray()
 {
     header = byteArray.MarshalStructFromByteArray <BufferHeaderV1>(rethrow: false);
 }