示例#1
0
	public GraphStateProfiler (IGraphState inner)
	{
	    if (inner == null)
		throw new ArgumentNullException ("inner");

	    this.inner = inner;
	}
示例#2
0
	public WrenchProject (SourceSettings ss, IGraphState graph, 
			      ActionLog log) 
	{
	    this.ss = ss;
	    this.log = log;
	    this.graph = graph;
	    this.manager = WrenchOperations.MakeManager (this);
	}
示例#3
0
	public bool LoadRest (IWarningLogger uilog) 
	{
	    if ((log = ActionLog.Load (ss, uilog)) == null)
		return true;

	    if ((graph = GetGraph ()) == null)
		return true;

	    if (ProfileStateUsage)
		graph = new GraphStateProfiler (graph);

	    proj = new WrenchProject (ss, graph, log);
	    return false;
	}
示例#4
0
	public void Dispose () {
	    if (disposed)
		return;
	    
	    if (proj != null) {
		proj.Dispose ();
		proj = null;
	    }

	    if (log != null) {
		log.Save (ss);
		log = null;
	    }

	    if (ProfileStateUsage) {
		Console.Error.WriteLine ("GRAPH STATE USAGE PROFILE:");
		Console.Error.WriteLine ("{0}", graph);
	    }

	    graph = null;
	    ss = null;
	    bm = null;

	    disposed = true;
	}
示例#5
0
	// returns the reason why we need to recompile or null if no need
	string GraphNeedsRebuild (IGraphState gs)
	{
	    foreach (DependentItemInfo dii in gs.GetDependentFiles ()) {
		string f = ss.PathToSourceRelative (dii.Name);

		Fingerprint fp = Fingerprint.FromFile (f);

		if (fp != dii.Fingerprint)
		    return f;
	    }

	    // This is a bit gross, but it's called once.
	    // We've just loaded the bundles straight from the graph's
	    // ProjectInfo, but the pinfo may not be in sync with the
	    // DII list.

	    Dictionary<string,Assembly> namemap = new Dictionary<string,Assembly> ();
	    int num_pinfo = 0, num_dii = 0;

	    foreach (Assembly assy in bm.BundleAssemblies) {
		namemap[assy.GetName ().Name] = assy;
		num_pinfo++;
	    }

	    foreach (DependentItemInfo dii in gs.GetDependentBundles ()) {
		if (!namemap.ContainsKey (dii.Name))
		    return dii.Name;

		Fingerprint fp = Fingerprint.FromFile (namemap[dii.Name].Location);

		if (fp != dii.Fingerprint)
		    return dii.Name;

		num_dii++;
	    }

	    if (num_pinfo != num_dii)
		return "[mismatch in number of referenced bundles]";

	    return null;
	}
示例#6
0
 public MatrixCoverGraphAllocation(IExecutableMatrixGraph _graph, IGraphState _graphState)
 {
     Graph      = _graph;
     graphState = _graphState;
 }