Пример #1
0
            public PriorityQueueEnumerator(LPriorityQueue owner)
            {
                this.owner   = owner;
                this.version = owner.version;
                head         = owner.header;

                Reset();
            }
Пример #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));
        }
Пример #3
0
            public SynchronizedPriorityQueue(LPriorityQueue queue)
            {
                #region Require

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

                #endregion

                this.queue = queue;

                root = queue.SyncRoot;
            }