[Aptitude-devel] Experimental package and package_pool implementation
Piotr Galiszewski
piotr at galiszewski.pl
Mon Jul 12 21:03:20 UTC 2010
Hello Daniel,
Today I have been designing and writing new packages class
implementation. All work is available at 004.1-package branch on
gitorious.
I have tried to incorporate all suggestions from our earlier
discussion on this list (but I am sure that I have forgotten about
some important things ;)) (Warning: this patches was only compile
tested at this time ;) )
Firstly I created new package class, This version doesn't contains any
reference to any Qt classes. As it was suggested in the discussion,
all members of the class are independently lazy loaded from the
pkgIterator object. Package name is an only exception, cause it would
be loaded for all package shortly after creating package_model. In
order to avoid discarding const qualifiers of getters, all class
variables are mutable and requires methods are const. I am not using
PackageInformation class from GTK frontend, but I have moved required
code to this new class. For a convenience I have added a typedef for
package's boost::shared_ptr. If the program is compiled with Qt
support this pointer is exported as metatype for use in packages_model
Second class is package_aware_object. It purpose is to notify relevant
classes about changing a state of package_pool class, which was added
in later patch. If some class want to be notified about this event, it
needs to inherit from this class and reimplement three methods. This
approach is commonly used instead of Qt signals in Kadu IM, so I'd
like to ask you about your opinions. package_info_tab and
status_widget will be another classes using this aware object
Third patch introduces package_pool. This class is responsible for
managing a list of packages, which was earlier held by packages_model
class. Updated packages_model was added in fourth patch. packages_pool
will be the only class which is directly connected to signals about
cache updating or reloading. It updates inner package list (which uses
boost::multi_index_conantainer) and later translates this signal and
propagates it by package_aware_object. I did it in this way, cause I
need to be sure that packages_pool is updated earlier than other
classes using package objects.
Any opinions and reviews are much appreciated :) Now it is time for me
to come back to qt_stabs patch
--
Regards
Piotr Galiszewski
More information about the Aptitude-devel
mailing list