aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/fake/fake_repository.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-12-12 19:29:09 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-12-13 00:50:37 +0000
commit3ff3aa41ac733cb8a0c0d7e532b3cdd56673ddd0 (patch)
tree1159c5580577715e4279de0c8a39fe38738ae325 /paludis/repositories/fake/fake_repository.cc
parentc4b5049c5c9064c0f694440f91136695b6e7e193 (diff)
downloadpaludis-3ff3aa41ac733cb8a0c0d7e532b3cdd56673ddd0.tar.gz
paludis-3ff3aa41ac733cb8a0c0d7e532b3cdd56673ddd0.tar.xz
New, simpler visitor framework.
Convert everything except the tree things, to begin with.
Diffstat (limited to 'paludis/repositories/fake/fake_repository.cc')
-rw-r--r--paludis/repositories/fake/fake_repository.cc38
1 files changed, 18 insertions, 20 deletions
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index 343366401..a9361b869 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -126,47 +126,46 @@ namespace paludis
namespace
{
- struct SupportsActionQuery :
- ConstVisitor<SupportsActionTestVisitorTypes>
+ struct SupportsActionQuery
{
- bool result;
-
- SupportsActionQuery() :
- result(false)
- {
- }
-
- void visit(const SupportsActionTest<InstalledAction> &)
+ bool visit(const SupportsActionTest<InstalledAction> &) const
{
+ return false;
}
- void visit(const SupportsActionTest<InstallAction> &)
+ bool visit(const SupportsActionTest<InstallAction> &) const
{
- result = true;
+ return true;
}
- void visit(const SupportsActionTest<ConfigAction> &)
+ bool visit(const SupportsActionTest<ConfigAction> &) const
{
+ return false;
}
- void visit(const SupportsActionTest<PretendAction> &)
+ bool visit(const SupportsActionTest<PretendAction> &) const
{
+ return false;
}
- void visit(const SupportsActionTest<PretendFetchAction> &)
+ bool visit(const SupportsActionTest<PretendFetchAction> &) const
{
+ return false;
}
- void visit(const SupportsActionTest<FetchAction> &)
+ bool visit(const SupportsActionTest<FetchAction> &) const
{
+ return false;
}
- void visit(const SupportsActionTest<InfoAction> &)
+ bool visit(const SupportsActionTest<InfoAction> &) const
{
+ return false;
}
- void visit(const SupportsActionTest<UninstallAction> &)
+ bool visit(const SupportsActionTest<UninstallAction> &) const
{
+ return false;
}
};
}
@@ -175,8 +174,7 @@ bool
FakeRepository::some_ids_might_support_action(const SupportsActionTestBase & a) const
{
SupportsActionQuery q;
- a.accept(q);
- return q.result;
+ return a.accept_returning<bool>(q);
}
FakeRepository::MirrorsConstIterator