// -*- mode: c++; mode: fold -*-
// Description /*{{{*/
-// $Id: depcache.h,v 1.14 2001/02/20 07:03:17 jgg Exp $
/* ######################################################################
DepCache - Dependency Extension data for the cache
*
* \return \b false if an error occurred.
*/
- APT_HIDDEN bool MarkRequired(InRootSetFunc &rootFunc);
+ bool MarkRequired(InRootSetFunc &rootFunc);
/** \brief Set the StateCache::Garbage flag on all packages that
* should be removed.
*
* \return \b false if an error occurred.
*/
- APT_HIDDEN bool Sweep();
+ bool Sweep();
public:
*/
class ActionGroup
{
+ void * const d;
pkgDepCache &cache;
bool released;
* As long as this object exists, no automatic cleanup
* operations will be undertaken.
*/
- ActionGroup(pkgDepCache &cache);
+ explicit ActionGroup(pkgDepCache &cache);
/** \brief Clean up the action group before it is destroyed.
*
* If this is the last action group, the automatic cache
* cleanup operations will be undertaken.
*/
- ~ActionGroup();
+ virtual ~ActionGroup();
};
/** \brief Returns \b true for packages matching a regular
* \param rootFunc A predicate that returns \b true for packages
* that should be added to the root set.
*/
- bool MarkAndSweep(InRootSetFunc &rootFunc)
- {
- return MarkRequired(rootFunc) && Sweep();
- }
-
- bool MarkAndSweep()
- {
- std::auto_ptr<InRootSetFunc> f(GetRootSetFunc());
- if(f.get() != NULL)
- return MarkAndSweep(*f.get());
- else
- return false;
- }
+ bool MarkAndSweep(InRootSetFunc &rootFunc);
+ bool MarkAndSweep();
/** \name State Manipulators
*/
bool const rPurge, unsigned long const Depth, bool const FromUser);
private:
+ void * const d;
+
APT_HIDDEN bool IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg,
unsigned long const Depth, bool const FromUser);
};