protected BaseReference AllocateAndPin(IStorable obj, int initialSize)
        {
            Global.Tracer.Assert(obj != null, "Cannot allocate reference to null");
            BaseReference baseReference = base.CreateReference(obj);

            baseReference.Init(this, this.GenerateTempId());
            this.CacheItem(baseReference, obj, false, initialSize);
            baseReference.PinValue();
            return(baseReference);
        }
        public IReference <T> AllocateEmptyTreePartition <T>(AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType referenceObjectType)
        {
            BaseReference baseReference = default(BaseReference);

            if (!base.m_referenceCreator.TryCreateReference(referenceObjectType, out baseReference))
            {
                Global.Tracer.Assert(false, "Cannot create reference of type: {0}", referenceObjectType);
            }
            baseReference.Init(this, this.m_partitionManager.AllocateNewTreePartition());
            return((IReference <T>)baseReference);
        }
예제 #3
0
        private IReference <T> InternalAllocate <T>(T obj, int priority, bool startPinned, int initialSize) where T : IStorable
        {
            Global.Tracer.Assert(obj != null, "Cannot allocate reference to null");
            BaseReference baseReference = base.CreateReference((IStorable)(object)obj);

            baseReference.Init(this, this.m_offsetMap.GenerateTempId());
            this.CacheItem(baseReference, (IStorable)(object)obj, priority, initialSize);
            if (startPinned)
            {
                baseReference.PinValue();
            }
            return((IReference <T>)baseReference);
        }
        public sealed override IReference <T> GenerateFixedReference <T>(T obj)
        {
            BaseReference baseReference = base.CreateReference((IStorable)(object)obj);

            baseReference.Init(this, this.GenerateTempId());
            ItemHolder itemHolder = new ItemHolder();

            itemHolder.Reference  = baseReference;
            itemHolder.Item       = (IStorable)(object)obj;
            baseReference.Item    = itemHolder;
            baseReference.InQueue = InQueueState.InQueue;
            return((IReference <T>)baseReference);
        }
예제 #5
0
        public override IReference <T> GenerateFixedReference <T>(T obj)
        {
            BaseReference baseReference = base.CreateReference((IStorable)(object)obj);

            baseReference.Init(this, this.m_offsetMap.GenerateTempId());
            StorageItem storageItem = (StorageItem)(baseReference.Item = new StorageItem(baseReference.Id, -1, (IStorable)(object)obj, ItemSizes.SizeOf((IStorable)(object)obj)));

            storageItem.AddReference(baseReference);
            storageItem.InQueue         = InQueueState.Exempt;
            storageItem.HasBeenUnPinned = true;
            ISelfReferential selfReferential = ((object)obj) as ISelfReferential;

            if (selfReferential != null)
            {
                selfReferential.SetReference(baseReference);
            }
            return((IReference <T>)baseReference);
        }