Ejemplo n.º 1
0
        protected void BaseDestroy()
        {
            DLink pNode;
            DLink pTmpNode;

            pNode = this.pActive;
            while(pNode != null)
            {
                pTmpNode = pNode;
                pNode = pNode.pNext;

                Debug.Assert(pTmpNode != null);
                this.DerivedDestroyNode(pTmpNode);
                DLink.RemoveNode(ref this.pActive, pTmpNode);
                pTmpNode = null;
                this.mNumActive--;
                this.mNumTotal--;
            }

            pNode = this.pReserve;
            while(pNode != null)
            {
                pTmpNode = pNode;
                pNode = pNode.pNext;
                Debug.Assert(pTmpNode != null);
                this.DerivedDestroyNode(pTmpNode);
                DLink.RemoveNode(ref this.pReserve, pTmpNode);
                pTmpNode = null;

                this.mNumReserve--;
                this.mNumTotal--;
            }
        }
Ejemplo n.º 2
0
        private static void privRemoveNode(ref DLink pHead, DLink pNode)
        {
            // protection
            Debug.Assert(pHead != null);
            Debug.Assert(pNode != null);

            DLink.RemoveNode(ref pHead, pNode);
        }
Ejemplo n.º 3
0
        protected void BaseRemove(DLink pDlink)
        {
            //depending on where the node is in the list we will have to move stuff around
            DLink.RemoveNode(ref this.poActive, pDlink);
            this.NumActive--;

            this.DerivedWash(pDlink);

            // then send that node or DLink back into the mNumReserve list
            DLink.AddToFront(ref this.poReserve, pDlink);
            this.NumReserve++;
        }
Ejemplo n.º 4
0
        protected void BaseRemove(DLink pNode)
        {
            Debug.Assert(pNode != null);
            DLink.RemoveNode(ref this.poActive, pNode);

            this.DerivedWash(pNode);

            DLink.AddToFront(ref this.poReserve, pNode);

            this.mNumActive--;
            this.mNumReserved++;
        }
Ejemplo n.º 5
0
        protected void BaseRemove(DLink pNode)
        {
            Debug.Assert(pNode != null);

            // Transfer the node in active list to reserve list.
            DLink.RemoveNode(ref this.pActive, pNode);
            this.DerivedWash(pNode);
            DLink.AddToFront(ref this.pReserve, pNode);

            // Update Stats
            this.mNumActive--;
            this.mNumReserve++;
        }
Ejemplo n.º 6
0
        protected void baseRemove(DLink pNode)
        {
            Debug.Assert(pNode != null);

            // remove the node from active list and update states
            DLink.RemoveNode(ref this.pActive, pNode);
            this.mNumActive--;

            // reset the node
            this.derivedReset(pNode);

            // add back to reserved list
            DLink.AddToFront(ref this.pReserved, pNode);
            this.mNumReserved++;
        }
Ejemplo n.º 7
0
        protected void BaseRemove(DLink pNode)
        {
            Debug.Assert(pNode != null);

            // Don't do the work here... delegate it
            DLink.RemoveNode(ref this.poActive, pNode);

            // wash it before returning to reserve list
            this.DerivedWash(pNode);

            // add it to the return list
            DLink.AddToFront(ref this.poReserve, pNode);

            // stats update
            this.mNumActive--;
            this.mNumReserved++;
        }
Ejemplo n.º 8
0
        protected void BaseDestroy()
        {
            // search for the name
            DLink pNode;
            DLink pTmpNode;

            // Active List
            pNode = this.poActive;
            while (pNode != null)
            {
                // walking through the list
                pTmpNode = pNode;
                pNode    = pNode.pNext;

                // node to cleanup
                Debug.Assert(pTmpNode != null);
                this.DerivedDestroyNode(pTmpNode);
                DLink.RemoveNode(ref this.poActive, pTmpNode);
                pTmpNode = null;

                this.mNumActive--;
                this.mTotalNumNodes--;
            }

            // Reserve List
            pNode = this.poReserve;
            while (pNode != null)
            {
                // walking through the list
                pTmpNode = pNode;
                pNode    = pNode.pNext;

                // node to cleanup
                Debug.Assert(pTmpNode != null);
                this.DerivedDestroyNode(pTmpNode);
                DLink.RemoveNode(ref this.poReserve, pTmpNode);
                pTmpNode = null;

                this.mNumReserved--;
                this.mTotalNumNodes--;
            }
        }
Ejemplo n.º 9
0
        public void baseRemove(DLink pLink)
        {
            // remove safely
            Debug.Assert(pLink != null);
            DLink target = this.baseFind(pLink);

            DLink.RemoveNode(ref this.poHeadActive, target);

            if (target != null)
            {
                // Clean the node
                target.Clear();
                this.derivedWash(target);

                // Push the node to the reserve list
                DLink.AddToFront(ref this.poHeadReserve, target);

                // update counters
                this.mNumActiveNodes--;
                this.mNumReserveNodes++;
            }
        }
Ejemplo n.º 10
0
        protected void baseDestory()
        {
            DLink pNode;
            DLink pTmpNode;

            // active list
            pNode = this.pActive;
            while (pNode != null)
            {
                pTmpNode = pNode;
                pNode    = pNode.pNext;

                // cleanup the node
                Debug.Assert(pTmpNode != null);
                this.derivedDestory(pTmpNode);
                DLink.RemoveNode(ref this.pActive, pTmpNode);
                pTmpNode = null;

                this.mNumActive--;
                this.mTotalNumNodes--;
            }

            // reserve list
            pNode = this.pReserved;
            while (pNode != null)
            {
                pTmpNode = pNode;
                pNode    = pNode.pNext;

                // cleanup the node
                Debug.Assert(pTmpNode != null);
                this.derivedDestory(pTmpNode);
                DLink.RemoveNode(ref this.pReserved, pTmpNode);
                pTmpNode = null;

                this.mNumReserved--;
                this.mTotalNumNodes--;
            }
        }
Ejemplo n.º 11
0
        protected void BaseDestroy()
        {
            DLink pNode;
            DLink pTemp;

            pNode = this.poActive;

            while (pNode != null)
            {
                pTemp = pNode;
                pNode = pNode.pNext;

                Debug.Assert(pTemp != null);
                this.DerivedDestroyNode(pTemp);
                DLink.RemoveNode(ref this.poActive, pTemp);
                pTemp = null;

                this.NumActive--;
                this.TotalNodes--;
            }

            pNode = this.poReserve;

            while (pNode != null)
            {
                pTemp = pNode;
                pNode = pNode.pNext;

                Debug.Assert(pTemp != null);
                this.DerivedDestroyNode(pTemp);
                DLink.RemoveNode(ref this.poReserve, pTemp);
                pTemp = null;

                this.NumReserve--;
                this.TotalNodes--;
            }
        }
Ejemplo n.º 12
0
 override public void Remove(Component pComponent)
 {
     Debug.Assert(pComponent != null);
     DLink.RemoveNode(ref this.poHead, pComponent);
 }
Ejemplo n.º 13
0
 public override void remove(Component pComponent)
 {
     Debug.Assert(pComponent != null);
     DLink.RemoveNode(ref this.poHead, ref this.poLast, pComponent);
 }
Ejemplo n.º 14
0
 public override void Remove(Component pComp)
 {
     Debug.Assert(pComp != null);
     DLink.RemoveNode(ref this.poHead, ref this.poTail, pComp);
 }
 private static void RemoveNode(ref DLink pHead, DLink pNode)
 {
     Debug.Assert(pHead != null);
     Debug.Assert(pNode != null);
     DLink.RemoveNode(ref pHead, pNode);
 }