summaryrefslogtreecommitdiff
path: root/apt-pkg/cacheiterators.h
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2009-12-27 19:39:47 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2009-12-27 19:39:47 +0100
commit25396fb06350344996a20d05423562f08a4165db (patch)
tree6d86e407c280333624b8f9949467f90612258282 /apt-pkg/cacheiterators.h
parent5dd4c8b811d9c7bc33e50254811f5bc0fc37f872 (diff)
Split ListParser::NewDepends into two methods to use these new method
for creating the dependencies needed for our groups: For now for all groups only one package can be installed at the same time which conflicts with each other packages in the group. The exceptions are architecture all package. Also, the Multi-Arch field is now parsed, but not used for now.
Diffstat (limited to 'apt-pkg/cacheiterators.h')
-rw-r--r--apt-pkg/cacheiterators.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h
index 35d3aa228..33d2ed6be 100644
--- a/apt-pkg/cacheiterators.h
+++ b/apt-pkg/cacheiterators.h
@@ -81,13 +81,21 @@ template<typename Str, typename Itr> class pkgCache::Iterator {
different architectures can be treated as of the "same" package
(apt internally treat them as totally different packages) */
class pkgCache::GrpIterator: public Iterator<Group, GrpIterator> {
+ long HashIndex;
+
protected:
inline Group* OwnerPointer() const {
return Owner->GrpP;
};
public:
- void operator ++(int) {if (S != Owner->GrpP) S = Owner->GrpP + S->Next;};
+ // This constructor is the 'begin' constructor, never use it.
+ inline GrpIterator(pkgCache &Owner) : Iterator<Group, GrpIterator>(Owner), HashIndex(-1) {
+ S = OwnerPointer();
+ operator ++(0);
+ };
+
+ virtual void operator ++(int);
virtual void operator ++() {operator ++(0);};
inline const char *Name() const {return S->Name == 0?0:Owner->StrP + S->Name;};
@@ -96,11 +104,11 @@ class pkgCache::GrpIterator: public Iterator<Group, GrpIterator> {
PkgIterator NextPkg(PkgIterator const &Pkg);
// Constructors
- inline GrpIterator(pkgCache &Owner, Group *Trg) : Iterator<Group, GrpIterator>(Owner, Trg) {
+ inline GrpIterator(pkgCache &Owner, Group *Trg) : Iterator<Group, GrpIterator>(Owner, Trg), HashIndex(0) {
if (S == 0)
S = OwnerPointer();
};
- inline GrpIterator() : Iterator<Group, GrpIterator>() {};
+ inline GrpIterator() : Iterator<Group, GrpIterator>(), HashIndex(0) {};
};
/*}}}*/