CheckGraph() static private method

static private CheckGraph ( OrderedProcess a, OrderedProcess b ) : void
a OrderedProcess
b OrderedProcess
return void
示例#1
0
        /// <summary>
        /// Indicates that this resource is used by the given process
        /// </summary>
        /// <param name="process">The process.</param>
        /// <returns></returns>
        public void UsedBy(OrderedProcess process)
        {
            DependencyGraph.CheckGraph(this, process);

            if (users.Add(process))
            {
                process.Requires(this);
            }
        }
示例#2
0
        /// <summary>
        /// Indicates that this process requires the specified resource.
        /// </summary>
        /// <param name="resource">The resource.</param>
        /// <returns>returns this process</returns>
        public void Requires(Resource resource)
        {
            DependencyGraph.CheckGraph(resource, this);

            if (_resources.Add(resource))
            {
                resource.UsedBy(this);
            }
        }
示例#3
0
        /// <summary>
        /// Indicates that this process should execute before another
        /// </summary>
        /// <param name="follower">The ancestor.</param>
        /// <returns>returns this process</returns>
        public OrderedProcess Before(OrderedProcess follower)
        {
            DependencyGraph.CheckGraph(this, follower);

            if (_followers.Add(follower))
            {
                follower.After(this);
            }

            return(follower);
        }
示例#4
0
        /// <summary>
        /// Indicates that this process should execute after another
        /// </summary>
        /// <param name="predecessor">The predecessor.</param>
        /// <returns>returns this process</returns>
        public OrderedProcess After(OrderedProcess predecessor)
        {
            DependencyGraph.CheckGraph(this, predecessor);

            if (_predecessors.Add(predecessor))
            {
                predecessor.Before(this);
            }

            return(predecessor);
        }