Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/02/09 22:43:01 (15 years ago)
Author:
gkronber
Message:

Implemented calculation of list of necessary plugins for a job in the HiveEngine #545 (Engine which can be executed in the Hive).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.PluginInfrastructure/PluginManager.cs

    r1715 r1730  
    263263    }
    264264
    265 
    266     /// <summary>
    267     /// Calculates a set of plugins that directly or transitively depend on the plugin given in the argument.
    268     /// </summary>
    269     /// <param name="pluginInfo">The plugin the other depend on.</param>
    270     /// <returns>a list of plugins that are directly of transitively dependent.</returns>
    271     public List<PluginInfo> GetDependentPluginsRec(PluginInfo pluginInfo) {
    272       List<PluginInfo> mergedList = new List<PluginInfo>();
    273       //Bugfix the hell out of this...
    274       //Bugfixed the hell out of this...
    275       foreach (PluginInfo info in pluginInfo.Dependencies) {
    276         if (!mergedList.Contains(info)) {
    277           mergedList.Add(info);
    278           AddDependenciesRecursive(info, mergedList);       
    279         }       
    280       }
    281       return mergedList;
    282     }
    283 
    284     private void AddDependenciesRecursive(PluginInfo info, List<PluginInfo> mergedList) {
    285       //if we've already processed this element => STOP IT!
    286       if(!mergedList.Contains(info)) {
    287         mergedList.Add(info);
    288         return;
    289       }
    290       foreach (PluginInfo depinfo in info.Dependencies)
    291         AddDependenciesRecursive(depinfo, mergedList);       
    292     }
    293 
    294265    /// <summary>
    295266    /// Unloads all plugins.
Note: See TracChangeset for help on using the changeset viewer.