aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-16 19:59:33 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-16 19:59:33 +0000
commit077db75a6d41c51256ae540738144e669819ff09 (patch)
tree22be3e168fef2a6982e69a67b00b140b7b842d03
parent89c4c69b09c85106bd5965e5730f1b618a5bd9df (diff)
downloadpaludis-077db75a6d41c51256ae540738144e669819ff09.tar.gz
paludis-077db75a6d41c51256ae540738144e669819ff09.tar.xz
oops again
-rw-r--r--paludis/mask.hh92
1 files changed, 92 insertions, 0 deletions
diff --git a/paludis/mask.hh b/paludis/mask.hh
new file mode 100644
index 0000000..89f9ac9
--- /dev/null
+++ b/paludis/mask.hh
@@ -0,0 +1,92 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * 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_MASK_HH
+#define PALUDIS_GUARD_PALUDIS_MASK_HH 1
+
+#include <paludis/mask-fwd.hh>
+#include <paludis/metadata_key-fwd.hh>
+#include <paludis/package_id-fwd.hh>
+#include <paludis/util/visitor.hh>
+#include <paludis/util/attributes.hh>
+#include <string>
+
+namespace paludis
+{
+ struct MaskVisitorTypes :
+ VisitorTypes<
+ MaskVisitorTypes,
+ Mask,
+ UserMask,
+ UnacceptedMask,
+ RepositoryMask,
+ UnsupportedMask,
+ AssociationMask
+ >
+ {
+ };
+
+ class PALUDIS_VISIBLE Mask :
+ public virtual ConstAcceptInterface<MaskVisitorTypes>
+ {
+ public:
+ virtual ~Mask() = 0;
+
+ virtual const char key() const = 0;
+ virtual const std::string description() const = 0;
+ };
+
+ class PALUDIS_VISIBLE UserMask :
+ public Mask,
+ public ConstAcceptInterfaceVisitsThis<MaskVisitorTypes, UserMask>
+ {
+ };
+
+ class PALUDIS_VISIBLE UnacceptedMask :
+ public Mask,
+ public ConstAcceptInterfaceVisitsThis<MaskVisitorTypes, UnacceptedMask>
+ {
+ public:
+ virtual const tr1::shared_ptr<const MetadataKey> unaccepted_key() const = 0;
+ };
+
+ class PALUDIS_VISIBLE RepositoryMask :
+ public Mask,
+ public ConstAcceptInterfaceVisitsThis<MaskVisitorTypes, RepositoryMask>
+ {
+ };
+
+ class PALUDIS_VISIBLE UnsupportedMask :
+ public Mask,
+ public ConstAcceptInterfaceVisitsThis<MaskVisitorTypes, UnsupportedMask>
+ {
+ public:
+ virtual const std::string explanation() const = 0;
+ };
+
+ class PALUDIS_VISIBLE AssociationMask :
+ public Mask,
+ public ConstAcceptInterfaceVisitsThis<MaskVisitorTypes, AssociationMask>
+ {
+ public:
+ virtual const tr1::shared_ptr<const PackageID> associated_package() const = 0;
+ };
+}
+
+#endif