Esempio n. 1
0
            public PriorityQueueEnumerator(LPriorityQueue owner)
            {
                this.owner   = owner;
                this.version = owner.version;
                head         = owner.header;

                Reset();
            }
Esempio n. 2
0
        /// <summary>
        ///   Returns a synchronized wrapper of the specified PriorityQueue.
        /// </summary>
        /// <param name = "queue">
        ///   The PriorityQueue to synchronize.
        /// </param>
        /// <returns>
        ///   A synchronized PriorityQueue.
        /// </returns>
        /// <exception cref = "ArgumentNullException">
        ///   If queue is null.
        /// </exception>
        public static LPriorityQueue Synchronized(LPriorityQueue queue)
        {
            #region Require

            if (queue == null)
            {
                throw new ArgumentNullException("queue");
            }

            #endregion

            return(new SynchronizedPriorityQueue(queue));
        }
Esempio n. 3
0
            public SynchronizedPriorityQueue(LPriorityQueue queue)
            {
                #region Require

                if (queue == null)
                {
                    throw new ArgumentNullException("queue");
                }

                #endregion

                this.queue = queue;

                root = queue.SyncRoot;
            }