[Aptitude-svn-commit] r4120 - in branches/aptitude-0.3/aptitude: . src/generic

Daniel Burrows dburrows at costa.debian.org
Tue Sep 20 00:06:26 UTC 2005


Author: dburrows
Date: Tue Sep 20 00:06:23 2005
New Revision: 4120

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/generic/resolver_manager.cc
   branches/aptitude-0.3/aptitude/src/generic/resolver_manager.h
Log:
Expose the resolver queue sizes from the resolver manager.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Tue Sep 20 00:06:23 2005
@@ -1,5 +1,9 @@
 2005-09-19  Daniel Burrows  <dburrows at debian.org>
 
+	* src/generic/resolver_manager.cc, src/generic/resolver_manager.h:
+
+	  Expose the resolver's queue counts in the state snapshot.
+
 	* src/generic/problemresolver/problemresolver.h:
 
 	  Allow users of the resolver to check the size of its various

Modified: branches/aptitude-0.3/aptitude/src/generic/resolver_manager.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/generic/resolver_manager.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/generic/resolver_manager.cc	Tue Sep 20 00:06:23 2005
@@ -413,13 +413,31 @@
 
   state rval;
 
-  rval.selected_solution = selected_solution;
-  rval.generated_solutions = solutions.size();
-  rval.resolver_exists = (resolver != NULL);
-  rval.solutions_exhausted = out_of_solutions.take();
-  out_of_solutions.put(rval.solutions_exhausted);
+  rval.selected_solution        = selected_solution;
+  rval.generated_solutions      = solutions.size();
+  rval.resolver_exists          = (resolver != NULL);
+  rval.solutions_exhausted      = out_of_solutions.take();
   rval.background_thread_active = (!pending_jobs.empty() || background_thread_in_resolver);
 
+  out_of_solutions.put(rval.solutions_exhausted);
+
+  if(resolver)
+    {
+      aptitude_resolver::queue_counts c = resolver->get_counts();
+
+      rval.open_size      = c.open;
+      rval.closed_size    = c.closed;
+      rval.deferred_size  = c.deferred;
+      rval.conflicts_size = c.conflicts;
+    }
+  else
+    {
+      rval.open_size      = 0;
+      rval.closed_size    = 0;
+      rval.deferred_size  = 0;
+      rval.conflicts_size = 0;
+    }
+
   return rval;
 }
 

Modified: branches/aptitude-0.3/aptitude/src/generic/resolver_manager.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/generic/resolver_manager.h	(original)
+++ branches/aptitude-0.3/aptitude/src/generic/resolver_manager.h	Tue Sep 20 00:06:23 2005
@@ -107,6 +107,18 @@
 
     /** If \b true, the background thread has jobs. */
     bool background_thread_active;
+
+    /** The size of the resolver's open queue. */
+    size_t open_size;
+
+    /** The size of the resolver's closed queue. */
+    size_t closed_size;
+
+    /** The size of the resolver's deferred queue. */
+    size_t deferred_size;
+
+    /** The number of conflicts discovered by the resolver. */
+    size_t conflicts_size;
   };
 
 private:



More information about the Aptitude-svn-commit mailing list