aboutsummaryrefslogtreecommitdiff
path: root/paludis/selection_cache.hh
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-12-05 23:07:10 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-12-06 16:59:35 +0000
commit4e9142925c02ccbe933804542f84f8b8a3f028e1 (patch)
tree30bfa6223a10047dd4f727a232e28ffb88d7c75a /paludis/selection_cache.hh
parent956ad7409b5099e5a40443b98a3eca16e599549a (diff)
downloadpaludis-4e9142925c02ccbe933804542f84f8b8a3f028e1.tar.gz
paludis-4e9142925c02ccbe933804542f84f8b8a3f028e1.tar.xz
Avoid recalculating selections
Diffstat (limited to 'paludis/selection_cache.hh')
-rw-r--r--paludis/selection_cache.hh58
1 files changed, 58 insertions, 0 deletions
diff --git a/paludis/selection_cache.hh b/paludis/selection_cache.hh
new file mode 100644
index 000000000..a4db1b446
--- /dev/null
+++ b/paludis/selection_cache.hh
@@ -0,0 +1,58 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2009 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_SELECTION_CACHE_HH
+#define PALUDIS_GUARD_PALUDIS_SELECTION_CACHE_HH 1
+
+#include <paludis/selection_cache-fwd.hh>
+#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/environment-fwd.hh>
+#include <paludis/selection-fwd.hh>
+#include <paludis/package_id-fwd.hh>
+#include <tr1/memory>
+
+namespace paludis
+{
+ class PALUDIS_VISIBLE SelectionCache :
+ private PrivateImplementationPattern<SelectionCache>
+ {
+ public:
+ SelectionCache();
+ ~SelectionCache();
+
+ const std::tr1::shared_ptr<PackageIDSequence> perform_select(
+ const Environment * const,
+ const Selection &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
+ class PALUDIS_VISIBLE ScopedSelectionCache :
+ private PrivateImplementationPattern<ScopedSelectionCache>
+ {
+ public:
+ ScopedSelectionCache(Environment * const);
+ ~ScopedSelectionCache();
+ };
+
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+ extern template class PrivateImplementationPattern<SelectionCache>;
+ extern template class PrivateImplementationPattern<ScopedSelectionCache>;
+#endif
+}
+
+#endif