/// <summary>
        /// Initializes a new instance of the <see cref="CacheEntryProcessorHolder"/> class.
        /// </summary>
        /// <param name="reader">The reader.</param>
        public CacheEntryProcessorHolder(IBinaryRawReader reader)
        {
            _proc = reader.ReadObject <object>();
            _arg  = reader.ReadObject <object>();

            _processFunc = GetProcessFunc(_proc);

            var kvTypes = DelegateTypeDescriptor.GetCacheEntryProcessorTypes(_proc.GetType());

            _entryCtor = MutableCacheEntry.GetCtor(kvTypes.Item1, kvTypes.Item2);
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CacheEntryProcessorHolder"/> class.
        /// </summary>
        /// <param name="reader">The reader.</param>
        public CacheEntryProcessorHolder(IPortableReader reader)
        {
            var reader0 = (PortableReaderImpl)reader.RawReader();

            _proc = PortableUtils.ReadPortableOrSerializable <object>(reader0);
            _arg  = PortableUtils.ReadPortableOrSerializable <object>(reader0);

            _processFunc = GetProcessFunc(_proc);

            var kvTypes = DelegateTypeDescriptor.GetCacheEntryProcessorTypes(_proc.GetType());

            _entryCtor = MutableCacheEntry.GetCtor(kvTypes.Item1, kvTypes.Item2);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CacheEntryProcessorHolder"/> class.
        /// </summary>
        /// <param name="proc">The processor to wrap.</param>
        /// <param name="arg">The argument.</param>
        /// <param name="processFunc">Delegate to call generic <see cref="ICacheEntryProcessor{K, V, A, R}.Process"/> on local node.</param>
        /// <param name="keyType">Type of the key.</param>
        /// <param name="valType">Type of the value.</param>
        public CacheEntryProcessorHolder(object proc, object arg,
                                         Func <IMutableCacheEntryInternal, object, object> processFunc, Type keyType, Type valType)
        {
            Debug.Assert(proc != null);
            Debug.Assert(processFunc != null);

            _proc        = proc;
            _arg         = arg;
            _processFunc = processFunc;

            _processFunc = GetProcessFunc(_proc);

            _entryCtor = MutableCacheEntry.GetCtor(keyType, valType);
        }