Пример #1
0
        protected override DLink DerivedCreateNode()
        {
            DLink pNode = new CompositeRef();

            Debug.Assert(pNode != null);

            return(pNode);
        }
Пример #2
0
        public CompositeRef Attach(Composite pComposite)
        {
            CompositeRef pNode = (CompositeRef)this.BaseAdd();

            Debug.Assert(pNode != null);

            pNode.Set(pComposite);
            return(pNode);
        }
Пример #3
0
        public Composite Find(Composite.CompositeName name)
        {
            // Use compare node to compare to search nodes
            this.pCompositeCompare.GetComposite().SetName(name);

            CompositeRef pNode = (CompositeRef)this.BaseFind(this.pCompositeCompare);

            Debug.Assert(pNode != null);

            return(pNode.GetComposite());
        }
Пример #4
0
        //----------------------------------------------------------------------
        // Constructor
        //----------------------------------------------------------------------
        public CompositeManager(int reserveNum = 3, int reserveGrow = 1)
            : base(reserveNum, reserveGrow)
        {
            // make sure values are ressonable
            Debug.Assert(reserveNum > 0);
            Debug.Assert(reserveGrow > 0);

            this.pCompositeCompare = new CompositeRef();
            this.pNullComposite    = new NullComposite();
            this.pCompositeCompare.SetComposite(this.pNullComposite);
        }
Пример #5
0
        //----------------------------------------------------------------------
        // Override Abstract methods
        //----------------------------------------------------------------------
        protected override bool DerivedCompare(DLink pLinkA, DLink pLinkB)
        {
            // This is used in baseFind()
            Debug.Assert(pLinkA != null);
            Debug.Assert(pLinkB != null);

            CompositeRef pDataA = (CompositeRef)pLinkA;
            CompositeRef pDataB = (CompositeRef)pLinkB;

            Boolean status = false;

            if (pDataA.GetComposite().GetCompositeName() == pDataB.GetComposite().GetCompositeName())
            {
                status = true;
            }

            return(status);
        }
Пример #6
0
        //----------------------------------------------------------------------
        // Static Methods
        //----------------------------------------------------------------------
        public void Destroy()
        {
            this.BaseDestroy();

            this.pCompositeCompare = null;
        }