aboutsummaryrefslogtreecommitdiff
path: root/paludis/selection_handler.hh
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-06-01 17:49:26 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-06-01 17:49:26 +0000
commit22a63d94cdbcf4b29d64a55b92eec0aa6f564a54 (patch)
tree5967af5309eaed9d254d19df06b5ec39911aac09 /paludis/selection_handler.hh
parent401165692d807f4b9d0df756fd9b500408039092 (diff)
downloadpaludis-22a63d94cdbcf4b29d64a55b92eec0aa6f564a54.tar.gz
paludis-22a63d94cdbcf4b29d64a55b92eec0aa6f564a54.tar.xz
Move FilterHandler and SelectionHandler into public headers.
Diffstat (limited to 'paludis/selection_handler.hh')
-rw-r--r--paludis/selection_handler.hh59
1 files changed, 59 insertions, 0 deletions
diff --git a/paludis/selection_handler.hh b/paludis/selection_handler.hh
new file mode 100644
index 0000000..08ed6bc
--- /dev/null
+++ b/paludis/selection_handler.hh
@@ -0,0 +1,59 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008 David Leverton
+ *
+ * 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_FILTER_HANDLER_HH
+#define PALUDIS_GUARD_PALUDIS_FILTER_HANDLER_HH 1
+
+#include <paludis/selection_handler-fwd.hh>
+#include <paludis/filtered_generator.hh>
+#include <paludis/environment-fwd.hh>
+#include <paludis/package_id-fwd.hh>
+#include <paludis/util/attributes.hh>
+#include <paludis/util/instantiation_policy.hh>
+#include <tr1/memory>
+
+namespace paludis
+{
+ class SelectionHandler :
+ private InstantiationPolicy<SelectionHandler, instantiation_method::NonCopyableTag>
+ {
+ protected:
+ const FilteredGenerator _fg;
+
+ SelectionHandler(const FilteredGenerator & g) :
+ _fg(g)
+ {
+ }
+
+ public:
+ virtual ~SelectionHandler() = 0;
+
+ virtual std::string as_string() const = 0;
+
+ virtual std::tr1::shared_ptr<PackageIDSequence> perform_select(const Environment * const) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ };
+
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+ extern template class InstantiationPolicy<SelectionHandler, instantiation_method::NonCopyableTag>;
+#endif
+}
+
+#endif