예제 #1
0
        /// <summary>
        /// Invoke the given action on a set of cached buffers.
        /// </summary>
        public static T TwoBufferInvoke <BufferType, T>(Func <BufferType, BufferType, T> func)
            where BufferType : HeapBuffer
        {
            var wrapper = new TwoBufferFuncWrapper <BufferType, T> {
                Func = func
            };

            TwoBufferInvoke <TwoBufferFuncWrapper <BufferType, T>, BufferType>(ref wrapper);
            return(wrapper.Result);
        }
예제 #2
0
        /// <summary>
        ///  Invoke the given action on a set of cached buffers.
        /// </summary>
        public static T TwoBufferInvoke <TBuffer, T>(Func <TBuffer, TBuffer, T> func)
            where TBuffer : HeapBuffer
        {
            var wrapper = new TwoBufferFuncWrapper <TBuffer, T> {
                Func = func
            };

            TwoBufferInvoke <TwoBufferFuncWrapper <TBuffer, T>, TBuffer>(ref wrapper);
            return(wrapper.Result);
        }