예제 #1
0
        public bool Dequeue(ref Struct read)
        {
            if (Count == 0)
            {
                return(false);
            }
            var Node = First;

            if (0 == --Count)
            {
                this.First = null;
                this.Last  = null;
            }
            else
            {
                First     = Node.Next;
                Last.Next = First;
            }

            read = Node.Value;

            var Dump = read.GetDump();

            if (0 == Dump.Count++)
            {
                Node.Next = null;
            }
            else
            {
                Node.Next = Dump.Top;
            }
            Dump.Top = Node;
            return(true);
        }
예제 #2
0
        public void Add(ref Struct value)
        {
            var Node = new StructNode <Struct> {
                Value = value,
            };

            if (0 == Count++)
            {
                First = Node;
            }
            else
            {
                Last.Next = Node;
            }
            Node.Next = First;
            Last      = Node;
        }