aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e/memoised_hashes.hh
diff options
context:
space:
mode:
authorAvatar Piotr Jaroszyński <p.jaroszynski@gmail.com> 2009-04-04 23:22:34 +0200
committerAvatar Piotr Jaroszyński <p.jaroszynski@gmail.com> 2009-04-04 23:22:34 +0200
commitc4954637fe7bb34042f001755c2df4923633559f (patch)
tree77e4bb99b6a291a43aa36f599446802654ac20a2 /paludis/repositories/e/memoised_hashes.hh
parent731221582515aee50d7ea74ba1ee5a83345dc8a4 (diff)
downloadpaludis-c4954637fe7bb34042f001755c2df4923633559f.tar.gz
paludis-c4954637fe7bb34042f001755c2df4923633559f.tar.xz
Memoise file hashes.
Diffstat (limited to 'paludis/repositories/e/memoised_hashes.hh')
-rw-r--r--paludis/repositories/e/memoised_hashes.hh53
1 files changed, 53 insertions, 0 deletions
diff --git a/paludis/repositories/e/memoised_hashes.hh b/paludis/repositories/e/memoised_hashes.hh
new file mode 100644
index 000000000..717431687
--- /dev/null
+++ b/paludis/repositories/e/memoised_hashes.hh
@@ -0,0 +1,53 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2009 Piotr Jaroszyński
+ *
+ * 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_REPOSITORIES_E_MEMOISED_HASHES_HH
+#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_E_MEMOISED_HASHES_HH 1
+
+#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/safe_ifstream-fwd.hh>
+
+namespace paludis
+{
+ namespace erepository
+ {
+ class PALUDIS_VISIBLE MemoisedHashes :
+ public InstantiationPolicy<MemoisedHashes, instantiation_method::SingletonTag>,
+ private PrivateImplementationPattern<MemoisedHashes>
+ {
+ friend class InstantiationPolicy<MemoisedHashes, instantiation_method::SingletonTag>;
+
+ public:
+ template <typename H_>
+ const std::string get(const FSEntry & file, SafeIFStream & stream) const;
+
+ private:
+ MemoisedHashes();
+ ~MemoisedHashes();
+ };
+ }
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+ extern template class PrivateImplementationPattern<erepository::MemoisedHashes>;
+ extern template class InstantiationPolicy<erepository::MemoisedHashes, instantiation_method::SingletonTag>;
+#endif
+}
+
+#endif