]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/cacheset.h
make all d-pointer * const pointers
[apt.git] / apt-pkg / cacheset.h
index 97aee8c2de9161e5423242762b67633eb4c2b566..4fe1eba87c5556f7f263163ebf85ad48d280743c 100644 (file)
@@ -50,9 +50,8 @@ class CacheSetHelper {                                                        /*{{{*/
 */
 public:                                                                        /*{{{*/
        CacheSetHelper(bool const ShowError = true,
-               GlobalError::MsgType ErrorType = GlobalError::ERROR) :
-                       ShowError(ShowError), ErrorType(ErrorType) {}
-       virtual ~CacheSetHelper() {}
+               GlobalError::MsgType ErrorType = GlobalError::ERROR);
+       virtual ~CacheSetHelper();
 
        enum PkgSelector { UNKNOWN, REGEX, TASK, FNMATCH, PACKAGENAME, STRING };
 
@@ -203,6 +202,8 @@ protected:
        bool PackageFromFnmatch(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
        bool PackageFromPackageName(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
        bool PackageFromString(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &pattern);
+private:
+       void * const d;
 };                                                                     /*}}}*/
 
 class PackageContainerInterface {                                      /*{{{*/
@@ -263,8 +264,10 @@ APT_IGNORE_DEPRECATED_POP
 
        void setConstructor(CacheSetHelper::PkgSelector const by) { ConstructedBy = by; }
        CacheSetHelper::PkgSelector getConstructor() const { return ConstructedBy; }
-       PackageContainerInterface() : ConstructedBy(CacheSetHelper::UNKNOWN) {}
-       PackageContainerInterface(CacheSetHelper::PkgSelector const by) : ConstructedBy(by) {}
+       PackageContainerInterface();
+       explicit PackageContainerInterface(CacheSetHelper::PkgSelector const by);
+       PackageContainerInterface& operator=(PackageContainerInterface const &other);
+       virtual ~PackageContainerInterface();
 
        APT_DEPRECATED static bool FromTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
           return helper.PackageFrom(CacheSetHelper::TASK, pci, Cache, pattern); }
@@ -292,6 +295,7 @@ APT_IGNORE_DEPRECATED_POP
 
 private:
        CacheSetHelper::PkgSelector ConstructedBy;
+       void * const d;
 };
                                                                        /*}}}*/
 template<class Container> class PackageContainer : public PackageContainerInterface {/*{{{*/
@@ -307,7 +311,7 @@ public:                                                                     /*{{{*/
                               public std::iterator<std::forward_iterator_tag, typename Container::const_iterator> {
                typename Container::const_iterator _iter;
        public:
-               const_iterator(typename Container::const_iterator i) : _iter(i) {}
+               explicit const_iterator(typename Container::const_iterator i) : _iter(i) {}
                pkgCache::PkgIterator getPkg(void) const { return *_iter; }
                inline pkgCache::PkgIterator operator*(void) const { return *_iter; }
                operator typename Container::const_iterator(void) const { return _iter; }
@@ -321,7 +325,7 @@ public:                                                                     /*{{{*/
                         public std::iterator<std::forward_iterator_tag, typename Container::iterator> {
                typename Container::iterator _iter;
        public:
-               iterator(typename Container::iterator i) : _iter(i) {}
+               explicit iterator(typename Container::iterator i) : _iter(i) {}
                pkgCache::PkgIterator getPkg(void) const { return *_iter; }
                inline pkgCache::PkgIterator operator*(void) const { return *_iter; }
                operator typename Container::iterator(void) const { return _iter; }
@@ -355,8 +359,8 @@ public:                                                                     /*{{{*/
        iterator end() { return iterator(_cont.end()); }
        const_iterator find(pkgCache::PkgIterator const &P) const { return const_iterator(_cont.find(P)); }
 
-       PackageContainer() : PackageContainerInterface() {}
-       PackageContainer(CacheSetHelper::PkgSelector const &by) : PackageContainerInterface(by) {}
+       PackageContainer() : PackageContainerInterface(CacheSetHelper::UNKNOWN) {}
+       explicit PackageContainer(CacheSetHelper::PkgSelector const &by) : PackageContainerInterface(by) {}
 APT_IGNORE_DEPRECATED_PUSH
        APT_DEPRECATED PackageContainer(Constructor const &by) : PackageContainerInterface((CacheSetHelper::PkgSelector)by) {}
 APT_IGNORE_DEPRECATED_POP
@@ -552,6 +556,7 @@ template<> template<class Compare> inline bool PackageContainer<std::vector<pkgC
     private methods. */
 class APT_HIDDEN PackageUniverse : public PackageContainerInterface {
        pkgCache * const _cont;
+       void * const d;
 public:
        typedef pkgCache::PkgIterator iterator;
        typedef pkgCache::PkgIterator const_iterator;
@@ -564,7 +569,8 @@ public:
        APT_PUBLIC iterator begin() { return _cont->PkgBegin(); }
        APT_PUBLIC iterator end() { return _cont->PkgEnd(); }
 
-       APT_PUBLIC PackageUniverse(pkgCache * const Owner) : _cont(Owner) { }
+       explicit APT_PUBLIC PackageUniverse(pkgCache * const Owner);
+       APT_PUBLIC virtual ~PackageUniverse();
 
 private:
        bool insert(pkgCache::PkgIterator const &) { return true; }
@@ -701,6 +707,12 @@ APT_IGNORE_DEPRECATED_PUSH
        }
 APT_IGNORE_DEPRECATED_POP
 
+       VersionContainerInterface();
+       VersionContainerInterface& operator=(VersionContainerInterface const &other);
+       virtual ~VersionContainerInterface();
+private:
+       void * const d;
+
 protected:                                                             /*{{{*/
 
        /** \brief returns the candidate version of the package
@@ -734,7 +746,7 @@ public:                                                                     /*{{{*/
                               public std::iterator<std::forward_iterator_tag, typename Container::const_iterator> {/*{{{*/
                typename Container::const_iterator _iter;
        public:
-               const_iterator(typename Container::const_iterator i) : _iter(i) {}
+               explicit const_iterator(typename Container::const_iterator i) : _iter(i) {}
                pkgCache::VerIterator getVer(void) const { return *_iter; }
                inline pkgCache::VerIterator operator*(void) const { return *_iter; }
                operator typename Container::const_iterator(void) const { return _iter; }
@@ -748,7 +760,7 @@ public:                                                                     /*{{{*/
                         public std::iterator<std::forward_iterator_tag, typename Container::iterator> {
                typename Container::iterator _iter;
        public:
-               iterator(typename Container::iterator i) : _iter(i) {}
+               explicit iterator(typename Container::iterator i) : _iter(i) {}
                pkgCache::VerIterator getVer(void) const { return *_iter; }
                inline pkgCache::VerIterator operator*(void) const { return *_iter; }
                operator typename Container::iterator(void) const { return _iter; }