Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ComputeOutFuncWrapper"/> class.
        /// </summary>
        /// <param name="reader">The reader.</param>
        public ComputeOutFuncWrapper(IBinaryRawReader reader)
        {
            _func = reader.ReadObject <object>();

            _invoker = DelegateTypeDescriptor.GetComputeOutFunc(_func.GetType());
        }
        /// <summary>
        /// Gets the invoker func.
        /// </summary>
        private static Func <Guid, object, bool> GetInvoker(object pred)
        {
            var func = DelegateTypeDescriptor.GetMessageListener(pred.GetType());

            return((id, msg) => func(pred, id, msg));
        }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ComputeJobWrapper"/> class.
        /// </summary>
        /// <param name="reader">The reader.</param>
        public ComputeJobWrapper(IBinaryRawReader reader)
        {
            _job = reader.ReadObject <object>();

            DelegateTypeDescriptor.GetComputeJob(_job.GetType(), out _execute, out _cancel);
        }
        /// <summary>
        /// Gets the invoker func.
        /// </summary>
        private static Func <object, object, bool> GetInvoker(object pred)
        {
            var func = DelegateTypeDescriptor.GetCacheEntryFilter(pred.GetType());

            return((key, val) => func(pred, key, val));
        }
Exemple #5
0
        /// <summary>
        /// Gets a delegate to call generic <see cref="ICacheEntryProcessor{K, V, A, R}.Process"/>.
        /// </summary>
        /// <param name="proc">The processor instance.</param>
        /// <returns>
        /// Delegate to call generic <see cref="ICacheEntryProcessor{K, V, A, R}.Process"/>.
        /// </returns>
        private static Func <IMutableCacheEntryInternal, object, object> GetProcessFunc(object proc)
        {
            var func = DelegateTypeDescriptor.GetCacheEntryProcessor(proc.GetType());

            return((entry, arg) => func(proc, entry, arg));
        }