Beispiel #1
0
        public LoggingDecoratorFactoryForGrowArrayProcesses(IGrowArrayProcessFactory <TKey, TValue> decoratedFactory, IConcurrentLogger logger)
        {
            decoratedFactory.MustNotBeNull();
            logger.MustNotBeNull();

            _decoratedFactory = decoratedFactory;
            _logger           = logger;
        }
Beispiel #2
0
        /// <summary>
        ///     Initializes a new instance of <see cref="LockFreeArrayBasedDictionary{TKey,TValue}" />.
        /// </summary>
        /// <param name="options">The options that specify the service objects used by this dictionary.</param>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="options" /> is null.</exception>
        public LockFreeArrayBasedDictionary(Options options)
        {
            options.MustNotBeNull(nameof(options));

            _keyComparer               = options.KeyComparer;
            _valueComparer             = options.ValueComparer;
            _growArrayStrategy         = options.GrowArrayStrategy;
            _growArrayProcessFactory   = options.GrowArrayProcessFactory;
            _backgroundCopyTaskFactory = options.BackgroundCopyTaskFactory;
            _currentArray              = CreateInitialArray();
            _setNewArray               = SetNewArray;
        }