示例#1
0
        override public void Remove(Component pComponent)
        {
            Debug.Assert(pComponent != null);
            DLink.RemoveFromList(ref this.pHead, pComponent);

            this.numChildren -= 1;
        }
示例#2
0
        /// <summary>
        /// Moves a node from active to reserve and cleans list references for node
        /// </summary>
        /// <param name="pNode"></param>
        protected void BaseRemove(DLink pNode)
        {
            Debug.Assert(pNode != null);

            // Update list pointers to remove pNode from list
            DLink.RemoveFromList(ref pActive, pNode);

            // Remove list references in removed node
            pNode.ClearLinks();

            // Return pNode to pReserve list
            DLink.AddToFront(ref pReserve, pNode);

            // stats update
            this.activeNodeNum--;
            this.reserveNodeNum++;
        }
示例#3
0
        public void DetachAllObservers()
        {
            DLink pNode = this.head;
            DLink pTmpNode;

            while (pNode != null)
            {
                // Walk through the list
                pTmpNode = pNode;
                pNode = pNode.GetNext();

                // Clear and remove node
                Debug.Assert(pTmpNode != null);
                DLink.RemoveFromList(ref this.head, pTmpNode);
                pTmpNode = null;
            }
        }
        //----------------------------------------------------------------------
        // Private methods
        //----------------------------------------------------------------------

        private void ClearList(DLink listHead)
        {
            DLink pNode;
            DLink pTmpNode;

            pNode = listHead;
            while (pNode != null)
            {
                // Walk through the list
                pTmpNode = pNode;
                pNode    = pNode.GetNext();

                // Clear and remove node
                Debug.Assert(pTmpNode != null);
                this.DerivedDestroyNode(pTmpNode);
                DLink.RemoveFromList(ref listHead, pTmpNode);
                pTmpNode = null;
            }
        }
示例#5
0
        private void ClearList(DLink listHead)
        {
            DLink pNode;
            DLink pTmpNode;

            pNode = listHead;
            while (pNode != null)
            {
                // Walk through the list
                pTmpNode = pNode;
                pNode    = pNode.GetNext();

                // Clear and remove node
                Debug.Assert(pTmpNode != null);
                this.DerivedDestroyNode(pTmpNode);
                DLink.RemoveFromList(ref this.pActive, pTmpNode);
                pTmpNode = null;

                // Decrement total count
                this.totalNodeNum--;
            }
        }