aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-08-25 00:11:32 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-08-25 00:11:32 +0000
commit42314ff28e0a56b0d86aa354bcf563576d7add4b (patch)
tree176c4e05976475ff0954f20d3298f83c76197d20
parentef3ca936eb126b67a6678c096bd4900ebeca89d6 (diff)
downloadpaludis-42314ff28e0a56b0d86aa354bcf563576d7add4b.tar.gz
paludis-42314ff28e0a56b0d86aa354bcf563576d7add4b.tar.xz
Restructure how QAEnvironment handles its package database to make package database restructuring much simpler
-rw-r--r--paludis/qa/qa_environment.cc28
-rw-r--r--paludis/qa/qa_environment.hh22
2 files changed, 43 insertions, 7 deletions
diff --git a/paludis/qa/qa_environment.cc b/paludis/qa/qa_environment.cc
index caaf5d1..a1e7b16 100644
--- a/paludis/qa/qa_environment.cc
+++ b/paludis/qa/qa_environment.cc
@@ -26,8 +26,34 @@
using namespace paludis;
using namespace paludis::qa;
+namespace paludis
+{
+ template<>
+ struct Implementation<QAEnvironmentBase> :
+ InternalCounted<QAEnvironmentBase>
+ {
+ std::map<std::string, PackageDatabase::Pointer> package_databases;
+
+ Implementation(const FSEntry &, const Environment * const env)
+ {
+ package_databases.insert(std::make_pair("base",
+ PackageDatabase::Pointer(new PackageDatabase(env))));
+ }
+ };
+}
+
+QAEnvironmentBase::QAEnvironmentBase(const FSEntry & b, const Environment * const env) :
+ PrivateImplementationPattern<QAEnvironmentBase>(new Implementation<QAEnvironmentBase>(b, env))
+{
+}
+
+QAEnvironmentBase::~QAEnvironmentBase()
+{
+}
+
QAEnvironment::QAEnvironment(const FSEntry & base) :
- Environment(PackageDatabase::Pointer(new PackageDatabase(this)))
+ QAEnvironmentBase(base, this),
+ Environment(_imp->package_databases.begin()->second)
{
AssociativeCollection<std::string, std::string>::Pointer keys(
new AssociativeCollection<std::string, std::string>::Concrete);
diff --git a/paludis/qa/qa_environment.hh b/paludis/qa/qa_environment.hh
index a59dafe..0eb29dc 100644
--- a/paludis/qa/qa_environment.hh
+++ b/paludis/qa/qa_environment.hh
@@ -23,13 +23,12 @@
#include <paludis/environment.hh>
#include <paludis/package_database.hh>
+#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/fs_entry.hh>
+#include <libwrapiter/libwrapiter_forward_iterator.hh>
/** \file
* Declarations for the QAEnvironment class.
- *
- * \ingroup Environment
- * \ingroup QA
*/
namespace paludis
@@ -37,13 +36,24 @@ namespace paludis
namespace qa
{
/**
+ * Base from member holder for our package databases.
+ */
+ class QAEnvironmentBase :
+ private PrivateImplementationPattern<QAEnvironmentBase>
+ {
+ friend class QAEnvironment;
+
+ protected:
+ QAEnvironmentBase(const FSEntry & base, const Environment * const env);
+ ~QAEnvironmentBase();
+ };
+
+ /**
* The QAEnvironment is an Environment that corresponds to the environment
* used by Qualudis for QA checks.
- *
- * \ingroup Environment
- * \ingroup QA
*/
class QAEnvironment :
+ public QAEnvironmentBase,
public Environment
{
public: