aboutsummaryrefslogtreecommitdiff
path: root/paludis/generator_handler.hh
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-06-01 13:51:46 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-06-01 13:51:46 +0000
commit87294dc0c47918934ac032e9a080e8cf386f9bf2 (patch)
tree36dc289aa22200601ec28f2d7b497cd078e34ab6 /paludis/generator_handler.hh
parent3b9f4ed10c9eb6901f33c7037989f3b67eb5de07 (diff)
downloadpaludis-87294dc0c47918934ac032e9a080e8cf386f9bf2.tar.gz
paludis-87294dc0c47918934ac032e9a080e8cf386f9bf2.tar.xz
New Selection + Filter + Generator interface using Environment, replacing the old PackageDatabase Query. Fixes: ticket:559
Diffstat (limited to 'paludis/generator_handler.hh')
-rw-r--r--paludis/generator_handler.hh85
1 files changed, 85 insertions, 0 deletions
diff --git a/paludis/generator_handler.hh b/paludis/generator_handler.hh
new file mode 100644
index 000000000..4206f5302
--- /dev/null
+++ b/paludis/generator_handler.hh
@@ -0,0 +1,85 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2008 Ciaran McCreesh
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_GENERATOR_HANDLER_HH
+#define PALUDIS_GUARD_PALUDIS_GENERATOR_HANDLER_HH 1
+
+#include <paludis/generator_handler-fwd.hh>
+#include <paludis/name-fwd.hh>
+#include <paludis/environment-fwd.hh>
+#include <paludis/package_id-fwd.hh>
+#include <paludis/util/attributes.hh>
+#include <tr1/memory>
+
+namespace paludis
+{
+ class PALUDIS_VISIBLE GeneratorHandler
+ {
+ protected:
+ virtual ~GeneratorHandler() = 0;
+
+ public:
+ virtual std::tr1::shared_ptr<const RepositoryNameSet> repositories(
+ const Environment * const) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ virtual std::tr1::shared_ptr<const CategoryNamePartSet> categories(
+ const Environment * const,
+ const std::tr1::shared_ptr<const RepositoryNameSet> &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ virtual std::tr1::shared_ptr<const QualifiedPackageNameSet> packages(
+ const Environment * const,
+ const std::tr1::shared_ptr<const RepositoryNameSet> &,
+ const std::tr1::shared_ptr<const CategoryNamePartSet> &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ virtual std::tr1::shared_ptr<const PackageIDSet> ids(
+ const Environment * const,
+ const std::tr1::shared_ptr<const RepositoryNameSet> &,
+ const std::tr1::shared_ptr<const QualifiedPackageNameSet> &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ virtual std::string as_string() const = 0;
+ };
+
+ class PALUDIS_VISIBLE AllGeneratorHandlerBase :
+ public GeneratorHandler
+ {
+ public:
+ virtual std::tr1::shared_ptr<const RepositoryNameSet> repositories(
+ const Environment * const env) const;
+
+ virtual std::tr1::shared_ptr<const CategoryNamePartSet> categories(
+ const Environment * const env,
+ const std::tr1::shared_ptr<const RepositoryNameSet> & repos) const;
+
+ virtual std::tr1::shared_ptr<const QualifiedPackageNameSet> packages(
+ const Environment * const env,
+ const std::tr1::shared_ptr<const RepositoryNameSet> & repos,
+ const std::tr1::shared_ptr<const CategoryNamePartSet> & cats) const;
+
+ virtual std::tr1::shared_ptr<const PackageIDSet> ids(
+ const Environment * const env,
+ const std::tr1::shared_ptr<const RepositoryNameSet> & repos,
+ const std::tr1::shared_ptr<const QualifiedPackageNameSet> & qpns) const;
+ };
+}
+
+#endif