aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-05 00:50:29 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-05 00:50:29 +0000
commit624bfdfc96b37df2316f6dd5241f763671259959 (patch)
tree4227b78311bce68aec20a89080a936e21c8013f9
parente931fb60ebe5fec2effef02435aad25f9d054845 (diff)
downloadpaludis-624bfdfc96b37df2316f6dd5241f763671259959.tar.gz
paludis-624bfdfc96b37df2316f6dd5241f763671259959.tar.xz
r3770@snowflake: ciaranm | 2007-07-05 01:48:14 +0100
Collection -> Sequence, Set, Map. Fixes: ticket:241
-rw-r--r--paludis/config_file.cc20
-rw-r--r--paludis/config_file.hh8
-rw-r--r--paludis/config_file_TEST.cc6
-rw-r--r--paludis/dep_list/Makefile.am4
-rw-r--r--paludis/dep_list/dep_list.cc48
-rw-r--r--paludis/dep_list/dep_list.hh22
-rw-r--r--paludis/dep_list/dep_list_TEST.cc1
-rw-r--r--paludis/dep_list/exceptions.cc7
-rw-r--r--paludis/dep_list/exceptions.hh2
-rw-r--r--paludis/dep_list/query_visitor.cc7
-rw-r--r--paludis/dep_list/query_visitor.hh2
-rw-r--r--paludis/dep_list/range_rewriter.cc1
-rw-r--r--paludis/dep_list/show_suggest_visitor.cc6
-rw-r--r--paludis/dep_list/show_suggest_visitor.hh2
-rw-r--r--paludis/dep_list/uninstall_list.cc39
-rw-r--r--paludis/dep_list/uninstall_list.sr2
-rw-r--r--paludis/dep_list/uninstall_list_TEST.cc3
-rw-r--r--paludis/dep_spec.cc9
-rw-r--r--paludis/dep_spec_TEST.cc1
-rw-r--r--paludis/dep_tag-fwd.hh4
-rw-r--r--paludis/dep_tag.cc3
-rw-r--r--paludis/dep_tag.hh1
-rw-r--r--paludis/eapi.cc1
-rw-r--r--paludis/environment-fwd.hh5
-rw-r--r--paludis/environment.cc3
-rw-r--r--paludis/environment.hh19
-rw-r--r--paludis/environment_implementation.cc46
-rw-r--r--paludis/environment_implementation.hh18
-rw-r--r--paludis/environment_implementation_TEST.cc7
-rw-r--r--paludis/environments/adapted/adapted_environment.cc18
-rw-r--r--paludis/environments/adapted/adapted_environment.hh18
-rw-r--r--paludis/environments/no_config/no_config_environment.cc26
-rw-r--r--paludis/environments/no_config/no_config_environment.hh2
-rw-r--r--paludis/environments/paludis/keywords_conf.cc3
-rw-r--r--paludis/environments/paludis/keywords_conf.hh2
-rw-r--r--paludis/environments/paludis/mirrors_conf.cc8
-rw-r--r--paludis/environments/paludis/mirrors_conf.hh2
-rw-r--r--paludis/environments/paludis/paludis_config.cc28
-rw-r--r--paludis/environments/paludis/paludis_config.hh5
-rw-r--r--paludis/environments/paludis/paludis_environment.cc40
-rw-r--r--paludis/environments/paludis/paludis_environment.hh16
-rw-r--r--paludis/environments/paludis/repository_config_entry.sr2
-rw-r--r--paludis/environments/paludis/use_conf.cc10
-rw-r--r--paludis/environments/paludis/use_conf.hh2
-rw-r--r--paludis/environments/portage/portage_environment.cc45
-rw-r--r--paludis/environments/portage/portage_environment.hh10
-rw-r--r--paludis/environments/portage/portage_environment_TEST.cc1
-rw-r--r--paludis/environments/test/test_environment.cc5
-rw-r--r--paludis/environments/test/test_environment.hh2
-rw-r--r--paludis/hooker.cc1
-rw-r--r--paludis/metadata_key-fwd.hh2
-rw-r--r--paludis/metadata_key.cc10
-rw-r--r--paludis/metadata_key.hh14
-rw-r--r--paludis/name-fwd.hh21
-rw-r--r--paludis/name.cc12
-rw-r--r--paludis/name.hh1
-rw-r--r--paludis/package_database.cc213
-rw-r--r--paludis/package_database.hh1
-rw-r--r--paludis/package_database_TEST.cc1
-rw-r--r--paludis/package_id-fwd.hh8
-rw-r--r--paludis/package_id.cc62
-rw-r--r--paludis/package_id.hh23
-rw-r--r--paludis/query.cc117
-rw-r--r--paludis/query.hh33
-rw-r--r--paludis/repositories/e/e_key.cc38
-rw-r--r--paludis/repositories/e/e_key.hh16
-rw-r--r--paludis/repositories/e/e_repository.cc57
-rw-r--r--paludis/repositories/e/e_repository.hh16
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc73
-rw-r--r--paludis/repositories/e/e_repository_news.cc5
-rw-r--r--paludis/repositories/e/e_repository_params.hh1
-rw-r--r--paludis/repositories/e/e_repository_params.sr4
-rw-r--r--paludis/repositories/e/e_repository_profile.cc10
-rw-r--r--paludis/repositories/e/e_repository_profile.hh2
-rw-r--r--paludis/repositories/e/e_repository_profile_file.cc1
-rw-r--r--paludis/repositories/e/e_repository_sets.cc14
-rw-r--r--paludis/repositories/e/e_repository_sets.hh2
-rw-r--r--paludis/repositories/e/e_repository_sets_TEST.cc21
-rw-r--r--paludis/repositories/e/ebin.cc9
-rw-r--r--paludis/repositories/e/ebin.hh1
-rw-r--r--paludis/repositories/e/ebuild.cc33
-rw-r--r--paludis/repositories/e/ebuild.hh6
-rw-r--r--paludis/repositories/e/ebuild.sr16
-rw-r--r--paludis/repositories/e/ebuild_entries.cc44
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc1
-rw-r--r--paludis/repositories/e/ebuild_id.cc10
-rw-r--r--paludis/repositories/e/ebuild_id.hh8
-rw-r--r--paludis/repositories/e/eclass_mtimes.cc10
-rw-r--r--paludis/repositories/e/eclass_mtimes.hh6
-rw-r--r--paludis/repositories/e/exheres_layout.cc54
-rw-r--r--paludis/repositories/e/exheres_layout.hh16
-rw-r--r--paludis/repositories/e/glsa.hh1
-rw-r--r--paludis/repositories/e/layout.cc1
-rw-r--r--paludis/repositories/e/layout.hh16
-rw-r--r--paludis/repositories/e/make_ebin_repository.cc15
-rw-r--r--paludis/repositories/e/make_ebin_repository.hh5
-rw-r--r--paludis/repositories/e/make_ebuild_repository.cc15
-rw-r--r--paludis/repositories/e/make_ebuild_repository.hh5
-rw-r--r--paludis/repositories/e/qa/qa_controller.cc5
-rw-r--r--paludis/repositories/e/registration.cc3
-rw-r--r--paludis/repositories/e/traditional_layout.cc54
-rw-r--r--paludis/repositories/e/traditional_layout.hh16
-rw-r--r--paludis/repositories/e/vdb_id.cc16
-rw-r--r--paludis/repositories/e/vdb_id.hh8
-rw-r--r--paludis/repositories/e/vdb_merger.cc4
-rw-r--r--paludis/repositories/e/vdb_repository.cc74
-rw-r--r--paludis/repositories/e/vdb_repository.hh19
-rw-r--r--paludis/repositories/e/vdb_unmerger.cc3
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc13
-rw-r--r--paludis/repositories/fake/fake_package_id.cc62
-rw-r--r--paludis/repositories/fake/fake_package_id.hh36
-rw-r--r--paludis/repositories/fake/fake_repository.cc4
-rw-r--r--paludis/repositories/fake/fake_repository_base.cc45
-rw-r--r--paludis/repositories/fake/fake_repository_base.hh14
-rw-r--r--paludis/repositories/repository_maker.cc3
-rw-r--r--paludis/repositories/repository_maker.hh3
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc22
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.hh8
-rw-r--r--paludis/repositories/virtuals/package_id.cc16
-rw-r--r--paludis/repositories/virtuals/package_id.hh8
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc22
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.hh7
-rw-r--r--paludis/repositories/virtuals/virtuals_repository_TEST.cc1
-rw-r--r--paludis/repository-fwd.hh4
-rw-r--r--paludis/repository.cc32
-rw-r--r--paludis/repository.hh34
-rw-r--r--paludis/repository_info.cc1
-rw-r--r--paludis/repository_name_cache.cc25
-rw-r--r--paludis/repository_name_cache.hh3
-rw-r--r--paludis/repository_name_cache_TEST.cc9
-rw-r--r--paludis/set_file.cc1
-rw-r--r--paludis/syncer.cc11
-rw-r--r--paludis/tasks/find_unused_packages_task.cc9
-rw-r--r--paludis/tasks/install_task.cc10
-rw-r--r--paludis/tasks/install_task.hh2
-rw-r--r--paludis/tasks/report_task.cc10
-rw-r--r--paludis/tasks/uninstall_task.cc4
-rw-r--r--paludis/tasks/uninstall_task.hh1
-rw-r--r--paludis/util/collection.hh363
-rw-r--r--paludis/util/collection_concrete.hh301
-rw-r--r--paludis/util/files.m45
-rw-r--r--paludis/util/fs_entry-fwd.hh14
-rw-r--r--paludis/util/fs_entry.cc8
-rw-r--r--paludis/util/fs_entry.hh4
-rw-r--r--paludis/util/map-fwd.hh29
-rw-r--r--paludis/util/map-impl.hh114
-rw-r--r--paludis/util/map.cc27
-rw-r--r--paludis/util/map.hh64
-rw-r--r--paludis/util/sequence-fwd.hh29
-rw-r--r--paludis/util/sequence-impl.hh129
-rw-r--r--paludis/util/sequence.hh72
-rw-r--r--paludis/util/set-fwd.hh (renamed from paludis/util/collection-fwd.hh)19
-rw-r--r--paludis/util/set-impl.hh113
-rw-r--r--paludis/util/set.hh65
-rw-r--r--paludis/util/tr1_functional.hh2
-rw-r--r--paludis/util/visitor-impl.hh7
-rw-r--r--paludis/util/visitor.hh6
-rw-r--r--paludis/version_requirements-fwd.hh4
-rw-r--r--paludis/version_requirements.cc7
-rw-r--r--paludis/version_requirements.hh1
-rw-r--r--paludis/version_spec.hh1
-rw-r--r--src/clients/adjutrix/display_default_system_resolution.cc1
-rw-r--r--src/clients/adjutrix/downgrade_check.cc1
-rw-r--r--src/clients/adjutrix/find_dropped_keywords.cc10
-rw-r--r--src/clients/adjutrix/find_reverse_deps.cc13
-rw-r--r--src/clients/adjutrix/find_stable_candidates.cc10
-rw-r--r--src/clients/adjutrix/find_unused_packages.cc10
-rw-r--r--src/clients/adjutrix/keywords_graph.cc18
-rw-r--r--src/clients/adjutrix/what_needs_keywording.cc7
-rw-r--r--src/clients/contrarius/install.cc3
-rw-r--r--src/clients/contrarius/stage.cc1
-rw-r--r--src/clients/contrarius/target_config.cc1
-rw-r--r--src/clients/paludis/applets.cc8
-rw-r--r--src/clients/paludis/install.cc9
-rw-r--r--src/clients/paludis/list.cc21
-rw-r--r--src/clients/paludis/owner.cc9
-rw-r--r--src/clients/paludis/query.cc1
-rw-r--r--src/clients/paludis/uninstall.cc3
-rw-r--r--src/output/console_install_task.cc49
-rw-r--r--src/output/console_install_task.hh19
-rw-r--r--src/output/console_query_task.cc16
-rw-r--r--src/output/console_query_task.hh2
-rw-r--r--src/output/use_flag_pretty_printer.cc26
-rw-r--r--src/output/use_flag_pretty_printer.hh22
184 files changed, 2004 insertions, 1855 deletions
diff --git a/paludis/config_file.cc b/paludis/config_file.cc
index 5ee16ab..f9c86f1 100644
--- a/paludis/config_file.cc
+++ b/paludis/config_file.cc
@@ -25,8 +25,10 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/options.hh>
#include <paludis/util/join.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/map.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <fstream>
@@ -241,11 +243,11 @@ namespace paludis
struct Implementation<KeyValueConfigFile::Defaults>
{
tr1::shared_ptr<const KeyValueConfigFile> kv;
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> > a;
+ tr1::shared_ptr<const Map<std::string, std::string> > a;
std::string (* f)(const std::string &, const std::string &);
Implementation(tr1::shared_ptr<const KeyValueConfigFile> kvv,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> > av,
+ tr1::shared_ptr<const Map<std::string, std::string> > av,
std::string (* fv)(const std::string &, const std::string &)) :
kv(kvv),
a(av),
@@ -258,12 +260,12 @@ namespace paludis
template<>
KeyValueConfigFile::Defaults::Defaults(tr1::shared_ptr<const KeyValueConfigFile> v) :
PrivateImplementationPattern<KeyValueConfigFile::Defaults>(new Implementation<KeyValueConfigFile::Defaults>(v,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> >(), 0))
+ tr1::shared_ptr<const Map<std::string, std::string> >(), 0))
{
}
template<>
-KeyValueConfigFile::Defaults::Defaults(tr1::shared_ptr<const AssociativeCollection<std::string, std::string> > a) :
+KeyValueConfigFile::Defaults::Defaults(tr1::shared_ptr<const Map<std::string, std::string> > a) :
PrivateImplementationPattern<KeyValueConfigFile::Defaults>(new Implementation<KeyValueConfigFile::Defaults>(
tr1::shared_ptr<const KeyValueConfigFile>(), a, 0))
{
@@ -272,12 +274,12 @@ KeyValueConfigFile::Defaults::Defaults(tr1::shared_ptr<const AssociativeCollecti
template<>
KeyValueConfigFile::Defaults::Defaults(tr1::shared_ptr<KeyValueConfigFile> v) :
PrivateImplementationPattern<KeyValueConfigFile::Defaults>(new Implementation<KeyValueConfigFile::Defaults>(v,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> >(), 0))
+ tr1::shared_ptr<const Map<std::string, std::string> >(), 0))
{
}
template<>
-KeyValueConfigFile::Defaults::Defaults(tr1::shared_ptr<AssociativeCollection<std::string, std::string> > a) :
+KeyValueConfigFile::Defaults::Defaults(tr1::shared_ptr<Map<std::string, std::string> > a) :
PrivateImplementationPattern<KeyValueConfigFile::Defaults>(new Implementation<KeyValueConfigFile::Defaults>(
tr1::shared_ptr<const KeyValueConfigFile>(), a, 0))
{
@@ -286,14 +288,14 @@ KeyValueConfigFile::Defaults::Defaults(tr1::shared_ptr<AssociativeCollection<std
KeyValueConfigFile::Defaults::Defaults(std::string (* f) (const std::string &, const std::string &)) :
PrivateImplementationPattern<KeyValueConfigFile::Defaults>(new Implementation<KeyValueConfigFile::Defaults>(
tr1::shared_ptr<const KeyValueConfigFile>(),
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> >(), f))
+ tr1::shared_ptr<const Map<std::string, std::string> >(), f))
{
}
KeyValueConfigFile::Defaults::Defaults() :
PrivateImplementationPattern<KeyValueConfigFile::Defaults>(new Implementation<KeyValueConfigFile::Defaults>(
tr1::shared_ptr<const KeyValueConfigFile>(),
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> >(), 0))
+ tr1::shared_ptr<const Map<std::string, std::string> >(), 0))
{
}
@@ -322,7 +324,7 @@ KeyValueConfigFile::Defaults::get(const std::string & k) const
return _imp->kv->get(k);
else if (_imp->a)
{
- AssociativeCollection<std::string, std::string>::Iterator x(_imp->a->find(k));
+ Map<std::string, std::string>::Iterator x(_imp->a->find(k));
if (x == _imp->a->end())
return "";
else
diff --git a/paludis/config_file.hh b/paludis/config_file.hh
index 96a32c8..3c396c3 100644
--- a/paludis/config_file.hh
+++ b/paludis/config_file.hh
@@ -20,11 +20,11 @@
#ifndef PALUDIS_GUARD_PALUDIS_CONFIG_FILE_HH
#define PALUDIS_GUARD_PALUDIS_CONFIG_FILE_HH 1
-#include <paludis/util/collection.hh>
+#include <paludis/util/map-fwd.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/options.hh>
+#include <paludis/util/options-fwd.hh>
#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
@@ -344,7 +344,7 @@ namespace paludis
* \ingroup grpkvconfigfile
*/
template<>
- KeyValueConfigFile::Defaults::Defaults(tr1::shared_ptr<const AssociativeCollection<std::string, std::string> >);
+ KeyValueConfigFile::Defaults::Defaults(tr1::shared_ptr<const Map<std::string, std::string> >);
/**
* Use another KeyValueConfigFile for defaults (non-const).
@@ -360,7 +360,7 @@ namespace paludis
* \ingroup grpkvconfigfile
*/
template<>
- KeyValueConfigFile::Defaults::Defaults(tr1::shared_ptr<AssociativeCollection<std::string, std::string> >);
+ KeyValueConfigFile::Defaults::Defaults(tr1::shared_ptr<Map<std::string, std::string> >);
}
#endif
diff --git a/paludis/config_file_TEST.cc b/paludis/config_file_TEST.cc
index 70e0187..aebc990 100644
--- a/paludis/config_file_TEST.cc
+++ b/paludis/config_file_TEST.cc
@@ -21,7 +21,8 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/system.hh>
-#include <paludis/util/collection_concrete.hh>
+#include <paludis/util/map.hh>
+#include <paludis/util/options.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <sstream>
@@ -229,8 +230,7 @@ namespace test_cases
TEST_CHECK_EQUAL(ff.get("z"), "foofoo\\$");
std::stringstream t;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > t_defs(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > t_defs(new Map<std::string, std::string>);
t_defs->insert("a", "moo");
t_defs->insert("d", "bar");
t_defs->insert("e", "baz");
diff --git a/paludis/dep_list/Makefile.am b/paludis/dep_list/Makefile.am
index c30c370..b2ee270 100644
--- a/paludis/dep_list/Makefile.am
+++ b/paludis/dep_list/Makefile.am
@@ -41,8 +41,8 @@ libpaludisdeplist_la_SOURCES = \
libpaludisdeplist_la_LDFLAGS = -version-info @VERSION_LIB_CURRENT@:@VERSION_LIB_REVISION@:0
libpaludisdeplist_la_LIBADD = \
- $(top_builddir)/paludis/util/libpaludisutil.la \
- $(top_builddir)/paludis/libpaludis.la
+ $(top_builddir)/paludis/libpaludis.la \
+ $(top_builddir)/paludis/util/libpaludisutil.la
lib_LTLIBRARIES = libpaludisdeplist.la
diff --git a/paludis/dep_list/dep_list.cc b/paludis/dep_list/dep_list.cc
index 0e4a3f5..f6f0261 100644
--- a/paludis/dep_list/dep_list.cc
+++ b/paludis/dep_list/dep_list.cc
@@ -35,13 +35,14 @@
#include <paludis/query.hh>
#include <paludis/version_requirements.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/save.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/tr1_functional.hh>
@@ -53,6 +54,7 @@
#include <algorithm>
#include <functional>
#include <vector>
+#include <list>
#include <set>
using namespace paludis;
@@ -157,7 +159,7 @@ namespace
/* see EffSTL 9 for why this is so painful */
if (e.tags->empty())
return;
- tr1::shared_ptr<DepListEntryTags> t(new DepListEntryTags::Concrete);
+ tr1::shared_ptr<DepListEntryTags> t(new DepListEntryTags);
GenerationGreaterThan pred(g);
for (DepListEntryTags::Iterator i(e.tags->begin()), i_end(e.tags->end()) ;
i != i_end ; ++i)
@@ -279,10 +281,10 @@ struct DepList::AddVisitor :
ConstVisitor<DependencySpecTree>::VisitConstSequence<AddVisitor, AllDepSpec>
{
DepList * const d;
- tr1::shared_ptr<const DestinationsCollection> destinations;
+ tr1::shared_ptr<const DestinationsSet> destinations;
tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> > conditions;
- AddVisitor(DepList * const dd, tr1::shared_ptr<const DestinationsCollection> ddd,
+ AddVisitor(DepList * const dd, tr1::shared_ptr<const DestinationsSet> ddd,
tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> > c =
(tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> >(
new ConstTreeSequence<DependencySpecTree, AllDepSpec>(
@@ -499,7 +501,7 @@ DepList::AddVisitor::visit_leaf(const PackageDepSpec & a)
}
}
- tr1::shared_ptr<PackageIDSequence> already_installed_in_same_slot(new PackageIDSequence::Concrete);
+ tr1::shared_ptr<PackageIDSequence> already_installed_in_same_slot(new PackageIDSequence);
for (PackageIDSequence::Iterator aa(already_installed->begin()),
aa_end(already_installed->end()) ; aa != aa_end ; ++aa)
if ((*aa)->slot() == best_visible_candidate->slot())
@@ -913,7 +915,7 @@ DepList::clear()
void
DepList::add_in_role(DependencySpecTree::ConstItem & spec, const std::string & role,
- tr1::shared_ptr<const DestinationsCollection> destinations)
+ tr1::shared_ptr<const DestinationsSet> destinations)
{
Context context("When adding " + role + ":");
add_not_top_level(spec, destinations,
@@ -922,7 +924,7 @@ DepList::add_in_role(DependencySpecTree::ConstItem & spec, const std::string & r
}
void
-DepList::add_not_top_level(DependencySpecTree::ConstItem & spec, tr1::shared_ptr<const DestinationsCollection> destinations,
+DepList::add_not_top_level(DependencySpecTree::ConstItem & spec, tr1::shared_ptr<const DestinationsSet> destinations,
tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> > conditions)
{
DepListTransaction transaction(_imp->merge_list, _imp->merge_list_index, _imp->merge_list_generation);
@@ -933,7 +935,7 @@ DepList::add_not_top_level(DependencySpecTree::ConstItem & spec, tr1::shared_ptr
}
void
-DepList::add(SetSpecTree::ConstItem & spec, tr1::shared_ptr<const DestinationsCollection> destinations)
+DepList::add(SetSpecTree::ConstItem & spec, tr1::shared_ptr<const DestinationsSet> destinations)
{
DepListTransaction transaction(_imp->merge_list, _imp->merge_list_index, _imp->merge_list_generation);
@@ -946,7 +948,7 @@ DepList::add(SetSpecTree::ConstItem & spec, tr1::shared_ptr<const DestinationsCo
}
void
-DepList::add(const PackageDepSpec & spec, tr1::shared_ptr<const DestinationsCollection> destinations)
+DepList::add(const PackageDepSpec & spec, tr1::shared_ptr<const DestinationsSet> destinations)
{
TreeLeaf<SetSpecTree, PackageDepSpec> l(tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec(spec)));
add(l, destinations);
@@ -955,7 +957,7 @@ DepList::add(const PackageDepSpec & spec, tr1::shared_ptr<const DestinationsColl
void
DepList::add_package(const tr1::shared_ptr<const PackageID> & p, tr1::shared_ptr<const DepTag> tag,
const PackageDepSpec & pds, tr1::shared_ptr<DependencySpecTree::ConstItem> conditions,
- tr1::shared_ptr<const DestinationsCollection> destinations)
+ tr1::shared_ptr<const DestinationsSet> destinations)
{
Context context("When adding package '" + stringify(*p) + "':");
@@ -970,7 +972,7 @@ DepList::add_package(const tr1::shared_ptr<const PackageID> & p, tr1::shared_ptr
.package_id(p)
.generation(_imp->merge_list_generation)
.state(dle_no_deps)
- .tags(tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags::Concrete))
+ .tags(tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags))
.destination(p->virtual_for_key() ? tr1::shared_ptr<Repository>() : find_destination(*p, destinations))
.associated_entry(0)
.kind(p->virtual_for_key() ? dlk_virtual : dlk_package))),
@@ -1006,7 +1008,7 @@ DepList::add_package(const tr1::shared_ptr<const PackageID> & p, tr1::shared_ptr
for (DepSpecFlattener::Iterator i(f.begin()), i_end(f.end()) ; i != i_end ; ++i)
{
- tr1::shared_ptr<VersionRequirements> v(new VersionRequirements::Concrete);
+ tr1::shared_ptr<VersionRequirements> v(new VersionRequirements);
v->push_back(VersionRequirement(vo_equal, p->version()));
tr1::shared_ptr<PackageDepSpec> pp(new PackageDepSpec(
tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName((*i)->text())),
@@ -1033,7 +1035,7 @@ DepList::add_package(const tr1::shared_ptr<const PackageID> & p, tr1::shared_ptr
QualifiedPackageName((*i)->text()), p))
.generation(_imp->merge_list_generation)
.state(dle_has_all_deps)
- .tags(tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags::Concrete))
+ .tags(tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags))
.destination(tr1::shared_ptr<Repository>())
.associated_entry(&*_imp->current_merge_list_entry)
.kind(dlk_provided)));
@@ -1103,7 +1105,7 @@ DepList::add_error_package(const tr1::shared_ptr<const PackageID> & p, const Dep
.package_id(p)
.generation(_imp->merge_list_generation)
.state(dle_has_all_deps)
- .tags(tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags::Concrete))
+ .tags(tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags))
.destination(tr1::shared_ptr<Repository>())
.associated_entry(&*_imp->current_merge_list_entry)
.kind(kind)));
@@ -1119,7 +1121,7 @@ DepList::add_error_package(const tr1::shared_ptr<const PackageID> & p, const Dep
void
DepList::add_suggested_package(const tr1::shared_ptr<const PackageID> & p,
const PackageDepSpec & pds, tr1::shared_ptr<DependencySpecTree::ConstItem> conditions,
- const tr1::shared_ptr<const DestinationsCollection> destinations)
+ const tr1::shared_ptr<const DestinationsSet> destinations)
{
std::pair<MergeListIndex::iterator, MergeListIndex::const_iterator> pp(
_imp->merge_list_index.equal_range(p->name()));
@@ -1138,7 +1140,7 @@ DepList::add_suggested_package(const tr1::shared_ptr<const PackageID> & p,
.package_id(p)
.generation(_imp->merge_list_generation)
.state(dle_has_all_deps)
- .tags(tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags::Concrete))
+ .tags(tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags))
.destination(find_destination(*p, destinations))
.associated_entry(&*_imp->current_merge_list_entry)
.kind(dlk_suggested)));
@@ -1153,7 +1155,7 @@ DepList::add_suggested_package(const tr1::shared_ptr<const PackageID> & p,
void
DepList::add_predeps(DependencySpecTree::ConstItem & d, const DepListDepsOption opt, const std::string & s,
- tr1::shared_ptr<const DestinationsCollection> destinations)
+ tr1::shared_ptr<const DestinationsSet> destinations)
{
if (dl_deps_pre == opt || dl_deps_pre_or_post == opt)
{
@@ -1174,7 +1176,7 @@ DepList::add_predeps(DependencySpecTree::ConstItem & d, const DepListDepsOption
void
DepList::add_postdeps(DependencySpecTree::ConstItem & d, const DepListDepsOption opt, const std::string & s,
- tr1::shared_ptr<const DestinationsCollection> destinations)
+ tr1::shared_ptr<const DestinationsSet> destinations)
{
if (dl_deps_pre_or_post == opt || dl_deps_post == opt || dl_deps_try_post == opt)
{
@@ -1208,7 +1210,7 @@ DepList::add_postdeps(DependencySpecTree::ConstItem & d, const DepListDepsOption
void
DepList::add_already_installed_package(const tr1::shared_ptr<const PackageID> & p, tr1::shared_ptr<const DepTag> tag,
const PackageDepSpec & pds, tr1::shared_ptr<DependencySpecTree::ConstItem> conditions,
- const tr1::shared_ptr<const DestinationsCollection> destinations)
+ const tr1::shared_ptr<const DestinationsSet> destinations)
{
Context context("When adding installed package '" + stringify(*p) + "':");
@@ -1218,7 +1220,7 @@ DepList::add_already_installed_package(const tr1::shared_ptr<const PackageID> &
DepListEntry::create()
.package_id(p)
.generation(_imp->merge_list_generation)
- .tags(tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags::Concrete))
+ .tags(tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags))
.state(dle_has_pre_deps)
.destination(tr1::shared_ptr<Repository>())
.associated_entry(0)
@@ -1383,7 +1385,7 @@ DepList::prefer_installed_over_uninstalled(const PackageID & installed,
bool
DepList::already_installed(const DependencySpecTree::ConstItem & spec,
- tr1::shared_ptr<const DestinationsCollection> destinations) const
+ tr1::shared_ptr<const DestinationsSet> destinations) const
{
QueryVisitor visitor(this, destinations, _imp->env, _imp->current_package_id());
spec.accept(visitor);
@@ -1448,9 +1450,9 @@ DepList::has_errors() const
tr1::shared_ptr<Repository>
DepList::find_destination(const PackageID & p,
- tr1::shared_ptr<const DestinationsCollection> dd)
+ tr1::shared_ptr<const DestinationsSet> dd)
{
- for (DestinationsCollection::Iterator d(dd->begin()), d_end(dd->end()) ;
+ for (DestinationsSet::Iterator d(dd->begin()), d_end(dd->end()) ;
d != d_end ; ++d)
if ((*d)->destination_interface)
if ((*d)->destination_interface->is_suitable_destination_for(p))
diff --git a/paludis/dep_list/dep_list.hh b/paludis/dep_list/dep_list.hh
index 4775724..aedfc73 100644
--- a/paludis/dep_list/dep_list.hh
+++ b/paludis/dep_list/dep_list.hh
@@ -57,13 +57,13 @@ namespace paludis
* Find an appropriate destination for a package.
*/
tr1::shared_ptr<Repository> find_destination(const PackageID &,
- tr1::shared_ptr<const DestinationsCollection>);
+ tr1::shared_ptr<const DestinationsSet>);
/**
* Add a DepSpec with role context.
*/
void add_in_role(DependencySpecTree::ConstItem &, const std::string & role,
- tr1::shared_ptr<const DestinationsCollection>);
+ tr1::shared_ptr<const DestinationsSet>);
/**
* Return whether we prefer the first parameter, which is installed,
@@ -77,14 +77,14 @@ namespace paludis
*/
void add_package(const tr1::shared_ptr<const PackageID> &, tr1::shared_ptr<const DepTag>,
const PackageDepSpec &, tr1::shared_ptr<DependencySpecTree::ConstItem>,
- tr1::shared_ptr<const DestinationsCollection> destinations);
+ tr1::shared_ptr<const DestinationsSet> destinations);
/**
* Add an already installed package to the list.
*/
void add_already_installed_package(const tr1::shared_ptr<const PackageID> &, tr1::shared_ptr<const DepTag>,
const PackageDepSpec &, tr1::shared_ptr<DependencySpecTree::ConstItem>,
- tr1::shared_ptr<const DestinationsCollection> destinations);
+ tr1::shared_ptr<const DestinationsSet> destinations);
/**
* Add an error package to the list.
@@ -96,13 +96,13 @@ namespace paludis
* Add predependencies.
*/
void add_predeps(DependencySpecTree::ConstItem &, const DepListDepsOption, const std::string &,
- tr1::shared_ptr<const DestinationsCollection> destinations);
+ tr1::shared_ptr<const DestinationsSet> destinations);
/**
* Add postdependencies.
*/
void add_postdeps(DependencySpecTree::ConstItem &, const DepListDepsOption, const std::string &,
- tr1::shared_ptr<const DestinationsCollection> destinations);
+ tr1::shared_ptr<const DestinationsSet> destinations);
/**
* Return whether the specified PackageDatabaseEntry is matched by
@@ -111,7 +111,7 @@ namespace paludis
bool is_top_level_target(const PackageID &) const;
void add_not_top_level(DependencySpecTree::ConstItem &,
- tr1::shared_ptr<const DestinationsCollection> target_destinations,
+ tr1::shared_ptr<const DestinationsSet> target_destinations,
tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> > conditions);
public:
@@ -139,14 +139,14 @@ namespace paludis
* spec.
*/
void add(SetSpecTree::ConstItem &,
- tr1::shared_ptr<const DestinationsCollection> target_destinations);
+ tr1::shared_ptr<const DestinationsSet> target_destinations);
/**
* Add the packages required to resolve an additional dependency
* spec.
*/
void add(const PackageDepSpec &,
- tr1::shared_ptr<const DestinationsCollection> target_destinations);
+ tr1::shared_ptr<const DestinationsSet> target_destinations);
/**
* Clear the list.
@@ -157,7 +157,7 @@ namespace paludis
* Return whether a spec structure is already installed.
*/
bool already_installed(DependencySpecTree::ConstItem &,
- tr1::shared_ptr<const DestinationsCollection> target_destinations) const;
+ tr1::shared_ptr<const DestinationsSet> target_destinations) const;
/**
* Return whether a PackageDatabaseEntry has been replaced.
@@ -179,7 +179,7 @@ namespace paludis
*/
void add_suggested_package(const tr1::shared_ptr<const PackageID> &,
const PackageDepSpec &, tr1::shared_ptr<DependencySpecTree::ConstItem>,
- tr1::shared_ptr<const DestinationsCollection> destinations);
+ tr1::shared_ptr<const DestinationsSet> destinations);
///\name Iterate over our dependency list entries.
///\{
diff --git a/paludis/dep_list/dep_list_TEST.cc b/paludis/dep_list/dep_list_TEST.cc
index 28c06b0..8d8ca97 100644
--- a/paludis/dep_list/dep_list_TEST.cc
+++ b/paludis/dep_list/dep_list_TEST.cc
@@ -19,6 +19,7 @@
#include "dep_list_TEST.hh"
#include <paludis/util/visitor-impl.hh>
+#include <paludis/util/set.hh>
#include <paludis/package_id.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/dep_spec_pretty_printer.hh>
diff --git a/paludis/dep_list/exceptions.cc b/paludis/dep_list/exceptions.cc
index 2ccd3d4..08a3561 100644
--- a/paludis/dep_list/exceptions.cc
+++ b/paludis/dep_list/exceptions.cc
@@ -18,6 +18,7 @@
*/
#include "exceptions.hh"
+#include <paludis/util/set.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
@@ -62,11 +63,11 @@ DowngradeNotAllowedError::~DowngradeNotAllowedError() throw ()
namespace
{
std::string
- destinations_to_string(tr1::shared_ptr<const DestinationsCollection> dd)
+ destinations_to_string(tr1::shared_ptr<const DestinationsSet> dd)
{
std::string result;
bool need_comma(false);
- for (DestinationsCollection::Iterator d(dd->begin()), d_end(dd->end()) ;
+ for (DestinationsSet::Iterator d(dd->begin()), d_end(dd->end()) ;
d != d_end ; ++d)
{
if (need_comma)
@@ -80,7 +81,7 @@ namespace
}
NoDestinationError::NoDestinationError(const PackageID & p,
- tr1::shared_ptr<const DestinationsCollection> d) throw () :
+ tr1::shared_ptr<const DestinationsSet> d) throw () :
DepListError("No suitable destination for '" + stringify(p) + "' in (" +
destinations_to_string(d) + ")")
{
diff --git a/paludis/dep_list/exceptions.hh b/paludis/dep_list/exceptions.hh
index 406de07..69c55c4 100644
--- a/paludis/dep_list/exceptions.hh
+++ b/paludis/dep_list/exceptions.hh
@@ -181,7 +181,7 @@ namespace paludis
///\{
NoDestinationError(const PackageID &,
- tr1::shared_ptr<const DestinationsCollection>) throw ();
+ tr1::shared_ptr<const DestinationsSet>) throw ();
///\}
};
diff --git a/paludis/dep_list/query_visitor.cc b/paludis/dep_list/query_visitor.cc
index 8fc2095..d352fcc 100644
--- a/paludis/dep_list/query_visitor.cc
+++ b/paludis/dep_list/query_visitor.cc
@@ -23,6 +23,7 @@
#include <paludis/package_database.hh>
#include <paludis/query.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
@@ -37,11 +38,11 @@ namespace paludis
{
bool result;
const DepList * const dep_list;
- tr1::shared_ptr<const DestinationsCollection> destinations;
+ tr1::shared_ptr<const DestinationsSet> destinations;
const Environment * const environment;
const tr1::shared_ptr<const PackageID> id;
- Implementation(const DepList * const d, tr1::shared_ptr<const DestinationsCollection> dd,
+ Implementation(const DepList * const d, tr1::shared_ptr<const DestinationsSet> dd,
const Environment * const e, const tr1::shared_ptr<const PackageID> & p) :
result(true),
dep_list(d),
@@ -53,7 +54,7 @@ namespace paludis
};
}
-QueryVisitor::QueryVisitor(const DepList * const d, tr1::shared_ptr<const DestinationsCollection> dd,
+QueryVisitor::QueryVisitor(const DepList * const d, tr1::shared_ptr<const DestinationsSet> dd,
const Environment * const e, const tr1::shared_ptr<const PackageID> & id) :
PrivateImplementationPattern<QueryVisitor>(new Implementation<QueryVisitor>(d, dd, e, id))
{
diff --git a/paludis/dep_list/query_visitor.hh b/paludis/dep_list/query_visitor.hh
index a2c74d7..5d06261 100644
--- a/paludis/dep_list/query_visitor.hh
+++ b/paludis/dep_list/query_visitor.hh
@@ -40,7 +40,7 @@ namespace paludis
///\name Basic operations
///\{
- QueryVisitor(const DepList * const, tr1::shared_ptr<const DestinationsCollection>,
+ QueryVisitor(const DepList * const, tr1::shared_ptr<const DestinationsSet>,
const Environment * const, const tr1::shared_ptr<const PackageID> &);
~QueryVisitor();
diff --git a/paludis/dep_list/range_rewriter.cc b/paludis/dep_list/range_rewriter.cc
index 5583b29..03b07b2 100644
--- a/paludis/dep_list/range_rewriter.cc
+++ b/paludis/dep_list/range_rewriter.cc
@@ -18,6 +18,7 @@
*/
#include "range_rewriter.hh"
+#include <paludis/util/sequence.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
diff --git a/paludis/dep_list/show_suggest_visitor.cc b/paludis/dep_list/show_suggest_visitor.cc
index b912405..7b14693 100644
--- a/paludis/dep_list/show_suggest_visitor.cc
+++ b/paludis/dep_list/show_suggest_visitor.cc
@@ -38,13 +38,13 @@ namespace paludis
struct Implementation<ShowSuggestVisitor>
{
DepList * const dep_list;
- tr1::shared_ptr<const DestinationsCollection> destinations;
+ tr1::shared_ptr<const DestinationsSet> destinations;
const Environment * const environment;
const tr1::shared_ptr<const PackageID> id;
bool dependency_tags;
tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> > conditions;
- Implementation(DepList * const d, tr1::shared_ptr<const DestinationsCollection> dd,
+ Implementation(DepList * const d, tr1::shared_ptr<const DestinationsSet> dd,
const Environment * const e, const tr1::shared_ptr<const PackageID> & p, bool t) :
dep_list(d),
destinations(dd),
@@ -59,7 +59,7 @@ namespace paludis
};
}
-ShowSuggestVisitor::ShowSuggestVisitor(DepList * const d, tr1::shared_ptr<const DestinationsCollection> dd,
+ShowSuggestVisitor::ShowSuggestVisitor(DepList * const d, tr1::shared_ptr<const DestinationsSet> dd,
const Environment * const e, const tr1::shared_ptr<const PackageID> & p, bool t) :
PrivateImplementationPattern<ShowSuggestVisitor>(new Implementation<ShowSuggestVisitor>(d, dd, e, p, t))
{
diff --git a/paludis/dep_list/show_suggest_visitor.hh b/paludis/dep_list/show_suggest_visitor.hh
index fbdfc92..f963ea0 100644
--- a/paludis/dep_list/show_suggest_visitor.hh
+++ b/paludis/dep_list/show_suggest_visitor.hh
@@ -42,7 +42,7 @@ namespace paludis
///\name Basic operations
///\{
- ShowSuggestVisitor(DepList * const dd, tr1::shared_ptr<const DestinationsCollection> ddd,
+ ShowSuggestVisitor(DepList * const dd, tr1::shared_ptr<const DestinationsSet> ddd,
const Environment * const, const tr1::shared_ptr<const PackageID> &, bool);
~ShowSuggestVisitor();
diff --git a/paludis/dep_list/uninstall_list.cc b/paludis/dep_list/uninstall_list.cc
index d5e4661..d52f644 100644
--- a/paludis/dep_list/uninstall_list.cc
+++ b/paludis/dep_list/uninstall_list.cc
@@ -24,11 +24,12 @@ using namespace paludis;
#include <paludis/dep_list/uninstall_list-sr.cc>
#include <paludis/dep_list/condition_tracker.hh>
#include <paludis/environment.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
#include <paludis/util/save.hh>
#include <paludis/util/visitor-impl.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/set-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/hashed_containers.hh>
#include <paludis/match_package.hh>
@@ -44,6 +45,8 @@ using namespace paludis;
typedef MakeHashedMap<tr1::shared_ptr<const PackageID>, tr1::shared_ptr<const DepListEntryTags> >::Type DepCollectorCache;
+template class Set<tr1::shared_ptr<DepTag> >;
+
namespace paludis
{
template<>
@@ -126,17 +129,17 @@ UninstallList::add_unused()
everything(collect_all_installed());
tr1::shared_ptr<PackageIDSet>
- world_plus_deps(new PackageIDSet::Concrete),
- unused(new PackageIDSet::Concrete);
+ world_plus_deps(new PackageIDSet),
+ unused(new PackageIDSet);
- world_plus_deps->insert(world->begin(), world->end());
+ std::copy(world->begin(), world->end(), world_plus_deps->inserter());
std::size_t old_size(0);
while (old_size != world_plus_deps->size())
{
old_size = world_plus_deps->size();
tr1::shared_ptr<const PackageIDSet> new_world_deps(collect_depped_upon(world_plus_deps));
- world_plus_deps->insert(new_world_deps->begin(), new_world_deps->end());
+ std::copy(new_world_deps->begin(), new_world_deps->end(), world_plus_deps->inserter());
}
std::set_difference(everything->begin(), everything->end(),
@@ -172,8 +175,8 @@ UninstallList::add_package(const tr1::shared_ptr<const PackageID> & e, tr1::shar
std::list<UninstallListEntry>::iterator i(_imp->uninstall_list.insert(
_imp->uninstall_list.end(), UninstallListEntry(
- e, e->virtual_for_key(), tr1::shared_ptr<SortedCollection<tr1::shared_ptr<DepTag> > >(
- new SortedCollection<tr1::shared_ptr<DepTag> >::Concrete))));
+ e, e->virtual_for_key(), tr1::shared_ptr<Set<tr1::shared_ptr<DepTag> > >(
+ new Set<tr1::shared_ptr<DepTag> >))));
if (t)
i->tags->insert(t);
}
@@ -194,19 +197,19 @@ UninstallList::collect_all_installed() const
{
Context context("When collecting all installed packages:");
- tr1::shared_ptr<PackageIDSet> result(new PackageIDSet::Concrete);
+ tr1::shared_ptr<PackageIDSet> result(new PackageIDSet);
for (PackageDatabase::RepositoryIterator i(_imp->env->package_database()->begin_repositories()),
i_end(_imp->env->package_database()->end_repositories()) ; i != i_end ; ++i)
{
if (! (*i)->installed_interface)
continue;
- tr1::shared_ptr<const CategoryNamePartCollection> cats((*i)->category_names());
- for (CategoryNamePartCollection::Iterator c(cats->begin()), c_end(cats->end()) ;
+ tr1::shared_ptr<const CategoryNamePartSet> cats((*i)->category_names());
+ for (CategoryNamePartSet::Iterator c(cats->begin()), c_end(cats->end()) ;
c != c_end ; ++c)
{
- tr1::shared_ptr<const QualifiedPackageNameCollection> pkgs((*i)->package_names(*c));
- for (QualifiedPackageNameCollection::Iterator p(pkgs->begin()), p_end(pkgs->end()) ;
+ tr1::shared_ptr<const QualifiedPackageNameSet> pkgs((*i)->package_names(*c));
+ for (QualifiedPackageNameSet::Iterator p(pkgs->begin()), p_end(pkgs->end()) ;
p != p_end ; ++p)
{
tr1::shared_ptr<const PackageIDSequence> ids((*i)->package_ids(*p));
@@ -236,7 +239,7 @@ namespace
DepCollector(const Environment * const ee, const tr1::shared_ptr<const PackageID> & e) :
env(ee),
pkg(e),
- matches(new DepListEntryTags::Concrete),
+ matches(new DepListEntryTags),
conditions(tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> >(
new ConstTreeSequence<DependencySpecTree, AllDepSpec>(
tr1::shared_ptr<AllDepSpec>(new AllDepSpec))))
@@ -287,7 +290,7 @@ UninstallList::collect_depped_upon(tr1::shared_ptr<const PackageIDSet> targets)
{
Context context("When collecting depended upon packages:");
- tr1::shared_ptr<PackageIDSet> result(new PackageIDSet::Concrete);
+ tr1::shared_ptr<PackageIDSet> result(new PackageIDSet);
for (PackageIDSet::Iterator i(targets->begin()), i_end(targets->end()) ;
i != i_end ; ++i)
@@ -332,7 +335,7 @@ UninstallList::add_unused_dependencies()
added = false;
/* find packages that're depped upon by anything in our uninstall list */
- tr1::shared_ptr<PackageIDSet> uninstall_list_targets(new PackageIDSet::Concrete);
+ tr1::shared_ptr<PackageIDSet> uninstall_list_targets(new PackageIDSet);
for (std::list<UninstallListEntry>::const_iterator i(_imp->uninstall_list.begin()),
i_end(_imp->uninstall_list.end()) ; i != i_end ; ++i)
uninstall_list_targets->insert(i->package_id);
@@ -341,7 +344,7 @@ UninstallList::add_unused_dependencies()
/* find packages that're depped upon by anything not in our uninstall list */
tr1::shared_ptr<PackageIDSet> everything_except_uninstall_list_targets(
- new PackageIDSet::Concrete);
+ new PackageIDSet);
std::set_difference(everything->begin(), everything->end(),
uninstall_list_targets->begin(), uninstall_list_targets->end(),
everything_except_uninstall_list_targets->inserter(),
@@ -355,7 +358,7 @@ UninstallList::add_unused_dependencies()
collect_depped_upon(everything_except_uninstall_list_targets));
/* find unused dependencies */
- tr1::shared_ptr<PackageIDSet> unused_dependencies(new PackageIDSet::Concrete);
+ tr1::shared_ptr<PackageIDSet> unused_dependencies(new PackageIDSet);
std::set_difference(depped_upon_list->begin(), depped_upon_list->end(),
depped_upon_not_list->begin(), depped_upon_not_list->end(), unused_dependencies->inserter(),
PackageIDSetComparator());
@@ -432,7 +435,7 @@ UninstallList::collect_world() const
{
Context local_context("When collecting world packages:");
- tr1::shared_ptr<PackageIDSet> result(new PackageIDSet::Concrete);
+ tr1::shared_ptr<PackageIDSet> result(new PackageIDSet);
tr1::shared_ptr<const PackageIDSet> everything(collect_all_installed());
tr1::shared_ptr<SetSpecTree::ConstItem> world(_imp->env->set(SetName("world")));
diff --git a/paludis/dep_list/uninstall_list.sr b/paludis/dep_list/uninstall_list.sr
index 5a91b0c..83924cb 100644
--- a/paludis/dep_list/uninstall_list.sr
+++ b/paludis/dep_list/uninstall_list.sr
@@ -31,7 +31,7 @@ make_class_UninstallListEntry()
key package_id "tr1::shared_ptr<const PackageID>"
key skip_uninstall bool
- key tags "tr1::shared_ptr<SortedCollection<tr1::shared_ptr<DepTag> > >"
+ key tags "tr1::shared_ptr<Set<tr1::shared_ptr<DepTag> > >"
allow_named_args
diff --git a/paludis/dep_list/uninstall_list_TEST.cc b/paludis/dep_list/uninstall_list_TEST.cc
index 1eab951..4773583 100644
--- a/paludis/dep_list/uninstall_list_TEST.cc
+++ b/paludis/dep_list/uninstall_list_TEST.cc
@@ -24,7 +24,6 @@
#include <paludis/repositories/virtuals/virtuals_repository.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/portage_dep_parser.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/package_database.hh>
#include <test/test_framework.hh>
@@ -73,7 +72,7 @@ namespace test_cases
env(),
installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed"))),
virtuals_repo(new VirtualsRepository(&env)),
- targets(new PackageIDSequence::Concrete),
+ targets(new PackageIDSequence),
done_populate(false)
{
env.package_database()->add_repository(2, installed_repo);
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 81ed200..5e6f8e2 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -23,7 +23,6 @@
#include <paludis/version_requirements.hh>
#include <paludis/util/clone-impl.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
@@ -365,7 +364,7 @@ PackageDepSpec::_do_parse(const std::string & ss, const PackageDepSpecParseMode
case '=':
case '~':
{
- _imp->version_requirements.reset(new VersionRequirements::Concrete);
+ _imp->version_requirements.reset(new VersionRequirements);
char needed_mode(0);
while (! flag.empty())
@@ -566,7 +565,7 @@ PackageDepSpec::_do_parse(const std::string & ss, const PackageDepSpecParseMode
else
_imp->package_ptr.reset(new QualifiedPackageName(t));
- _imp->version_requirements.reset(new VersionRequirements::Concrete);
+ _imp->version_requirements.reset(new VersionRequirements);
if ('*' == s.at(s.length() - 1))
{
@@ -954,8 +953,8 @@ PackageDepSpec::_make_unique()
if (_imp->version_requirements && ! _imp->version_requirements.unique())
{
- tr1::shared_ptr<VersionRequirements> v(new VersionRequirements::Concrete);
- std::copy(_imp->version_requirements->begin(), _imp->version_requirements->end(), v->inserter());
+ tr1::shared_ptr<VersionRequirements> v(new VersionRequirements);
+ std::copy(_imp->version_requirements->begin(), _imp->version_requirements->end(), v->back_inserter());
_imp->version_requirements = v;
}
diff --git a/paludis/dep_spec_TEST.cc b/paludis/dep_spec_TEST.cc
index 0839cec..6a04bb1 100644
--- a/paludis/dep_spec_TEST.cc
+++ b/paludis/dep_spec_TEST.cc
@@ -19,6 +19,7 @@
#include <paludis/dep_spec.hh>
#include <paludis/util/iterator.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/version_requirements.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
diff --git a/paludis/dep_tag-fwd.hh b/paludis/dep_tag-fwd.hh
index e676eb8..2ea1c40 100644
--- a/paludis/dep_tag-fwd.hh
+++ b/paludis/dep_tag-fwd.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_DEP_TAG_FWD_HH 1
#include <paludis/util/visitor-fwd.hh>
-#include <paludis/util/collection-fwd.hh>
+#include <paludis/util/set-fwd.hh>
#include <paludis/util/attributes.hh>
namespace paludis
@@ -46,7 +46,7 @@ namespace paludis
*
* \ingroup grpdeptag
*/
- typedef SortedCollection<DepTagEntry> DepListEntryTags;
+ typedef Set<DepTagEntry> DepListEntryTags;
}
#endif
diff --git a/paludis/dep_tag.cc b/paludis/dep_tag.cc
index eea1d1d..4e7172a 100644
--- a/paludis/dep_tag.cc
+++ b/paludis/dep_tag.cc
@@ -24,6 +24,7 @@
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/set-impl.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
/** \file
@@ -52,6 +53,8 @@ template class Visits<const TargetDepTag>;
template class InstantiationPolicy<DepTagCategoryMaker, instantiation_method::SingletonTag>;
+template class Set<DepTagEntry>;
+
#include <paludis/dep_tag-sr.cc>
namespace
diff --git a/paludis/dep_tag.hh b/paludis/dep_tag.hh
index d05dca3..38fbe60 100644
--- a/paludis/dep_tag.hh
+++ b/paludis/dep_tag.hh
@@ -34,7 +34,6 @@
#include <paludis/util/visitor.hh>
#include <paludis/util/virtual_constructor.hh>
#include <paludis/util/exception.hh>
-#include <paludis/util/collection.hh>
#include <paludis/util/sr.hh>
#include <paludis/util/operators.hh>
diff --git a/paludis/eapi.cc b/paludis/eapi.cc
index a574a57..6e2a23e 100644
--- a/paludis/eapi.cc
+++ b/paludis/eapi.cc
@@ -27,7 +27,6 @@
#include <paludis/util/strip.hh>
#include <paludis/util/destringify.hh>
#include <paludis/util/make_shared_ptr.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
diff --git a/paludis/environment-fwd.hh b/paludis/environment-fwd.hh
index 724f966..cbd27d6 100644
--- a/paludis/environment-fwd.hh
+++ b/paludis/environment-fwd.hh
@@ -20,9 +20,10 @@
#ifndef PALUDIS_GUARD_PALUDIS_ENVIRONMENT_FWD_HH
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENT_FWD_HH 1
-#include <paludis/util/collection-fwd.hh>
+#include <paludis/util/sequence-fwd.hh>
#include <paludis/util/options-fwd.hh>
#include <paludis/util/attributes.hh>
+#include <paludis/util/sequence-fwd.hh>
#include <iosfwd>
namespace paludis
@@ -46,7 +47,7 @@ namespace paludis
* \see Environment
* \ingroup grpenvironment
*/
- typedef SequentialCollection<std::string> MirrorsCollection;
+ typedef Sequence<std::string> MirrorsSequence;
class Environment;
}
diff --git a/paludis/environment.cc b/paludis/environment.cc
index 057afe0..2dc979c 100644
--- a/paludis/environment.cc
+++ b/paludis/environment.cc
@@ -20,11 +20,14 @@
#include <paludis/environment.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/sequence-impl.hh>
using namespace paludis;
#include <paludis/environment-se.cc>
+template class Sequence<std::string>;
+
Environment::~Environment()
{
}
diff --git a/paludis/environment.hh b/paludis/environment.hh
index ba8ea93..40fb6e5 100644
--- a/paludis/environment.hh
+++ b/paludis/environment.hh
@@ -23,7 +23,6 @@
#include <paludis/environment-fwd.hh>
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/options-fwd.hh>
-#include <paludis/util/collection-fwd.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/mask_reasons.hh>
#include <paludis/name-fwd.hh>
@@ -88,7 +87,7 @@ namespace paludis
* the specified prefix or merely all enabled use flags. It is not safe to assume
* that all flags in the returned value will be enabled for the specified package.
*/
- virtual tr1::shared_ptr<const UseFlagNameCollection> known_use_expand_names(
+ virtual tr1::shared_ptr<const UseFlagNameSet> known_use_expand_names(
const UseFlagName &, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
@@ -121,7 +120,7 @@ namespace paludis
*
* Default behaviour: true if the collection includes "*".
*/
- virtual bool accept_keywords(tr1::shared_ptr<const KeywordNameCollection>, const PackageID &) const
+ virtual bool accept_keywords(tr1::shared_ptr<const KeywordNameSet>, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
///\}
@@ -144,25 +143,25 @@ namespace paludis
* Return a collection of bashrc files to be used by the various components
* that are implemented in bash.
*/
- virtual tr1::shared_ptr<const FSEntryCollection> bashrc_files() const
+ virtual tr1::shared_ptr<const FSEntrySequence> bashrc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
* Return directories to search for syncer scripts.
*/
- virtual tr1::shared_ptr<const FSEntryCollection> syncers_dirs() const
+ virtual tr1::shared_ptr<const FSEntrySequence> syncers_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
* Return directories to search for fetcher scripts.
*/
- virtual tr1::shared_ptr<const FSEntryCollection> fetchers_dirs() const
+ virtual tr1::shared_ptr<const FSEntrySequence> fetchers_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
* Return directories to search for hooks.
*/
- virtual tr1::shared_ptr<const FSEntryCollection> hook_dirs() const
+ virtual tr1::shared_ptr<const FSEntrySequence> hook_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
@@ -199,7 +198,7 @@ namespace paludis
/**
* Return the mirror URI prefixes for a named mirror.
*/
- virtual tr1::shared_ptr<const MirrorsCollection> mirrors(const std::string &) const
+ virtual tr1::shared_ptr<const MirrorsSequence> mirrors(const std::string &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
///\}
@@ -210,7 +209,7 @@ namespace paludis
/**
* Return all known named sets.
*/
- virtual tr1::shared_ptr<const SetNameCollection> set_names() const
+ virtual tr1::shared_ptr<const SetNameSet> set_names() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
@@ -229,7 +228,7 @@ namespace paludis
/**
* Default destination candidates for installing packages.
*/
- virtual tr1::shared_ptr<const DestinationsCollection> default_destinations() const
+ virtual tr1::shared_ptr<const DestinationsSet> default_destinations() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
///\}
diff --git a/paludis/environment_implementation.cc b/paludis/environment_implementation.cc
index 6338a76..8d4eeba 100644
--- a/paludis/environment_implementation.cc
+++ b/paludis/environment_implementation.cc
@@ -21,10 +21,10 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/package_database.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/log.hh>
#include <paludis/util/save.hh>
+#include <paludis/util/set.hh>
#include <paludis/eapi.hh>
#include <paludis/hook.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
@@ -101,7 +101,7 @@ EnvironmentImplementation::accept_eapi(const PackageID & e) const
}
bool
-EnvironmentImplementation::accept_keywords(tr1::shared_ptr<const KeywordNameCollection> k,
+EnvironmentImplementation::accept_keywords(tr1::shared_ptr<const KeywordNameSet> k,
const PackageID &) const
{
return k->end() != k->find(KeywordName("*"));
@@ -143,42 +143,42 @@ EnvironmentImplementation::~EnvironmentImplementation()
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
EnvironmentImplementation::known_use_expand_names(const UseFlagName &, const PackageID &) const
{
- static tr1::shared_ptr<const UseFlagNameCollection> result(new UseFlagNameCollection::Concrete);
+ static tr1::shared_ptr<const UseFlagNameSet> result(new UseFlagNameSet);
return result;
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
EnvironmentImplementation::bashrc_files() const
{
- static tr1::shared_ptr<const FSEntryCollection> result(new FSEntryCollection::Concrete);
+ static tr1::shared_ptr<const FSEntrySequence> result(new FSEntrySequence);
return result;
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
EnvironmentImplementation::syncers_dirs() const
{
- tr1::shared_ptr<FSEntryCollection> result(new FSEntryCollection::Concrete);
+ tr1::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
result->push_back(FSEntry(DATADIR "/paludis/syncers"));
result->push_back(FSEntry(LIBEXECDIR "/paludis/syncers"));
return result;
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
EnvironmentImplementation::fetchers_dirs() const
{
- tr1::shared_ptr<FSEntryCollection> result(new FSEntryCollection::Concrete);
+ tr1::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
result->push_back(FSEntry(DATADIR "/paludis/fetchers"));
result->push_back(FSEntry(LIBEXECDIR "/paludis/fetchers"));
return result;
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
EnvironmentImplementation::hook_dirs() const
{
- static tr1::shared_ptr<const FSEntryCollection> result(new FSEntryCollection::Concrete);
+ static tr1::shared_ptr<const FSEntrySequence> result(new FSEntrySequence);
return result;
}
@@ -200,17 +200,17 @@ EnvironmentImplementation::reduced_gid() const
return getgid();
}
-tr1::shared_ptr<const MirrorsCollection>
+tr1::shared_ptr<const MirrorsSequence>
EnvironmentImplementation::mirrors(const std::string &) const
{
- static tr1::shared_ptr<const MirrorsCollection> result(new MirrorsCollection::Concrete);
+ static tr1::shared_ptr<const MirrorsSequence> result(new MirrorsSequence);
return result;
}
-tr1::shared_ptr<const SetNameCollection>
+tr1::shared_ptr<const SetNameSet>
EnvironmentImplementation::set_names() const
{
- static tr1::shared_ptr<const SetNameCollection> result(new SetNameCollection::Concrete);
+ static tr1::shared_ptr<const SetNameSet> result(new SetNameSet);
return result;
}
@@ -220,10 +220,10 @@ EnvironmentImplementation::perform_hook(const Hook &) const
return HookResult(0, "");
}
-tr1::shared_ptr<const DestinationsCollection>
+tr1::shared_ptr<const DestinationsSet>
EnvironmentImplementation::default_destinations() const
{
- tr1::shared_ptr<DestinationsCollection> result(new DestinationsCollection::Concrete);
+ tr1::shared_ptr<DestinationsSet> result(new DestinationsSet);
for (PackageDatabase::RepositoryIterator r(package_database()->begin_repositories()),
r_end(package_database()->end_repositories()) ;
@@ -260,15 +260,15 @@ EnvironmentImplementation::mask_reasons(const PackageID & e, const MaskReasonsOp
if (e.keywords_key())
{
- tr1::shared_ptr<const KeywordNameCollection> keywords(e.keywords_key()->value());
+ tr1::shared_ptr<const KeywordNameSet> keywords(e.keywords_key()->value());
if (! accept_keywords(keywords, e))
{
do
{
if (options[mro_override_unkeyworded])
{
- tr1::shared_ptr<KeywordNameCollection> minus_keywords(new KeywordNameCollection::Concrete);
- for (KeywordNameCollection::Iterator k(keywords->begin()), k_end(keywords->end()) ;
+ tr1::shared_ptr<KeywordNameSet> minus_keywords(new KeywordNameSet);
+ for (KeywordNameSet::Iterator k(keywords->begin()), k_end(keywords->end()) ;
k != k_end ; ++k)
if ('-' == stringify(*k).at(0))
minus_keywords->insert(KeywordName(stringify(*k).substr(1)));
@@ -279,8 +279,8 @@ EnvironmentImplementation::mask_reasons(const PackageID & e, const MaskReasonsOp
if (options[mro_override_tilde_keywords])
{
- tr1::shared_ptr<KeywordNameCollection> detildeified_keywords(new KeywordNameCollection::Concrete);
- for (KeywordNameCollection::Iterator k(keywords->begin()), k_end(keywords->end()) ;
+ tr1::shared_ptr<KeywordNameSet> detildeified_keywords(new KeywordNameSet);
+ for (KeywordNameSet::Iterator k(keywords->begin()), k_end(keywords->end()) ;
k != k_end ; ++k)
{
detildeified_keywords->insert(*k);
diff --git a/paludis/environment_implementation.hh b/paludis/environment_implementation.hh
index b6a970a..f7159a7 100644
--- a/paludis/environment_implementation.hh
+++ b/paludis/environment_implementation.hh
@@ -98,7 +98,7 @@ namespace paludis
virtual bool query_use(const UseFlagName &, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const UseFlagNameCollection> known_use_expand_names(
+ virtual tr1::shared_ptr<const UseFlagNameSet> known_use_expand_names(
const UseFlagName &, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -109,19 +109,19 @@ namespace paludis
virtual bool accept_license(const std::string &, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual bool accept_keywords(tr1::shared_ptr<const KeywordNameCollection>, const PackageID &) const
+ virtual bool accept_keywords(tr1::shared_ptr<const KeywordNameSet>, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> bashrc_files() const
+ virtual tr1::shared_ptr<const FSEntrySequence> bashrc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> syncers_dirs() const
+ virtual tr1::shared_ptr<const FSEntrySequence> syncers_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> fetchers_dirs() const
+ virtual tr1::shared_ptr<const FSEntrySequence> fetchers_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> hook_dirs() const
+ virtual tr1::shared_ptr<const FSEntrySequence> hook_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const FSEntry root() const
@@ -133,16 +133,16 @@ namespace paludis
virtual gid_t reduced_gid() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const MirrorsCollection> mirrors(const std::string &) const
+ virtual tr1::shared_ptr<const MirrorsSequence> mirrors(const std::string &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const SetNameCollection> set_names() const
+ virtual tr1::shared_ptr<const SetNameSet> set_names() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual tr1::shared_ptr<SetSpecTree::ConstItem> set(const SetName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const DestinationsCollection> default_destinations() const
+ virtual tr1::shared_ptr<const DestinationsSet> default_destinations() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual HookResult perform_hook(const Hook &) const
diff --git a/paludis/environment_implementation_TEST.cc b/paludis/environment_implementation_TEST.cc
index 59f744f..ab25619 100644
--- a/paludis/environment_implementation_TEST.cc
+++ b/paludis/environment_implementation_TEST.cc
@@ -21,7 +21,12 @@
#include <paludis/package_database.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
+#include <paludis/package_id.hh>
+#include <paludis/name.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/tr1_memory.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <test/test_framework.hh>
@@ -74,7 +79,7 @@ namespace
{
}
- bool accept_keywords(tr1::shared_ptr<const KeywordNameCollection> k, const PackageID &) const
+ bool accept_keywords(tr1::shared_ptr<const KeywordNameSet> k, const PackageID &) const
{
return k->end() != k->find(KeywordName("test")) || k->end() != k->find(KeywordName("*"));
}
diff --git a/paludis/environments/adapted/adapted_environment.cc b/paludis/environments/adapted/adapted_environment.cc
index 078eed9..5c02e51 100644
--- a/paludis/environments/adapted/adapted_environment.cc
+++ b/paludis/environments/adapted/adapted_environment.cc
@@ -106,7 +106,7 @@ AdaptedEnvironment::query_use(const UseFlagName & u, const PackageID & e) const
throw InternalError(PALUDIS_HERE, "Bad state");
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
AdaptedEnvironment::known_use_expand_names(const UseFlagName & u, const PackageID & e) const
{
return _imp->env->known_use_expand_names(u, e);
@@ -125,30 +125,30 @@ AdaptedEnvironment::accept_license(const std::string & l, const PackageID & e) c
}
bool
-AdaptedEnvironment::accept_keywords(tr1::shared_ptr<const KeywordNameCollection> k, const PackageID & e) const
+AdaptedEnvironment::accept_keywords(tr1::shared_ptr<const KeywordNameSet> k, const PackageID & e) const
{
return _imp->env->accept_keywords(k, e);
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
AdaptedEnvironment::bashrc_files() const
{
return _imp->env->bashrc_files();
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
AdaptedEnvironment::syncers_dirs() const
{
return _imp->env->syncers_dirs();
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
AdaptedEnvironment::fetchers_dirs() const
{
return _imp->env->fetchers_dirs();
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
AdaptedEnvironment::hook_dirs() const
{
return _imp->env->hook_dirs();
@@ -184,13 +184,13 @@ AdaptedEnvironment::reduced_gid() const
return _imp->env->reduced_gid();
}
-tr1::shared_ptr<const MirrorsCollection>
+tr1::shared_ptr<const MirrorsSequence>
AdaptedEnvironment::mirrors(const std::string & m) const
{
return _imp->env->mirrors(m);
}
-tr1::shared_ptr<const SetNameCollection>
+tr1::shared_ptr<const SetNameSet>
AdaptedEnvironment::set_names() const
{
return _imp->env->set_names();
@@ -202,7 +202,7 @@ AdaptedEnvironment::set(const SetName & s) const
return _imp->env->set(s);
}
-tr1::shared_ptr<const DestinationsCollection>
+tr1::shared_ptr<const DestinationsSet>
AdaptedEnvironment::default_destinations() const
{
return _imp->env->default_destinations();
diff --git a/paludis/environments/adapted/adapted_environment.hh b/paludis/environments/adapted/adapted_environment.hh
index 67b1b00..7c912e5 100644
--- a/paludis/environments/adapted/adapted_environment.hh
+++ b/paludis/environments/adapted/adapted_environment.hh
@@ -60,7 +60,7 @@ namespace paludis
virtual bool query_use(const UseFlagName &, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const UseFlagNameCollection> known_use_expand_names(
+ virtual tr1::shared_ptr<const UseFlagNameSet> known_use_expand_names(
const UseFlagName &, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -71,7 +71,7 @@ namespace paludis
virtual bool accept_license(const std::string &, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual bool accept_keywords(tr1::shared_ptr<const KeywordNameCollection>, const PackageID &) const
+ virtual bool accept_keywords(tr1::shared_ptr<const KeywordNameSet>, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual tr1::shared_ptr<PackageDatabase> package_database()
@@ -80,16 +80,16 @@ namespace paludis
virtual tr1::shared_ptr<const PackageDatabase> package_database() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> bashrc_files() const
+ virtual tr1::shared_ptr<const FSEntrySequence> bashrc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> syncers_dirs() const
+ virtual tr1::shared_ptr<const FSEntrySequence> syncers_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> fetchers_dirs() const
+ virtual tr1::shared_ptr<const FSEntrySequence> fetchers_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> hook_dirs() const
+ virtual tr1::shared_ptr<const FSEntrySequence> hook_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual std::string paludis_command() const
@@ -103,15 +103,15 @@ namespace paludis
virtual gid_t reduced_gid() const;
- virtual tr1::shared_ptr<const MirrorsCollection> mirrors(const std::string &) const
+ virtual tr1::shared_ptr<const MirrorsSequence> mirrors(const std::string &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const SetNameCollection> set_names() const
+ virtual tr1::shared_ptr<const SetNameSet> set_names() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual tr1::shared_ptr<SetSpecTree::ConstItem> set(const SetName & id) const;
- virtual tr1::shared_ptr<const DestinationsCollection> default_destinations() const
+ virtual tr1::shared_ptr<const DestinationsSet> default_destinations() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual HookResult perform_hook(const Hook &) const
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index 2fd3819..b7e200d 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -18,10 +18,11 @@
*/
#include "no_config_environment.hh"
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/log.hh>
#include <paludis/util/dir_iterator.hh>
+#include <paludis/util/map.hh>
+#include <paludis/util/set.hh>
#include <paludis/repositories/repository_maker.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/config_file.hh>
@@ -30,6 +31,7 @@
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <set>
+#include <list>
using namespace paludis;
using namespace paludis::no_config_environment;
@@ -139,8 +141,8 @@ Implementation<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
{
if (FSEntry("/var/empty") != params.master_repository_dir)
{
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("location", stringify(params.master_repository_dir));
@@ -152,8 +154,8 @@ Implementation<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
RepositoryMaker::get_instance()->find_maker("ebuild")(env, keys))));
}
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("location", stringify(params.repository_dir));
@@ -168,14 +170,14 @@ Implementation<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
if (DistributionData::get_instance()->distribution_from_string(env->default_distribution())->support_old_style_virtuals)
package_database->add_repository(-2, RepositoryMaker::get_instance()->find_maker("virtuals")(env,
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> >()));
+ tr1::shared_ptr<Map<std::string, std::string> >()));
}
else
{
Log::get_instance()->message(ll_debug, lc_context, "VDB, using vdb_db");
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
@@ -184,8 +186,8 @@ Implementation<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
package_database->add_repository(1, RepositoryMaker::get_instance()->find_maker("vdb")(env, keys));
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > iv_keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > iv_keys(
+ new Map<std::string, std::string>);
iv_keys->insert("root", "/");
if (DistributionData::get_instance()->distribution_from_string(env->default_distribution())->support_old_style_virtuals)
@@ -276,7 +278,7 @@ NoConfigEnvironment::set_paludis_command(const std::string & s)
}
bool
-NoConfigEnvironment::accept_keywords(tr1::shared_ptr<const KeywordNameCollection> keywords,
+NoConfigEnvironment::accept_keywords(tr1::shared_ptr<const KeywordNameSet> keywords,
const PackageID &) const
{
if (_imp->is_vdb)
@@ -299,7 +301,7 @@ NoConfigEnvironment::accept_keywords(tr1::shared_ptr<const KeywordNameCollection
WhitespaceTokeniser::get_instance()->tokenise(ak,
create_inserter<KeywordName>(std::back_inserter(accepted)));
- for (KeywordNameCollection::Iterator k(keywords->begin()), k_end(keywords->end()) ;
+ for (KeywordNameSet::Iterator k(keywords->begin()), k_end(keywords->end()) ;
k != k_end ; ++k)
{
if (accepted.end() != std::find(accepted.begin(), accepted.end(), *k))
diff --git a/paludis/environments/no_config/no_config_environment.hh b/paludis/environments/no_config/no_config_environment.hh
index a0d118d..868f0c8 100644
--- a/paludis/environments/no_config/no_config_environment.hh
+++ b/paludis/environments/no_config/no_config_environment.hh
@@ -58,7 +58,7 @@ namespace paludis
private InstantiationPolicy<NoConfigEnvironment, instantiation_method::NonCopyableTag>
{
protected:
- virtual bool accept_keywords(tr1::shared_ptr<const KeywordNameCollection>, const PackageID &) const
+ virtual bool accept_keywords(tr1::shared_ptr<const KeywordNameSet>, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
public:
diff --git a/paludis/environments/paludis/keywords_conf.cc b/paludis/environments/paludis/keywords_conf.cc
index a51279d..d2030cf 100644
--- a/paludis/environments/paludis/keywords_conf.cc
+++ b/paludis/environments/paludis/keywords_conf.cc
@@ -30,6 +30,7 @@
#include <paludis/util/log.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/set.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <list>
@@ -129,7 +130,7 @@ KeywordsConf::add(const FSEntry & filename)
}
bool
-KeywordsConf::query(tr1::shared_ptr<const KeywordNameCollection> k, const PackageID & e) const
+KeywordsConf::query(tr1::shared_ptr<const KeywordNameSet> k, const PackageID & e) const
{
static const KeywordName star_keyword("*");
static const KeywordName minus_star_keyword("-*");
diff --git a/paludis/environments/paludis/keywords_conf.hh b/paludis/environments/paludis/keywords_conf.hh
index e420dee..4e90022 100644
--- a/paludis/environments/paludis/keywords_conf.hh
+++ b/paludis/environments/paludis/keywords_conf.hh
@@ -59,7 +59,7 @@ namespace paludis
/**
* Query a collection of keywords.
*/
- bool query(tr1::shared_ptr<const KeywordNameCollection>, const PackageID &) const;
+ bool query(tr1::shared_ptr<const KeywordNameSet>, const PackageID &) const;
};
}
}
diff --git a/paludis/environments/paludis/mirrors_conf.cc b/paludis/environments/paludis/mirrors_conf.cc
index f0b7b98..06db653 100644
--- a/paludis/environments/paludis/mirrors_conf.cc
+++ b/paludis/environments/paludis/mirrors_conf.cc
@@ -26,8 +26,8 @@
#include <paludis/util/log.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/sequence.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <vector>
@@ -85,12 +85,12 @@ MirrorsConf::add(const FSEntry & filename)
}
}
-tr1::shared_ptr<const MirrorsCollection>
+tr1::shared_ptr<const MirrorsSequence>
MirrorsConf::query(const std::string & m) const
{
- tr1::shared_ptr<MirrorsCollection> result(new MirrorsCollection::Concrete);
+ tr1::shared_ptr<MirrorsSequence> result(new MirrorsSequence);
std::pair<Mirrors::const_iterator, Mirrors::const_iterator> p(_imp->mirrors.equal_range(m));
- std::copy(p.first, p.second, transform_inserter(result->inserter(),
+ std::copy(p.first, p.second, transform_inserter(result->back_inserter(),
paludis::tr1::mem_fn(&std::pair<const std::string, std::string>::second)));
return result;
}
diff --git a/paludis/environments/paludis/mirrors_conf.hh b/paludis/environments/paludis/mirrors_conf.hh
index 71a8316..1e894de 100644
--- a/paludis/environments/paludis/mirrors_conf.hh
+++ b/paludis/environments/paludis/mirrors_conf.hh
@@ -59,7 +59,7 @@ namespace paludis
/**
* Query a mirror.
*/
- tr1::shared_ptr<const MirrorsCollection> query(const std::string &) const
+ tr1::shared_ptr<const MirrorsSequence> query(const std::string &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
diff --git a/paludis/environments/paludis/paludis_config.cc b/paludis/environments/paludis/paludis_config.cc
index f7bdf49..eafa232 100644
--- a/paludis/environments/paludis/paludis_config.cc
+++ b/paludis/environments/paludis/paludis_config.cc
@@ -27,7 +27,6 @@
#include <paludis/config_file.hh>
#include <paludis/distribution.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/destringify.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/iterator.hh>
@@ -37,6 +36,9 @@
#include <paludis/util/pstream.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/sr.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/map.hh>
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
@@ -86,7 +88,7 @@ namespace paludis
std::string root;
std::string config_dir;
mutable std::string distribution;
- tr1::shared_ptr<FSEntryCollection> bashrc_files;
+ tr1::shared_ptr<FSEntrySequence> bashrc_files;
std::list<RepositoryConfigEntry> repos;
@@ -113,7 +115,7 @@ namespace paludis
env(e),
paludis_command("paludis"),
config_dir("(unset)"),
- bashrc_files(new FSEntryCollection::Concrete),
+ bashrc_files(new FSEntrySequence),
keywords_conf(new KeywordsConf(e)),
use_conf(new UseConf(e)),
licenses_conf(new LicensesConf(e)),
@@ -258,8 +260,8 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
}
}
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > conf_vars(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > conf_vars(
+ new Map<std::string, std::string>);
conf_vars->insert("ROOT", root_prefix);
Log::get_instance()->message(ll_debug, lc_no_context, "PaludisConfig real directory is '"
@@ -272,13 +274,13 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
if (DistributionData::get_instance()->distribution_from_string(e->default_distribution())->support_old_style_virtuals)
{
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > iv_keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > iv_keys(
+ new Map<std::string, std::string>);
iv_keys->insert("root", root_prefix.empty() ? "/" : root_prefix);
_imp->repos.push_back(RepositoryConfigEntry("installed_virtuals", -1, iv_keys));
_imp->repos.push_back(RepositoryConfigEntry("virtuals", -2,
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> >()));
+ tr1::shared_ptr<Map<std::string, std::string> >()));
}
/* add normal repositories */
@@ -316,7 +318,7 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
filter_inserter(std::back_inserter(repo_files), tr1::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
- std::list<tr1::shared_ptr<AssociativeCollection<std::string, std::string> > > later_keys;
+ std::list<tr1::shared_ptr<Map<std::string, std::string> > > later_keys;
for (std::list<FSEntry>::const_iterator repo_file(repo_files.begin()), repo_file_end(repo_files.end()) ;
repo_file != repo_file_end ; ++repo_file)
{
@@ -353,8 +355,8 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
if (! kv->get("importance").empty())
importance = destringify<int>(kv->get("importance"));
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete(kv->begin(), kv->end()));
+ tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::copy(kv->begin(), kv->end(), keys->inserter());
keys->erase("importance");
keys->insert("importance", stringify(importance));
@@ -378,7 +380,7 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
}
}
- for (std::list<tr1::shared_ptr<AssociativeCollection<std::string, std::string> > >::const_iterator
+ for (std::list<tr1::shared_ptr<Map<std::string, std::string> > >::const_iterator
k(later_keys.begin()), k_end(later_keys.end()) ; k != k_end ; ++k)
_imp->repos.push_back(RepositoryConfigEntry((*k)->find("format")->second,
destringify<int>((*k)->find("importance")->second), *k));
@@ -544,7 +546,7 @@ PaludisConfig::~PaludisConfig()
{
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
PaludisConfig::bashrc_files() const
{
return _imp->bashrc_files;
diff --git a/paludis/environments/paludis/paludis_config.hh b/paludis/environments/paludis/paludis_config.hh
index a417dac..4d62ca2 100644
--- a/paludis/environments/paludis/paludis_config.hh
+++ b/paludis/environments/paludis/paludis_config.hh
@@ -22,10 +22,11 @@
#include <paludis/dep_spec.hh>
#include <paludis/name.hh>
-#include <paludis/util/collection.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/sr.hh>
+#include <paludis/util/sequence-fwd.hh>
+#include <paludis/util/map-fwd.hh>
#include <paludis/environments/environment_maker.hh>
#include <string>
@@ -134,7 +135,7 @@ namespace paludis
/**
* Our bashrc files.
*/
- tr1::shared_ptr<const FSEntryCollection> bashrc_files() const;
+ tr1::shared_ptr<const FSEntrySequence> bashrc_files() const;
/**
* The ROOT.
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index 3b02aa3..67f9314 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -35,7 +35,6 @@
#include <paludis/dep_tag.hh>
#include <paludis/package_id.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/log.hh>
#include <paludis/util/system.hh>
#include <paludis/util/dir_iterator.hh>
@@ -44,6 +43,9 @@
#include <paludis/util/save.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/map.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <functional>
@@ -127,7 +129,7 @@ PaludisEnvironment::PaludisEnvironment(const std::string & s) :
if (Log::get_instance()->log_level() <= ll_debug)
{
if (r->keys)
- for (AssociativeCollection<std::string, std::string>::Iterator
+ for (Map<std::string, std::string>::Iterator
i(r->keys->begin()), i_end(r->keys->end()) ; i != i_end ; ++i)
{
if (! keys.empty())
@@ -224,7 +226,7 @@ PaludisEnvironment::accept_breaks_portage(const PackageID &) const
}
bool
-PaludisEnvironment::accept_keywords(tr1::shared_ptr<const KeywordNameCollection> k,
+PaludisEnvironment::accept_keywords(tr1::shared_ptr<const KeywordNameSet> k,
const PackageID & e) const
{
return _imp->config->keywords_conf()->query(k, e);
@@ -255,7 +257,7 @@ PaludisEnvironment::unmasked_by_user(const PackageID & d) const
return _imp->config->package_unmask_conf()->query(d);
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
PaludisEnvironment::bashrc_files() const
{
return _imp->config->bashrc_files();
@@ -288,45 +290,45 @@ PaludisEnvironment::perform_hook(const Hook & hook) const
return _imp->hooker->perform_hook(hook);
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
PaludisEnvironment::hook_dirs() const
{
_imp->need_hook_dirs(_imp->config->config_dir());
- tr1::shared_ptr<FSEntryCollection> result(new FSEntryCollection::Concrete);
+ tr1::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
std::copy(_imp->hook_dirs.begin(), _imp->hook_dirs.end(),
- transform_inserter(result->inserter(), tr1::mem_fn(&std::pair<FSEntry, bool>::first)));
+ transform_inserter(result->back_inserter(), tr1::mem_fn(&std::pair<FSEntry, bool>::first)));
return result;
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
PaludisEnvironment::fetchers_dirs() const
{
- tr1::shared_ptr<FSEntryCollection> result(new FSEntryCollection::Concrete);
+ tr1::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
result->push_back(FSEntry(_imp->config->config_dir()) / "fetchers");
if (getenv_with_default("PALUDIS_NO_GLOBAL_FETCHERS", "").empty())
{
- tr1::shared_ptr<const FSEntryCollection> r(EnvironmentImplementation::fetchers_dirs());
- std::copy(r->begin(), r->end(), result->inserter());
+ tr1::shared_ptr<const FSEntrySequence> r(EnvironmentImplementation::fetchers_dirs());
+ std::copy(r->begin(), r->end(), result->back_inserter());
}
return result;
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
PaludisEnvironment::syncers_dirs() const
{
- tr1::shared_ptr<FSEntryCollection> result(new FSEntryCollection::Concrete);
+ tr1::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
result->push_back(FSEntry(_imp->config->config_dir()) / "syncers");
if (getenv_with_default("PALUDIS_NO_GLOBAL_SYNCERS", "").empty())
{
- tr1::shared_ptr<const FSEntryCollection> r(EnvironmentImplementation::syncers_dirs());
- std::copy(r->begin(), r->end(), result->inserter());
+ tr1::shared_ptr<const FSEntrySequence> r(EnvironmentImplementation::syncers_dirs());
+ std::copy(r->begin(), r->end(), result->back_inserter());
}
return result;
@@ -364,10 +366,10 @@ PaludisEnvironment::local_set(const SetName & s) const
return tr1::shared_ptr<SetSpecTree::ConstItem>();
}
-tr1::shared_ptr<const SetNameCollection>
+tr1::shared_ptr<const SetNameSet>
PaludisEnvironment::set_names() const
{
- tr1::shared_ptr<SetNameCollection> result(new SetNameCollection::Concrete);
+ tr1::shared_ptr<SetNameSet> result(new SetNameSet);
if ((FSEntry(_imp->config->config_dir()) / "sets").exists())
for (DirIterator d(FSEntry(_imp->config->config_dir()) / "sets"), d_end ;
@@ -382,13 +384,13 @@ PaludisEnvironment::set_names() const
return result;
}
-tr1::shared_ptr<const MirrorsCollection>
+tr1::shared_ptr<const MirrorsSequence>
PaludisEnvironment::mirrors(const std::string & m) const
{
return _imp->config->mirrors_conf()->query(m);
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
PaludisEnvironment::known_use_expand_names(const UseFlagName & prefix, const PackageID & e) const
{
return _imp->config->use_conf()->known_use_expand_names(prefix, e);
diff --git a/paludis/environments/paludis/paludis_environment.hh b/paludis/environments/paludis/paludis_environment.hh
index e6b6458..6850acb 100644
--- a/paludis/environments/paludis/paludis_environment.hh
+++ b/paludis/environments/paludis/paludis_environment.hh
@@ -50,7 +50,7 @@ namespace paludis
private PrivateImplementationPattern<PaludisEnvironment>
{
protected:
- virtual bool accept_keywords(tr1::shared_ptr<const KeywordNameCollection>, const PackageID &) const
+ virtual bool accept_keywords(tr1::shared_ptr<const KeywordNameSet>, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool accept_license(const std::string &, const PackageID &) const
@@ -90,20 +90,20 @@ namespace paludis
virtual bool query_use(const UseFlagName &, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const UseFlagNameCollection> known_use_expand_names(
+ virtual tr1::shared_ptr<const UseFlagNameSet> known_use_expand_names(
const UseFlagName &, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> bashrc_files() const
+ virtual tr1::shared_ptr<const FSEntrySequence> bashrc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> syncers_dirs() const
+ virtual tr1::shared_ptr<const FSEntrySequence> syncers_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> fetchers_dirs() const
+ virtual tr1::shared_ptr<const FSEntrySequence> fetchers_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> hook_dirs() const
+ virtual tr1::shared_ptr<const FSEntrySequence> hook_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const FSEntry root() const
@@ -115,10 +115,10 @@ namespace paludis
virtual gid_t reduced_gid() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const MirrorsCollection> mirrors(const std::string &) const
+ virtual tr1::shared_ptr<const MirrorsSequence> mirrors(const std::string &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const SetNameCollection> set_names() const
+ virtual tr1::shared_ptr<const SetNameSet> set_names() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual HookResult perform_hook(const Hook &) const
diff --git a/paludis/environments/paludis/repository_config_entry.sr b/paludis/environments/paludis/repository_config_entry.sr
index 24972c7..52422fa 100644
--- a/paludis/environments/paludis/repository_config_entry.sr
+++ b/paludis/environments/paludis/repository_config_entry.sr
@@ -5,7 +5,7 @@ make_class_RepositoryConfigEntry()
{
key format std::string
key importance int
- key keys "tr1::shared_ptr<AssociativeCollection<std::string, std::string> >"
+ key keys "tr1::shared_ptr<Map<std::string, std::string> >"
doxygen_comment << "END"
/**
diff --git a/paludis/environments/paludis/use_conf.cc b/paludis/environments/paludis/use_conf.cc
index a335c76..24197df 100644
--- a/paludis/environments/paludis/use_conf.cc
+++ b/paludis/environments/paludis/use_conf.cc
@@ -32,7 +32,7 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/strip.hh>
-#include <paludis/util/collection_concrete.hh>
+#include <paludis/util/set.hh>
#include <list>
#include <vector>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
@@ -199,8 +199,8 @@ UseConf::query(const UseFlagName & f, const PackageID & e) const
bool ignore_empty_minus_star(false);
if (e.repository()->use_interface)
{
- tr1::shared_ptr<const UseFlagNameCollection> prefixes(e.repository()->use_interface->use_expand_prefixes());
- for (UseFlagNameCollection::Iterator p(prefixes->begin()), p_end(prefixes->end()) ;
+ tr1::shared_ptr<const UseFlagNameSet> prefixes(e.repository()->use_interface->use_expand_prefixes());
+ for (UseFlagNameSet::Iterator p(prefixes->begin()), p_end(prefixes->end()) ;
p != p_end ; ++p)
if (0 == p->data().compare(0, p->data().length(), stringify(f), 0, p->data().length()))
{
@@ -310,12 +310,12 @@ UseConf::query(const UseFlagName & f, const PackageID & e) const
return result;
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
UseConf::known_use_expand_names(const UseFlagName & prefix, const PackageID & e) const
{
Context context("When loading known use expand names for prefix '" + stringify(prefix) + ":");
- tr1::shared_ptr<UseFlagNameCollection> result(new UseFlagNameCollection::Concrete);
+ tr1::shared_ptr<UseFlagNameSet> result(new UseFlagNameSet);
std::string prefix_lower;
std::transform(prefix.data().begin(), prefix.data().end(), std::back_inserter(prefix_lower), &::tolower);
prefix_lower.append("_");
diff --git a/paludis/environments/paludis/use_conf.hh b/paludis/environments/paludis/use_conf.hh
index 0915ecd..b17c5c1 100644
--- a/paludis/environments/paludis/use_conf.hh
+++ b/paludis/environments/paludis/use_conf.hh
@@ -65,7 +65,7 @@ namespace paludis
/**
* Fetch the known use expand names for a prefix.
*/
- tr1::shared_ptr<const UseFlagNameCollection> known_use_expand_names(
+ tr1::shared_ptr<const UseFlagNameSet> known_use_expand_names(
const UseFlagName &, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
};
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index b0b2e25..165e86c 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -23,10 +23,12 @@
#include <paludis/util/system.hh>
#include <paludis/util/save.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/strip.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/map.hh>
#include <paludis/repositories/repository_maker.hh>
#include <paludis/config_file.hh>
#include <paludis/hooker.hh>
@@ -42,6 +44,7 @@
#include <set>
#include <map>
#include <vector>
+#include <list>
using namespace paludis;
using namespace paludis::portage_environment;
@@ -341,8 +344,8 @@ PortageEnvironment::_load_profile(const FSEntry & d)
void
PortageEnvironment::_add_virtuals_repository()
{
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
package_database()->add_repository(-2,
RepositoryMaker::get_instance()->find_maker("virtuals")(this, keys));
}
@@ -350,8 +353,8 @@ PortageEnvironment::_add_virtuals_repository()
void
PortageEnvironment::_add_installed_virtuals_repository()
{
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("root", stringify(root()));
package_database()->add_repository(-1,
RepositoryMaker::get_instance()->find_maker("installed_virtuals")(this, keys));
@@ -368,8 +371,8 @@ void
PortageEnvironment::_add_ebuild_repository(const FSEntry & portdir, const std::string & master,
const std::string & sync, int importance)
{
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("root", stringify(root()));
keys->insert("location", stringify(portdir));
keys->insert("profiles", stringify((_imp->conf_dir / "make.profile").realpath()) + " " +
@@ -401,8 +404,8 @@ PortageEnvironment::_add_vdb_repository()
{
Context context("When creating vdb repository:");
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("root", stringify(root()));
keys->insert("location", stringify(root() / "/var/db/pkg"));
keys->insert("format", "vdb");
@@ -498,7 +501,7 @@ PortageEnvironment::set_paludis_command(const std::string & s)
}
bool
-PortageEnvironment::accept_keywords(tr1::shared_ptr <const KeywordNameCollection> keywords,
+PortageEnvironment::accept_keywords(tr1::shared_ptr <const KeywordNameSet> keywords,
const PackageID & d) const
{
bool result(false);
@@ -506,7 +509,7 @@ PortageEnvironment::accept_keywords(tr1::shared_ptr <const KeywordNameCollection
if (keywords->end() != keywords->find(KeywordName("*")))
return true;
- for (KeywordNameCollection::Iterator k(keywords->begin()), k_end(keywords->end()) ;
+ for (KeywordNameSet::Iterator k(keywords->begin()), k_end(keywords->end()) ;
k != k_end ; ++k)
{
bool local_result(false);
@@ -567,13 +570,13 @@ PortageEnvironment::unmasked_by_user(const PackageID & e) const
return false;
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
PortageEnvironment::known_use_expand_names(const UseFlagName & prefix,
const PackageID & pde) const
{
Context context("When loading known use expand names for prefix '" + stringify(prefix) + ":");
- tr1::shared_ptr<UseFlagNameCollection> result(new UseFlagNameCollection::Concrete);
+ tr1::shared_ptr<UseFlagNameSet> result(new UseFlagNameSet);
std::string prefix_lower;
std::transform(prefix.data().begin(), prefix.data().end(), std::back_inserter(prefix_lower), &::tolower);
prefix_lower.append("_");
@@ -615,19 +618,19 @@ PortageEnvironment::perform_hook(const Hook & hook) const
return _imp->hooker->perform_hook(hook);
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
PortageEnvironment::hook_dirs() const
{
_imp->need_hook_dirs();
- tr1::shared_ptr<FSEntryCollection> result(new FSEntryCollection::Concrete);
- std::copy(_imp->hook_dirs.begin(), _imp->hook_dirs.end(), result->inserter());
+ tr1::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
+ std::copy(_imp->hook_dirs.begin(), _imp->hook_dirs.end(), result->back_inserter());
return result;
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
PortageEnvironment::bashrc_files() const
{
- tr1::shared_ptr<FSEntryCollection> result(new FSEntryCollection::Concrete);
+ tr1::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
result->push_back(_imp->conf_dir / "make.globals");
result->push_back(_imp->conf_dir / "make.conf");
result->push_back(FSEntry(LIBEXECDIR) / "paludis" / "environments" / "portage" / "bashrc");
@@ -652,13 +655,13 @@ PortageEnvironment::package_database() const
return _imp->package_database;
}
-tr1::shared_ptr<const MirrorsCollection>
+tr1::shared_ptr<const MirrorsSequence>
PortageEnvironment::mirrors(const std::string & m) const
{
std::pair<std::multimap<std::string, std::string>::const_iterator, std::multimap<std::string, std::string>::const_iterator>
p(_imp->mirrors.equal_range(m));
- tr1::shared_ptr<MirrorsCollection> result(new MirrorsCollection::Concrete);
- std::copy(p.first, p.second, transform_inserter(result->inserter(),
+ tr1::shared_ptr<MirrorsSequence> result(new MirrorsSequence);
+ std::copy(p.first, p.second, transform_inserter(result->back_inserter(),
tr1::mem_fn(&std::pair<const std::string, std::string>::second)));
return result;
}
diff --git a/paludis/environments/portage/portage_environment.hh b/paludis/environments/portage/portage_environment.hh
index 8660cd7..a747815 100644
--- a/paludis/environments/portage/portage_environment.hh
+++ b/paludis/environments/portage/portage_environment.hh
@@ -74,7 +74,7 @@ namespace paludis
void _load_atom_file(const FSEntry &, I_, const std::string &);
protected:
- virtual bool accept_keywords(tr1::shared_ptr<const KeywordNameCollection>, const PackageID &) const
+ virtual bool accept_keywords(tr1::shared_ptr<const KeywordNameSet>, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool accept_breaks_portage(const PackageID &) const
@@ -98,20 +98,20 @@ namespace paludis
virtual bool query_use(const UseFlagName &, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const UseFlagNameCollection> known_use_expand_names(
+ virtual tr1::shared_ptr<const UseFlagNameSet> known_use_expand_names(
const UseFlagName &, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> bashrc_files() const
+ virtual tr1::shared_ptr<const FSEntrySequence> bashrc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> hook_dirs() const
+ virtual tr1::shared_ptr<const FSEntrySequence> hook_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const FSEntry root() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const MirrorsCollection> mirrors(const std::string &) const
+ virtual tr1::shared_ptr<const MirrorsSequence> mirrors(const std::string &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual HookResult perform_hook(const Hook &) const
diff --git a/paludis/environments/portage/portage_environment_TEST.cc b/paludis/environments/portage/portage_environment_TEST.cc
index 8ac52ba..19706ec 100644
--- a/paludis/environments/portage/portage_environment_TEST.cc
+++ b/paludis/environments/portage/portage_environment_TEST.cc
@@ -20,7 +20,6 @@
#include "portage_environment.hh"
#include <test/test_runner.hh>
#include <test/test_framework.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/join.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
diff --git a/paludis/environments/test/test_environment.cc b/paludis/environments/test/test_environment.cc
index b4b6ba4..4adc7ab 100644
--- a/paludis/environments/test/test_environment.cc
+++ b/paludis/environments/test/test_environment.cc
@@ -19,8 +19,9 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/package_database.hh>
#include <paludis/package_id.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
@@ -61,7 +62,7 @@ TestEnvironment::query_use(const UseFlagName & u, const PackageID &) const
}
bool
-TestEnvironment::accept_keywords(tr1::shared_ptr<const KeywordNameCollection> k, const PackageID &) const
+TestEnvironment::accept_keywords(tr1::shared_ptr<const KeywordNameSet> k, const PackageID &) const
{
return k->end() != k->find(KeywordName("test")) || k->end() != k->find(KeywordName("*"));
}
diff --git a/paludis/environments/test/test_environment.hh b/paludis/environments/test/test_environment.hh
index b40833a..989a986 100644
--- a/paludis/environments/test/test_environment.hh
+++ b/paludis/environments/test/test_environment.hh
@@ -44,7 +44,7 @@ namespace paludis
public EnvironmentImplementation
{
protected:
- virtual bool accept_keywords(tr1::shared_ptr<const KeywordNameCollection>, const PackageID &) const
+ virtual bool accept_keywords(tr1::shared_ptr<const KeywordNameSet>, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
public:
diff --git a/paludis/hooker.cc b/paludis/hooker.cc
index 88171c9..498999a 100644
--- a/paludis/hooker.cc
+++ b/paludis/hooker.cc
@@ -23,7 +23,6 @@
#include <paludis/hook.hh>
#include <paludis/hashed_containers.hh>
#include <paludis/package_database.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/log.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/fs_entry.hh>
diff --git a/paludis/metadata_key-fwd.hh b/paludis/metadata_key-fwd.hh
index d0562a2..73b1ff0 100644
--- a/paludis/metadata_key-fwd.hh
+++ b/paludis/metadata_key-fwd.hh
@@ -32,7 +32,7 @@ namespace paludis
class MetadataStringKey;
class MetadataContentsKey;
class MetadataTimeKey;
- template <typename C_> class MetadataCollectionKey;
+ template <typename C_> class MetadataSetKey;
template <typename C_> class MetadataSpecTreeKey;
#include <paludis/metadata_key-se.hh>
diff --git a/paludis/metadata_key.cc b/paludis/metadata_key.cc
index c00de6c..4356c3b 100644
--- a/paludis/metadata_key.cc
+++ b/paludis/metadata_key.cc
@@ -93,7 +93,7 @@ MetadataPackageIDKey::MetadataPackageIDKey(const std::string & r, const std::str
}
template <typename C_>
-MetadataCollectionKey<C_>::MetadataCollectionKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
+MetadataSetKey<C_>::MetadataSetKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
MetadataKey(r, h, t)
{
}
@@ -104,10 +104,10 @@ MetadataSpecTreeKey<C_>::MetadataSpecTreeKey(const std::string & r, const std::s
{
}
-template class MetadataCollectionKey<KeywordNameCollection>;
-template class MetadataCollectionKey<IUseFlagCollection>;
-template class MetadataCollectionKey<InheritedCollection>;
-template class MetadataCollectionKey<UseFlagNameCollection>;
+template class MetadataSetKey<KeywordNameSet>;
+template class MetadataSetKey<IUseFlagSet>;
+template class MetadataSetKey<InheritedSet>;
+template class MetadataSetKey<UseFlagNameSet>;
template class MetadataSpecTreeKey<LicenseSpecTree>;
template class MetadataSpecTreeKey<ProvideSpecTree>;
diff --git a/paludis/metadata_key.hh b/paludis/metadata_key.hh
index bbd96fb..be61510 100644
--- a/paludis/metadata_key.hh
+++ b/paludis/metadata_key.hh
@@ -39,10 +39,10 @@ namespace paludis
MetadataKeyVisitorTypes,
MetadataKey,
MetadataPackageIDKey,
- MetadataCollectionKey<UseFlagNameCollection>,
- MetadataCollectionKey<IUseFlagCollection>,
- MetadataCollectionKey<KeywordNameCollection>,
- MetadataCollectionKey<InheritedCollection>,
+ MetadataSetKey<UseFlagNameSet>,
+ MetadataSetKey<IUseFlagSet>,
+ MetadataSetKey<KeywordNameSet>,
+ MetadataSetKey<InheritedSet>,
MetadataSpecTreeKey<DependencySpecTree>,
MetadataSpecTreeKey<LicenseSpecTree>,
MetadataSpecTreeKey<URISpecTree>,
@@ -120,12 +120,12 @@ namespace paludis
};
template <typename C_>
- class PALUDIS_VISIBLE MetadataCollectionKey :
+ class PALUDIS_VISIBLE MetadataSetKey :
public MetadataKey,
- public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataCollectionKey<C_> >
+ public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataSetKey<C_> >
{
protected:
- MetadataCollectionKey(const std::string &, const std::string &, const MetadataKeyType);
+ MetadataSetKey(const std::string &, const std::string &, const MetadataKeyType);
public:
virtual const tr1::shared_ptr<const C_> value() const
diff --git a/paludis/name-fwd.hh b/paludis/name-fwd.hh
index 974bd69..e42b30b 100644
--- a/paludis/name-fwd.hh
+++ b/paludis/name-fwd.hh
@@ -21,7 +21,8 @@
#define PALUDIS_GUARD_PALUDIS_NAME_FWD_HH 1
#include <paludis/util/validated-fwd.hh>
-#include <paludis/util/collection-fwd.hh>
+#include <paludis/util/set-fwd.hh>
+#include <paludis/util/sequence-fwd.hh>
#include <paludis/util/attributes.hh>
#include <string>
@@ -43,7 +44,7 @@ namespace paludis
*
* \ingroup grpnames
*/
- typedef SortedCollection<PackageNamePart> PackageNamePartCollection;
+ typedef Set<PackageNamePart> PackageNamePartSet;
class CategoryNamePartError;
class CategoryNamePartValidator;
@@ -61,7 +62,7 @@ namespace paludis
*
* \ingroup grpnames
*/
- typedef SortedCollection<CategoryNamePart> CategoryNamePartCollection;
+ typedef Set<CategoryNamePart> CategoryNamePartSet;
class UseFlagNameError;
class IUseFlagNameError;
@@ -79,7 +80,7 @@ namespace paludis
*
* \ingroup grpnames
*/
- typedef SortedCollection<UseFlagName> UseFlagNameCollection;
+ typedef Set<UseFlagName> UseFlagNameSet;
#include <paludis/name-se.hh>
@@ -105,7 +106,7 @@ namespace paludis
*
* \ingroup grpnames
*/
- typedef SortedCollection<QualifiedPackageName> QualifiedPackageNameCollection;
+ typedef Set<QualifiedPackageName> QualifiedPackageNameSet;
class QualifiedPackageNameError;
@@ -138,7 +139,7 @@ namespace paludis
*
* \ingroup grpnames
*/
- typedef SequentialCollection<RepositoryName> RepositoryNameCollection;
+ typedef Sequence<RepositoryName> RepositoryNameSequence;
class RepositoryNameComparator;
@@ -157,7 +158,7 @@ namespace paludis
*
* \ingroup grpnames
*/
- typedef SortedCollection<KeywordName> KeywordNameCollection;
+ typedef Set<KeywordName> KeywordNameSet;
class SetNameValidator;
class SetNameError;
@@ -174,21 +175,21 @@ namespace paludis
*
* \ingroup grpnames
*/
- typedef SortedCollection<SetName> SetNameCollection;
+ typedef Set<SetName> SetNameSet;
/**
* A collection of use flags.
*
* \ingroup grpnames
*/
- typedef SortedCollection<IUseFlag> IUseFlagCollection;
+ typedef Set<IUseFlag> IUseFlagSet;
/**
* A collection of inherited packages.
*
* \ingroup grpnames
*/
- typedef SortedCollection<std::string> InheritedCollection;
+ typedef Set<std::string> InheritedSet;
}
#endif
diff --git a/paludis/name.cc b/paludis/name.cc
index 2119148..222a2c3 100644
--- a/paludis/name.cc
+++ b/paludis/name.cc
@@ -21,6 +21,8 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/operators.hh>
#include <paludis/util/log.hh>
+#include <paludis/util/sequence-impl.hh>
+#include <paludis/util/set-impl.hh>
#include <ostream>
#include <utility>
@@ -35,6 +37,16 @@ using namespace paludis;
#include <paludis/name-sr.cc>
#include <paludis/name-se.cc>
+template struct Sequence<RepositoryName>;
+template struct Set<PackageNamePart>;
+template struct Set<CategoryNamePart>;
+template struct Set<UseFlagName>;
+template struct Set<QualifiedPackageName>;
+template struct Set<KeywordName>;
+template struct Set<SetName>;
+template struct Set<IUseFlag>;
+template struct Set<std::string>;
+
QualifiedPackageNameError::QualifiedPackageNameError(const std::string & s) throw () :
NameError(s, "qualified package name")
{
diff --git a/paludis/name.hh b/paludis/name.hh
index 2ca603e..8232a2b 100644
--- a/paludis/name.hh
+++ b/paludis/name.hh
@@ -21,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_NAME_HH 1
#include <paludis/name-fwd.hh>
-#include <paludis/util/collection.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/sr.hh>
diff --git a/paludis/package_database.cc b/paludis/package_database.cc
index c8425c3..a95c082 100644
--- a/paludis/package_database.cc
+++ b/paludis/package_database.cc
@@ -24,7 +24,11 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/join.hh>
-#include <paludis/util/collection_concrete.hh>
+#include <paludis/util/iterator.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/sequence-impl.hh>
+#include <paludis/util/tr1_functional.hh>
#include <paludis/query.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
@@ -214,15 +218,15 @@ PackageDatabase::fetch_unique_qualified_package_name(
{
Context context("When disambiguating package name '" + stringify(p) + "':");
- tr1::shared_ptr<QualifiedPackageNameCollection> result(new QualifiedPackageNameCollection::Concrete);
+ tr1::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
for (IndirectIterator<RepositoryIterator> r(begin_repositories()), r_end(end_repositories()) ;
r != r_end ; ++r)
{
Context local_context("When looking in repository '" + stringify(r->name()) + "':");
- tr1::shared_ptr<const CategoryNamePartCollection> cats(r->category_names_containing_package(p));
- for (CategoryNamePartCollection::Iterator c(cats->begin()), c_end(cats->end()) ;
+ tr1::shared_ptr<const CategoryNamePartSet> cats(r->category_names_containing_package(p));
+ for (CategoryNamePartSet::Iterator c(cats->begin()), c_end(cats->end()) ;
c != c_end ; ++c)
result->insert(*c + p);
}
@@ -235,107 +239,17 @@ PackageDatabase::fetch_unique_qualified_package_name(
return *(result->begin());
}
-namespace
-{
- bool compare_name(const tr1::shared_ptr<const PackageID> & a,
- const tr1::shared_ptr<const PackageID> & b)
- {
- return a->name() == b->name();
- }
-
- bool compare_name_slot(const tr1::shared_ptr<const PackageID> & a,
- const tr1::shared_ptr<const PackageID> & b)
- {
- if (a->name() != b->name())
- return false;
-
- return a->slot() == b->slot();
- }
-
- struct PDEComparator
- {
- const PackageDatabase * const pde;
- std::map<std::string, int> rank;
-
- PDEComparator(const PackageDatabase * const p) :
- pde(p)
- {
- int x(0);
- for (PackageDatabase::RepositoryIterator r(pde->begin_repositories()), r_end(pde->end_repositories()) ;
- r != r_end ; ++r)
- rank.insert(std::make_pair(stringify((*r)->name()), ++x));
- }
-
- bool operator() (const tr1::shared_ptr<const PackageID> & lhs,
- const tr1::shared_ptr<const PackageID> & rhs) const
- {
- if (lhs->name() < rhs->name())
- return true;
- if (lhs->name() > rhs->name())
- return false;
-
- if (lhs->version() < rhs->version())
- return true;
- if (lhs->version() > rhs->version())
- return false;
-
- std::map<std::string, int>::const_iterator l(rank.find(stringify(lhs->repository()->name())));
- if (l == rank.end())
- throw InternalError(PALUDIS_HERE, "lhs.repository '" + stringify(lhs->repository()->name()) + "' not in rank");
-
- std::map<std::string, int>::const_iterator r(rank.find(stringify(rhs->repository()->name())));
- if (r == rank.end())
- throw InternalError(PALUDIS_HERE, "rhs.repository '" + stringify(rhs->repository()->name()) + "' not in rank");
-
- if (l->second < r->second)
- return true;
-
- return false;
- }
- };
-
- void sort_package_database_entry_collection(const PackageDatabase * const t,
- PackageIDSequence::Concrete & p)
- {
- if (! p.empty())
- p.sort(PDEComparator(t));
- }
-
- void
- group_package_database_entry_collection(PackageIDSequence::Concrete & p)
- {
- if (p.empty())
- return;
-
- for (std::list<tr1::shared_ptr<const PackageID> >::reverse_iterator r(p.list.rbegin()) ;
- r != p.list.rend() ; ++r)
- {
- for (std::list<tr1::shared_ptr<const PackageID> >::reverse_iterator rr(next(r)) ;
- rr != p.list.rend() ; ++rr)
- {
- if ((*r)->name() != (*rr)->name())
- break;
-
- if ((*r)->slot() != (*rr)->slot())
- continue;
-
- p.list.splice(previous(r.base()), p.list, previous(rr.base()));
- if (p.list.rend() == ((rr = ++r)))
- return;
- }
- }
- }
-}
-
const tr1::shared_ptr<const PackageIDSequence>
PackageDatabase::query(const Query & q, const QueryOrder query_order) const
{
- tr1::shared_ptr<PackageIDSequence::Concrete> result(new PackageIDSequence::Concrete);
+ using namespace tr1::placeholders;
- tr1::shared_ptr<RepositoryNameCollection> repos(q.repositories(*_imp->environment));
+ tr1::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+
+ tr1::shared_ptr<RepositoryNameSequence> repos(q.repositories(*_imp->environment));
if (! repos)
{
- repos.reset(new RepositoryNameCollection::Concrete);
+ repos.reset(new RepositoryNameSequence);
for (RepositoryIterator r(begin_repositories()), r_end(end_repositories()) ;
r != r_end ; ++r)
repos->push_back((*r)->name());
@@ -346,14 +260,14 @@ PackageDatabase::query(const Query & q, const QueryOrder query_order) const
else
return result;
- tr1::shared_ptr<CategoryNamePartCollection> cats(q.categories(*_imp->environment, repos));
+ tr1::shared_ptr<CategoryNamePartSet> cats(q.categories(*_imp->environment, repos));
if (! cats)
{
- cats.reset(new CategoryNamePartCollection::Concrete);
- for (RepositoryNameCollection::Iterator r(repos->begin()), r_end(repos->end()) ;
+ cats.reset(new CategoryNamePartSet);
+ for (RepositoryNameSequence::Iterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
{
- tr1::shared_ptr<const CategoryNamePartCollection> local_cats(fetch_repository(*r)->category_names());
+ tr1::shared_ptr<const CategoryNamePartSet> local_cats(fetch_repository(*r)->category_names());
std::copy(local_cats->begin(), local_cats->end(), cats->inserter());
}
}
@@ -363,16 +277,16 @@ PackageDatabase::query(const Query & q, const QueryOrder query_order) const
else
return result;
- tr1::shared_ptr<QualifiedPackageNameCollection> pkgs(q.packages(*_imp->environment, repos, cats));
+ tr1::shared_ptr<QualifiedPackageNameSet> pkgs(q.packages(*_imp->environment, repos, cats));
if (! pkgs)
{
- pkgs.reset(new QualifiedPackageNameCollection::Concrete);
- for (RepositoryNameCollection::Iterator r(repos->begin()), r_end(repos->end()) ;
+ pkgs.reset(new QualifiedPackageNameSet);
+ for (RepositoryNameSequence::Iterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
- for (CategoryNamePartCollection::Iterator c(cats->begin()), c_end(cats->end()) ;
+ for (CategoryNamePartSet::Iterator c(cats->begin()), c_end(cats->end()) ;
c != c_end ; ++c)
{
- tr1::shared_ptr<const QualifiedPackageNameCollection> local_pkgs(fetch_repository(*r)->package_names(*c));
+ tr1::shared_ptr<const QualifiedPackageNameSet> local_pkgs(fetch_repository(*r)->package_names(*c));
std::copy(local_pkgs->begin(), local_pkgs->end(), pkgs->inserter());
}
}
@@ -385,13 +299,13 @@ PackageDatabase::query(const Query & q, const QueryOrder query_order) const
tr1::shared_ptr<PackageIDSequence> ids(q.ids(*_imp->environment, repos, pkgs));
if (! ids)
{
- for (RepositoryNameCollection::Iterator r(repos->begin()), r_end(repos->end()) ;
+ for (RepositoryNameSequence::Iterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
- for (QualifiedPackageNameCollection::Iterator p(pkgs->begin()), p_end(pkgs->end()) ;
+ for (QualifiedPackageNameSet::Iterator p(pkgs->begin()), p_end(pkgs->end()) ;
p != p_end ; ++p)
{
tr1::shared_ptr<const PackageIDSequence> local_ids(fetch_repository(*r)->package_ids(*p));
- std::copy(local_ids->begin(), local_ids->end(), result->inserter());
+ std::copy(local_ids->begin(), local_ids->end(), result->back_inserter());
}
}
else
@@ -402,7 +316,7 @@ PackageDatabase::query(const Query & q, const QueryOrder query_order) const
else
return result;
- std::copy(ids->begin(), ids->end(), result->inserter());
+ std::copy(ids->begin(), ids->end(), result->back_inserter());
}
do
@@ -410,32 +324,79 @@ PackageDatabase::query(const Query & q, const QueryOrder query_order) const
switch (query_order)
{
case qo_order_by_version:
- sort_package_database_entry_collection(this, *result);
+ {
+ PackageIDComparator c(this);
+ result->sort(tr1::cref(c));
+ }
continue;
case qo_group_by_slot:
- sort_package_database_entry_collection(this, *result);
- group_package_database_entry_collection(*result);
+ {
+ /* if someone's bored, they can rewrite this to be a lot faster */
+ PackageIDComparator c(this);
+ std::set<tr1::shared_ptr<const PackageID>, tr1::reference_wrapper<const PackageIDComparator> > s(
+ result->begin(), result->end(), tr1::cref(c));
+ result.reset(new PackageIDSequence);
+
+ while (! s.empty())
+ {
+ result->push_front(*previous(s.end()));
+ s.erase(previous(s.end()));
+
+ for (std::set<tr1::shared_ptr<const PackageID>, tr1::reference_wrapper<const PackageIDComparator> >::reverse_iterator
+ i(s.rbegin()), new_i(i) ; i != s.rend() ; )
+ {
+ if ((*i)->name() == (*result->begin())->name() && (*i)->slot() == (*result->begin())->slot())
+ {
+ new_i = next(i);
+ result->push_front(*i);
+ s.erase(--(i.base()));
+ i = new_i;
+ }
+ else
+ ++i;
+ }
+ }
+ }
continue;
case qo_best_version_only:
{
- sort_package_database_entry_collection(this, *result);
- std::list<tr1::shared_ptr<const PackageID> > l;
- std::unique_copy(result->list.rbegin(), result->list.rend(),
- std::front_inserter(l), &compare_name);
- result->list.swap(l);
+ std::map<QualifiedPackageName, tr1::shared_ptr<const PackageID> > best;
+ PackageIDComparator c(this);
+ for (PackageIDSequence::Iterator r(result->begin()), r_end(result->end()) ;
+ r != r_end ; ++r)
+ {
+ std::pair<std::map<QualifiedPackageName, tr1::shared_ptr<const PackageID> >::iterator, bool> p(
+ best.insert(std::make_pair((*r)->name(), *r)));
+ if ((! p.second) && c(p.first->second, *r))
+ p.first->second = *r;
+ }
+
+ result.reset(new PackageIDSequence);
+ std::copy(best.begin(), best.end(), transform_inserter(result->back_inserter(),
+ tr1::mem_fn(&std::pair<const QualifiedPackageName, tr1::shared_ptr<const PackageID> >::second)));
}
continue;
case qo_best_version_in_slot_only:
{
- sort_package_database_entry_collection(this, *result);
- group_package_database_entry_collection(*result);
- std::list<tr1::shared_ptr<const PackageID> > l;
- std::unique_copy(result->list.rbegin(), result->list.rend(),
- std::front_inserter(l), &compare_name_slot);
- result->list.swap(l);
+ std::map<std::pair<QualifiedPackageName, SlotName>, tr1::shared_ptr<const PackageID> > best;
+ PackageIDComparator c(this);
+ for (PackageIDSequence::Iterator r(result->begin()), r_end(result->end()) ;
+ r != r_end ; ++r)
+ {
+ std::pair<std::map<std::pair<QualifiedPackageName, SlotName>, tr1::shared_ptr<const PackageID> >::iterator, bool> p(
+ best.insert(std::make_pair(std::make_pair((*r)->name(), (*r)->slot()), *r)));
+ if ((! p.second) && c(p.first->second, *r))
+ p.first->second = *r;
+ }
+
+ result.reset(new PackageIDSequence);
+ std::copy(best.begin(), best.end(), transform_inserter(result->back_inserter(),
+ tr1::mem_fn(&std::pair<const std::pair<QualifiedPackageName, SlotName>,
+ tr1::shared_ptr<const PackageID> >::second)));
+ result->sort(tr1::cref(c));
}
continue;
diff --git a/paludis/package_database.hh b/paludis/package_database.hh
index 145440d..d7243fd 100644
--- a/paludis/package_database.hh
+++ b/paludis/package_database.hh
@@ -29,7 +29,6 @@
#include <paludis/util/join.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/collection-fwd.hh>
#include <paludis/version_spec.hh>
#include <paludis/contents.hh>
diff --git a/paludis/package_database_TEST.cc b/paludis/package_database_TEST.cc
index a8188ce..1fb6364 100644
--- a/paludis/package_database_TEST.cc
+++ b/paludis/package_database_TEST.cc
@@ -22,6 +22,7 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
+#include <paludis/util/sequence.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <test/test_framework.hh>
diff --git a/paludis/package_id-fwd.hh b/paludis/package_id-fwd.hh
index 394e89b..99dc8f1 100644
--- a/paludis/package_id-fwd.hh
+++ b/paludis/package_id-fwd.hh
@@ -22,16 +22,18 @@
#include <iosfwd>
#include <paludis/util/attributes.hh>
-#include <paludis/util/collection-fwd.hh>
+#include <paludis/util/set-fwd.hh>
+#include <paludis/util/sequence-fwd.hh>
#include <paludis/util/tr1_memory.hh>
namespace paludis
{
class PackageID;
class PackageIDSetComparator;
+ class PackageIDComparator;
- typedef SequentialCollection<tr1::shared_ptr<const PackageID> > PackageIDSequence;
- typedef SortedCollection<tr1::shared_ptr<const PackageID>, PackageIDSetComparator> PackageIDSet;
+ typedef Sequence<tr1::shared_ptr<const PackageID> > PackageIDSequence;
+ typedef Set<tr1::shared_ptr<const PackageID>, PackageIDSetComparator> PackageIDSet;
#include <paludis/package_id-se.hh>
diff --git a/paludis/package_id.cc b/paludis/package_id.cc
index cb330e9..2599079 100644
--- a/paludis/package_id.cc
+++ b/paludis/package_id.cc
@@ -22,10 +22,16 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/sequence-impl.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/set-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/repository.hh>
+#include <paludis/package_database.hh>
+#include <paludis/hashed_containers.hh>
#include <list>
#include <algorithm>
@@ -36,6 +42,9 @@ using namespace paludis;
#include <paludis/package_id-se.cc>
+template class Sequence<tr1::shared_ptr<const PackageID> >;
+template class Set<tr1::shared_ptr<const PackageID>, PackageIDSetComparator>;
+
namespace paludis
{
template <>
@@ -131,3 +140,56 @@ paludis::operator== (const PackageID & a, const PackageID & b)
&& (! b.arbitrary_less_than_comparison(a));
}
+namespace paludis
+{
+ template <>
+ struct Implementation<PackageIDComparator>
+ {
+ MakeHashedMap<RepositoryName, unsigned>::Type m;
+ };
+}
+
+PackageIDComparator::PackageIDComparator(const PackageDatabase * const db) :
+ PrivateImplementationPattern<PackageIDComparator>(new Implementation<PackageIDComparator>)
+{
+ unsigned c(0);
+ for (PackageDatabase::RepositoryIterator r(db->begin_repositories()),
+ r_end(db->end_repositories()) ; r != r_end ; ++r)
+ _imp->m.insert(std::make_pair((*r)->name(), ++c));
+}
+
+PackageIDComparator::~PackageIDComparator()
+{
+}
+
+bool
+PackageIDComparator::operator() (const tr1::shared_ptr<const PackageID> & a,
+ const tr1::shared_ptr<const PackageID> & b) const
+{
+ if (a->name() < b->name())
+ return true;
+
+ if (a->name() > b->name())
+ return false;
+
+ if (a->version() < b->version())
+ return true;
+
+ if (a->version() > b->version())
+ return false;
+
+ MakeHashedMap<RepositoryName, unsigned>::Type::const_iterator
+ ma(_imp->m.find(a->repository()->name())),
+ mb(_imp->m.find(b->repository()->name()));
+
+ if (ma == _imp->m.end() || mb == _imp->m.end())
+ throw InternalError(PALUDIS_HERE, "Repository not in database");
+
+ if (ma->second < mb->second)
+ return true;
+ if (ma->second > mb->second)
+ return false;
+
+ return a->arbitrary_less_than_comparison(*b);
+}
+
diff --git a/paludis/package_id.hh b/paludis/package_id.hh
index 66daa11..a810e05 100644
--- a/paludis/package_id.hh
+++ b/paludis/package_id.hh
@@ -35,6 +35,8 @@
namespace paludis
{
+ class PackageDatabase;
+
class PALUDIS_VISIBLE PackageID :
private InstantiationPolicy<PackageID, instantiation_method::NonCopyableTag>,
private PrivateImplementationPattern<PackageID>,
@@ -60,10 +62,10 @@ namespace paludis
///\{
virtual const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for_key() const = 0;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameCollection> > keywords_key() const = 0;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameCollection> > use_key() const = 0;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<IUseFlagCollection> > iuse_key() const = 0;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<InheritedCollection> > inherited_key() const = 0;
+ virtual const tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> > keywords_key() const = 0;
+ virtual const tr1::shared_ptr<const MetadataSetKey<UseFlagNameSet> > use_key() const = 0;
+ virtual const tr1::shared_ptr<const MetadataSetKey<IUseFlagSet> > iuse_key() const = 0;
+ virtual const tr1::shared_ptr<const MetadataSetKey<InheritedSet> > inherited_key() const = 0;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<LicenseSpecTree> > license_key() const = 0;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<ProvideSpecTree> > provide_key() const = 0;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > build_dependencies_key() const = 0;
@@ -134,6 +136,19 @@ namespace paludis
bool operator() (const tr1::shared_ptr<const PackageID> &,
const tr1::shared_ptr<const PackageID> &) const;
};
+
+ class PALUDIS_VISIBLE PackageIDComparator :
+ private PrivateImplementationPattern<PackageIDComparator>
+ {
+ public:
+ typedef bool result_type;
+
+ PackageIDComparator(const PackageDatabase * const);
+ ~PackageIDComparator();
+
+ bool operator() (const tr1::shared_ptr<const PackageID> &,
+ const tr1::shared_ptr<const PackageID> &) const;
+ };
}
#endif
diff --git a/paludis/query.cc b/paludis/query.cc
index 2319d0e..2147745 100644
--- a/paludis/query.cc
+++ b/paludis/query.cc
@@ -18,9 +18,10 @@
*/
#include "query.hh"
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/set.hh>
#include <paludis/package_database.hh>
#include <paludis/environment.hh>
#include <paludis/match_package.hh>
@@ -39,28 +40,28 @@ QueryDelegate::~QueryDelegate()
{
}
-tr1::shared_ptr<RepositoryNameCollection>
+tr1::shared_ptr<RepositoryNameSequence>
QueryDelegate::repositories(const Environment &) const
{
- return tr1::shared_ptr<RepositoryNameCollection>();
+ return tr1::shared_ptr<RepositoryNameSequence>();
}
-tr1::shared_ptr<CategoryNamePartCollection>
-QueryDelegate::categories(const Environment &, tr1::shared_ptr<const RepositoryNameCollection>) const
+tr1::shared_ptr<CategoryNamePartSet>
+QueryDelegate::categories(const Environment &, tr1::shared_ptr<const RepositoryNameSequence>) const
{
- return tr1::shared_ptr<CategoryNamePartCollection>();
+ return tr1::shared_ptr<CategoryNamePartSet>();
}
-tr1::shared_ptr<QualifiedPackageNameCollection>
-QueryDelegate::packages(const Environment &, tr1::shared_ptr<const RepositoryNameCollection>,
- tr1::shared_ptr<const CategoryNamePartCollection>) const
+tr1::shared_ptr<QualifiedPackageNameSet>
+QueryDelegate::packages(const Environment &, tr1::shared_ptr<const RepositoryNameSequence>,
+ tr1::shared_ptr<const CategoryNamePartSet>) const
{
- return tr1::shared_ptr<QualifiedPackageNameCollection>();
+ return tr1::shared_ptr<QualifiedPackageNameSet>();
}
tr1::shared_ptr<PackageIDSequence>
-QueryDelegate::ids(const Environment &, tr1::shared_ptr<const RepositoryNameCollection>,
- tr1::shared_ptr<const QualifiedPackageNameCollection>) const
+QueryDelegate::ids(const Environment &, tr1::shared_ptr<const RepositoryNameSequence>,
+ tr1::shared_ptr<const QualifiedPackageNameSet>) const
{
return tr1::shared_ptr<PackageIDSequence>();
}
@@ -92,12 +93,12 @@ namespace
return "matches '" + stringify(spec) + "'";
}
- tr1::shared_ptr<RepositoryNameCollection>
+ tr1::shared_ptr<RepositoryNameSequence>
repositories(const Environment & e) const
{
if (spec.repository_ptr())
{
- tr1::shared_ptr<RepositoryNameCollection> result(new RepositoryNameCollection::Concrete);
+ tr1::shared_ptr<RepositoryNameSequence> result(new RepositoryNameSequence);
for (PackageDatabase::RepositoryIterator i(e.package_database()->begin_repositories()),
i_end(e.package_database()->end_repositories()) ; i != i_end ; ++i)
@@ -113,19 +114,19 @@ namespace
return QueryDelegate::repositories(e);
}
- tr1::shared_ptr<CategoryNamePartCollection>
+ tr1::shared_ptr<CategoryNamePartSet>
categories(const Environment & e,
- tr1::shared_ptr<const RepositoryNameCollection> r) const
+ tr1::shared_ptr<const RepositoryNameSequence> r) const
{
if (spec.package_ptr())
{
- tr1::shared_ptr<CategoryNamePartCollection> result(new CategoryNamePartCollection::Concrete);
+ tr1::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
result->insert(spec.package_ptr()->category);
return result;
}
else if (spec.category_name_part_ptr())
{
- tr1::shared_ptr<CategoryNamePartCollection> result(new CategoryNamePartCollection::Concrete);
+ tr1::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
result->insert(*spec.category_name_part_ptr());
return result;
}
@@ -133,25 +134,25 @@ namespace
return QueryDelegate::categories(e, r);
}
- tr1::shared_ptr<QualifiedPackageNameCollection>
+ tr1::shared_ptr<QualifiedPackageNameSet>
packages(const Environment & e,
- tr1::shared_ptr<const RepositoryNameCollection> repos,
- tr1::shared_ptr<const CategoryNamePartCollection> cats) const
+ tr1::shared_ptr<const RepositoryNameSequence> repos,
+ tr1::shared_ptr<const CategoryNamePartSet> cats) const
{
if (spec.package_ptr())
{
- tr1::shared_ptr<QualifiedPackageNameCollection> result(
- new QualifiedPackageNameCollection::Concrete);
+ tr1::shared_ptr<QualifiedPackageNameSet> result(
+ new QualifiedPackageNameSet);
result->insert(*spec.package_ptr());
return result;
}
else if (spec.package_name_part_ptr())
{
- tr1::shared_ptr<QualifiedPackageNameCollection> result(
- new QualifiedPackageNameCollection::Concrete);
- for (RepositoryNameCollection::Iterator r(repos->begin()), r_end(repos->end()) ;
+ tr1::shared_ptr<QualifiedPackageNameSet> result(
+ new QualifiedPackageNameSet);
+ for (RepositoryNameSequence::Iterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
- for (CategoryNamePartCollection::Iterator c(cats->begin()), c_end(cats->end()) ;
+ for (CategoryNamePartSet::Iterator c(cats->begin()), c_end(cats->end()) ;
c != c_end ; ++c)
if (e.package_database()->fetch_repository(*r)->has_package_named(*c +
*spec.package_name_part_ptr()))
@@ -164,16 +165,16 @@ namespace
tr1::shared_ptr<PackageIDSequence>
ids(const Environment & e,
- tr1::shared_ptr<const RepositoryNameCollection> repos,
- tr1::shared_ptr<const QualifiedPackageNameCollection> pkgs) const
+ tr1::shared_ptr<const RepositoryNameSequence> repos,
+ tr1::shared_ptr<const QualifiedPackageNameSet> pkgs) const
{
- tr1::shared_ptr<PackageIDSequence> result(new PackageIDSequence::Concrete);
- for (RepositoryNameCollection::Iterator r(repos->begin()), r_end(repos->end()) ;
+ tr1::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+ for (RepositoryNameSequence::Iterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
{
tr1::shared_ptr<const Repository> repo(e.package_database()->fetch_repository(*r));
- for (QualifiedPackageNameCollection::Iterator p(pkgs->begin()), p_end(pkgs->end()) ;
+ for (QualifiedPackageNameSet::Iterator p(pkgs->begin()), p_end(pkgs->end()) ;
p != p_end ; ++p)
{
using namespace tr1::placeholders;
@@ -233,16 +234,16 @@ namespace
tr1::shared_ptr<PackageIDSequence>
ids(const Environment & e,
- tr1::shared_ptr<const RepositoryNameCollection> repos,
- tr1::shared_ptr<const QualifiedPackageNameCollection> pkgs) const
+ tr1::shared_ptr<const RepositoryNameSequence> repos,
+ tr1::shared_ptr<const QualifiedPackageNameSet> pkgs) const
{
- tr1::shared_ptr<PackageIDSequence> result(new PackageIDSequence::Concrete);
- for (RepositoryNameCollection::Iterator r(repos->begin()), r_end(repos->end()) ;
+ tr1::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+ for (RepositoryNameSequence::Iterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
{
tr1::shared_ptr<const Repository> repo(e.package_database()->fetch_repository(*r));
- for (QualifiedPackageNameCollection::Iterator p(pkgs->begin()), p_end(pkgs->end()) ;
+ for (QualifiedPackageNameSet::Iterator p(pkgs->begin()), p_end(pkgs->end()) ;
p != p_end ; ++p)
{
tr1::shared_ptr<const PackageIDSequence> i(repo->package_ids(*p));
@@ -296,10 +297,10 @@ namespace
struct RepositoryHasDelegate :
QueryDelegate
{
- tr1::shared_ptr<RepositoryNameCollection>
+ tr1::shared_ptr<RepositoryNameSequence>
repositories(const Environment & e) const
{
- tr1::shared_ptr<RepositoryNameCollection> result(new RepositoryNameCollection::Concrete);
+ tr1::shared_ptr<RepositoryNameSequence> result(new RepositoryNameSequence);
for (PackageDatabase::RepositoryIterator i(e.package_database()->begin_repositories()),
i_end(e.package_database()->end_repositories()) ; i != i_end ; ++i)
@@ -354,10 +355,10 @@ namespace
{
}
- tr1::shared_ptr<RepositoryNameCollection>
+ tr1::shared_ptr<RepositoryNameSequence>
repositories(const Environment & e) const
{
- tr1::shared_ptr<RepositoryNameCollection> result(new RepositoryNameCollection::Concrete);
+ tr1::shared_ptr<RepositoryNameSequence> result(new RepositoryNameSequence);
for (PackageDatabase::RepositoryIterator i(e.package_database()->begin_repositories()),
i_end(e.package_database()->end_repositories()) ; i != i_end ; ++i)
@@ -404,16 +405,16 @@ namespace
{
}
- tr1::shared_ptr<RepositoryNameCollection>
+ tr1::shared_ptr<RepositoryNameSequence>
repositories(const Environment & e) const
{
- tr1::shared_ptr<RepositoryNameCollection> r1(q1->repositories(e)), r2(q2->repositories(e));
+ tr1::shared_ptr<RepositoryNameSequence> r1(q1->repositories(e)), r2(q2->repositories(e));
if (r1 && r2)
{
std::set<RepositoryName, RepositoryNameComparator> s1(r1->begin(), r1->end()), s2(r2->begin(), r2->end());
- tr1::shared_ptr<RepositoryNameCollection> result(new RepositoryNameCollection::Concrete);
- std::set_intersection(s1.begin(), s1.end(), s2.begin(), s2.end(), result->inserter(),
+ tr1::shared_ptr<RepositoryNameSequence> result(new RepositoryNameSequence);
+ std::set_intersection(s1.begin(), s1.end(), s2.begin(), s2.end(), result->back_inserter(),
RepositoryNameComparator());
return result;
}
@@ -423,14 +424,14 @@ namespace
return r2;
}
- tr1::shared_ptr<CategoryNamePartCollection>
- categories(const Environment & e, tr1::shared_ptr<const RepositoryNameCollection> r) const
+ tr1::shared_ptr<CategoryNamePartSet>
+ categories(const Environment & e, tr1::shared_ptr<const RepositoryNameSequence> r) const
{
- tr1::shared_ptr<CategoryNamePartCollection> r1(q1->categories(e, r)), r2(q2->categories(e, r));
+ tr1::shared_ptr<CategoryNamePartSet> r1(q1->categories(e, r)), r2(q2->categories(e, r));
if (r1 && r2)
{
- tr1::shared_ptr<CategoryNamePartCollection> result(new CategoryNamePartCollection::Concrete);
+ tr1::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
std::set_intersection(r1->begin(), r1->end(), r2->begin(), r2->end(), result->inserter());
return result;
}
@@ -440,15 +441,15 @@ namespace
return r2;
}
- tr1::shared_ptr<QualifiedPackageNameCollection>
- packages(const Environment & e, tr1::shared_ptr<const RepositoryNameCollection> r,
- tr1::shared_ptr<const CategoryNamePartCollection> c) const
+ tr1::shared_ptr<QualifiedPackageNameSet>
+ packages(const Environment & e, tr1::shared_ptr<const RepositoryNameSequence> r,
+ tr1::shared_ptr<const CategoryNamePartSet> c) const
{
- tr1::shared_ptr<QualifiedPackageNameCollection> r1(q1->packages(e, r, c)), r2(q2->packages(e, r, c));
+ tr1::shared_ptr<QualifiedPackageNameSet> r1(q1->packages(e, r, c)), r2(q2->packages(e, r, c));
if (r1 && r2)
{
- tr1::shared_ptr<QualifiedPackageNameCollection> result(new QualifiedPackageNameCollection::Concrete);
+ tr1::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
std::set_intersection(r1->begin(), r1->end(), r2->begin(), r2->end(), result->inserter());
return result;
}
@@ -459,8 +460,8 @@ namespace
}
tr1::shared_ptr<PackageIDSequence>
- ids(const Environment & e, tr1::shared_ptr<const RepositoryNameCollection> r,
- tr1::shared_ptr<const QualifiedPackageNameCollection> q) const
+ ids(const Environment & e, tr1::shared_ptr<const RepositoryNameSequence> r,
+ tr1::shared_ptr<const QualifiedPackageNameSet> q) const
{
tr1::shared_ptr<PackageIDSequence> r1(q1->ids(e, r, q)), r2(q2->ids(e, r, q));
@@ -468,8 +469,8 @@ namespace
{
std::set<tr1::shared_ptr<const PackageID>, PackageIDSetComparator>
s1(r1->begin(), r1->end()), s2(r2->begin(), r2->end());
- tr1::shared_ptr<PackageIDSequence> result(new PackageIDSequence::Concrete);
- std::set_intersection(s1.begin(), s1.end(), s2.begin(), s2.end(), result->inserter(), PackageIDSetComparator());
+ tr1::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+ std::set_intersection(s1.begin(), s1.end(), s2.begin(), s2.end(), result->back_inserter(), PackageIDSetComparator());
return result;
}
else if (r1)
diff --git a/paludis/query.hh b/paludis/query.hh
index 08a7e97..c0c0f33 100644
--- a/paludis/query.hh
+++ b/paludis/query.hh
@@ -20,7 +20,6 @@
#ifndef PALUDIS_GUARD_PALUDIS_QUERY_HH
#define PALUDIS_GUARD_PALUDIS_QUERY_HH 1
-#include <paludis/util/collection.hh>
#include <paludis/name.hh>
#include <paludis/package_id.hh>
#include <iosfwd>
@@ -63,7 +62,7 @@ namespace paludis
*
* Default behaviour: return all repositories.
*/
- virtual tr1::shared_ptr<RepositoryNameCollection> repositories(const Environment &) const;
+ virtual tr1::shared_ptr<RepositoryNameSequence> repositories(const Environment &) const;
/**
* Fetch the names of categories potentially containing matches.
@@ -71,8 +70,8 @@ namespace paludis
* Default behaviour: return all categories in the provided
* repository collection.
*/
- virtual tr1::shared_ptr<CategoryNamePartCollection> categories(const Environment &,
- tr1::shared_ptr<const RepositoryNameCollection>) const;
+ virtual tr1::shared_ptr<CategoryNamePartSet> categories(const Environment &,
+ tr1::shared_ptr<const RepositoryNameSequence>) const;
/**
* Fetch the names of packages potentially containing matches.
@@ -83,9 +82,9 @@ namespace paludis
* Note that some entries in the categories collection (but not in
* the repositories collection) may not exist.
*/
- virtual tr1::shared_ptr<QualifiedPackageNameCollection> packages(const Environment &,
- tr1::shared_ptr<const RepositoryNameCollection>,
- tr1::shared_ptr<const CategoryNamePartCollection>) const;
+ virtual tr1::shared_ptr<QualifiedPackageNameSet> packages(const Environment &,
+ tr1::shared_ptr<const RepositoryNameSequence>,
+ tr1::shared_ptr<const CategoryNamePartSet>) const;
/**
* Fetch the IDs of matching packages.
@@ -96,8 +95,8 @@ namespace paludis
* (but not in the repositories collection) may not exist.
*/
virtual tr1::shared_ptr<PackageIDSequence> ids(const Environment &,
- tr1::shared_ptr<const RepositoryNameCollection>,
- tr1::shared_ptr<const QualifiedPackageNameCollection>) const;
+ tr1::shared_ptr<const RepositoryNameSequence>,
+ tr1::shared_ptr<const QualifiedPackageNameSet>) const;
/**
* Fetch a string representation of our query.
@@ -138,27 +137,27 @@ namespace paludis
///\name Delegate-implemented functions
///\{
- tr1::shared_ptr<RepositoryNameCollection> repositories(const Environment & e) const
+ tr1::shared_ptr<RepositoryNameSequence> repositories(const Environment & e) const
{
return _d->repositories(e);
}
- tr1::shared_ptr<CategoryNamePartCollection> categories(const Environment & e,
- tr1::shared_ptr<const RepositoryNameCollection> r) const
+ tr1::shared_ptr<CategoryNamePartSet> categories(const Environment & e,
+ tr1::shared_ptr<const RepositoryNameSequence> r) const
{
return _d->categories(e, r);
}
- tr1::shared_ptr<QualifiedPackageNameCollection> packages(const Environment & e,
- tr1::shared_ptr<const RepositoryNameCollection> r,
- tr1::shared_ptr<const CategoryNamePartCollection> c) const
+ tr1::shared_ptr<QualifiedPackageNameSet> packages(const Environment & e,
+ tr1::shared_ptr<const RepositoryNameSequence> r,
+ tr1::shared_ptr<const CategoryNamePartSet> c) const
{
return _d->packages(e, r, c);
}
tr1::shared_ptr<PackageIDSequence> ids(const Environment & e,
- tr1::shared_ptr<const RepositoryNameCollection> r,
- tr1::shared_ptr<const QualifiedPackageNameCollection> q) const
+ tr1::shared_ptr<const RepositoryNameSequence> r,
+ tr1::shared_ptr<const QualifiedPackageNameSet> q) const
{
return _d->ids(e, r, q);
}
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 381ba76..9a6edcf 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -22,12 +22,12 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/log.hh>
#include <paludis/util/mutex.hh>
+#include <paludis/util/set.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/eapi.hh>
@@ -294,7 +294,7 @@ namespace paludis
const tr1::shared_ptr<const PackageID> id;
const std::string string_value;
mutable Mutex value_mutex;
- mutable tr1::shared_ptr<IUseFlagCollection> value;
+ mutable tr1::shared_ptr<IUseFlagSet> value;
Implementation(const tr1::shared_ptr<const PackageID> & i, const std::string & v) :
id(i),
@@ -306,7 +306,7 @@ namespace paludis
EIUseKey::EIUseKey(const tr1::shared_ptr<const PackageID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- MetadataCollectionKey<IUseFlagCollection>(r, h, t),
+ MetadataSetKey<IUseFlagSet>(r, h, t),
PrivateImplementationPattern<EIUseKey>(new Implementation<EIUseKey>(id, v)),
_imp(PrivateImplementationPattern<EIUseKey>::_imp.get())
{
@@ -316,7 +316,7 @@ EIUseKey::~EIUseKey()
{
}
-const tr1::shared_ptr<const IUseFlagCollection>
+const tr1::shared_ptr<const IUseFlagSet>
EIUseKey::value() const
{
Lock l(_imp->value_mutex);
@@ -324,7 +324,7 @@ EIUseKey::value() const
return _imp->value;
Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':");
- _imp->value.reset(new IUseFlagCollection::Concrete);
+ _imp->value.reset(new IUseFlagSet);
std::list<std::string> tokens;
WhitespaceTokeniser::get_instance()->tokenise(_imp->string_value, std::back_inserter(tokens));
for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
@@ -341,7 +341,7 @@ EIUseKey::idle_load() const
if (l() && ! _imp->value)
{
Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "' as idle action:");
- _imp->value.reset(new IUseFlagCollection::Concrete);
+ _imp->value.reset(new IUseFlagSet);
std::list<std::string> tokens;
WhitespaceTokeniser::get_instance()->tokenise(_imp->string_value, std::back_inserter(tokens));
for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
@@ -358,7 +358,7 @@ namespace paludis
const tr1::shared_ptr<const PackageID> id;
const std::string string_value;
mutable Mutex value_mutex;
- mutable tr1::shared_ptr<KeywordNameCollection> value;
+ mutable tr1::shared_ptr<KeywordNameSet> value;
Implementation(const tr1::shared_ptr<const PackageID> & i, const std::string & v) :
id(i),
@@ -370,7 +370,7 @@ namespace paludis
EKeywordsKey::EKeywordsKey(const tr1::shared_ptr<const PackageID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- MetadataCollectionKey<KeywordNameCollection>(r, h, t),
+ MetadataSetKey<KeywordNameSet>(r, h, t),
PrivateImplementationPattern<EKeywordsKey>(new Implementation<EKeywordsKey>(id, v)),
_imp(PrivateImplementationPattern<EKeywordsKey>::_imp.get())
{
@@ -380,14 +380,14 @@ EKeywordsKey::~EKeywordsKey()
{
}
-const tr1::shared_ptr<const KeywordNameCollection>
+const tr1::shared_ptr<const KeywordNameSet>
EKeywordsKey::value() const
{
Lock l(_imp->value_mutex);
if (_imp->value)
return _imp->value;
- _imp->value.reset(new KeywordNameCollection::Concrete);
+ _imp->value.reset(new KeywordNameSet);
Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':");
WhitespaceTokeniser::get_instance()->tokenise(_imp->string_value, create_inserter<KeywordName>(_imp->value->inserter()));
return _imp->value;
@@ -399,7 +399,7 @@ EKeywordsKey::idle_load() const
TryLock l(_imp->value_mutex);
if (l() && ! _imp->value)
{
- _imp->value.reset(new KeywordNameCollection::Concrete);
+ _imp->value.reset(new KeywordNameSet);
Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "' as idle action:");
WhitespaceTokeniser::get_instance()->tokenise(_imp->string_value, create_inserter<KeywordName>(_imp->value->inserter()));
}
@@ -412,7 +412,7 @@ namespace paludis
{
const tr1::shared_ptr<const PackageID> id;
const std::string string_value;
- mutable tr1::shared_ptr<UseFlagNameCollection> value;
+ mutable tr1::shared_ptr<UseFlagNameSet> value;
Implementation(const tr1::shared_ptr<const PackageID> & i, const std::string & v) :
id(i),
@@ -424,7 +424,7 @@ namespace paludis
EUseKey::EUseKey(const tr1::shared_ptr<const PackageID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- MetadataCollectionKey<UseFlagNameCollection>(r, h, t),
+ MetadataSetKey<UseFlagNameSet>(r, h, t),
PrivateImplementationPattern<EUseKey>(new Implementation<EUseKey>(id, v)),
_imp(PrivateImplementationPattern<EUseKey>::_imp.get())
{
@@ -434,13 +434,13 @@ EUseKey::~EUseKey()
{
}
-const tr1::shared_ptr<const UseFlagNameCollection>
+const tr1::shared_ptr<const UseFlagNameSet>
EUseKey::value() const
{
if (_imp->value)
return _imp->value;
- _imp->value.reset(new UseFlagNameCollection::Concrete);
+ _imp->value.reset(new UseFlagNameSet);
Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':");
std::list<std::string> tokens;
WhitespaceTokeniser::get_instance()->tokenise(_imp->string_value, std::back_inserter(tokens));
@@ -458,7 +458,7 @@ namespace paludis
{
const tr1::shared_ptr<const PackageID> id;
const std::string string_value;
- mutable tr1::shared_ptr<InheritedCollection> value;
+ mutable tr1::shared_ptr<InheritedSet> value;
Implementation(const tr1::shared_ptr<const PackageID> & i, const std::string & v) :
id(i),
@@ -470,7 +470,7 @@ namespace paludis
EInheritedKey::EInheritedKey(const tr1::shared_ptr<const PackageID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- MetadataCollectionKey<InheritedCollection>(r, h, t),
+ MetadataSetKey<InheritedSet>(r, h, t),
PrivateImplementationPattern<EInheritedKey>(new Implementation<EInheritedKey>(id, v)),
_imp(PrivateImplementationPattern<EInheritedKey>::_imp.get())
{
@@ -480,13 +480,13 @@ EInheritedKey::~EInheritedKey()
{
}
-const tr1::shared_ptr<const InheritedCollection>
+const tr1::shared_ptr<const InheritedSet>
EInheritedKey::value() const
{
if (_imp->value)
return _imp->value;
- _imp->value.reset(new InheritedCollection::Concrete);
+ _imp->value.reset(new InheritedSet);
Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':");
WhitespaceTokeniser::get_instance()->tokenise(_imp->string_value, _imp->value->inserter());
return _imp->value;
diff --git a/paludis/repositories/e/e_key.hh b/paludis/repositories/e/e_key.hh
index f839aeb..c3b9fa2 100644
--- a/paludis/repositories/e/e_key.hh
+++ b/paludis/repositories/e/e_key.hh
@@ -129,7 +129,7 @@ namespace paludis
};
class EIUseKey :
- public MetadataCollectionKey<IUseFlagCollection>,
+ public MetadataSetKey<IUseFlagSet>,
private PrivateImplementationPattern<EIUseKey>
{
private:
@@ -140,14 +140,14 @@ namespace paludis
const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EIUseKey();
- const tr1::shared_ptr<const IUseFlagCollection> value() const
+ const tr1::shared_ptr<const IUseFlagSet> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
void idle_load() const;
};
class EKeywordsKey :
- public MetadataCollectionKey<KeywordNameCollection>,
+ public MetadataSetKey<KeywordNameSet>,
private PrivateImplementationPattern<EKeywordsKey>
{
private:
@@ -158,14 +158,14 @@ namespace paludis
const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EKeywordsKey();
- const tr1::shared_ptr<const KeywordNameCollection> value() const
+ const tr1::shared_ptr<const KeywordNameSet> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
void idle_load() const;
};
class EUseKey :
- public MetadataCollectionKey<UseFlagNameCollection>,
+ public MetadataSetKey<UseFlagNameSet>,
private PrivateImplementationPattern<EUseKey>
{
private:
@@ -176,12 +176,12 @@ namespace paludis
const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EUseKey();
- const tr1::shared_ptr<const UseFlagNameCollection> value() const
+ const tr1::shared_ptr<const UseFlagNameSet> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EInheritedKey :
- public MetadataCollectionKey<InheritedCollection>,
+ public MetadataSetKey<InheritedSet>,
private PrivateImplementationPattern<EInheritedKey>
{
private:
@@ -192,7 +192,7 @@ namespace paludis
const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EInheritedKey();
- const tr1::shared_ptr<const InheritedCollection> value() const
+ const tr1::shared_ptr<const InheritedSet> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
};
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 2127abe..a980cc0 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -46,7 +46,6 @@
#include <paludis/syncer.hh>
#include <paludis/eapi.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/log.hh>
@@ -55,15 +54,19 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/set.hh>
#include <paludis/util/tr1_functional.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <map>
+#include <set>
#include <functional>
#include <algorithm>
#include <vector>
+#include <list>
#include <strings.h>
#include <ctype.h>
@@ -102,7 +105,7 @@ namespace paludis
mutable VirtualsMap our_virtuals;
const std::map<QualifiedPackageName, QualifiedPackageName> provide_map;
- mutable tr1::shared_ptr<UseFlagNameCollection> arch_flags;
+ mutable tr1::shared_ptr<UseFlagNameSet> arch_flags;
mutable bool has_mirrors;
mutable MirrorMap mirrors;
@@ -166,8 +169,8 @@ namespace paludis
Context context("When loading profiles.desc:");
bool found_one(false);
- tr1::shared_ptr<const FSEntryCollection> profiles_desc_files(layout->profiles_desc_files());
- for (FSEntryCollection::Iterator p(profiles_desc_files->begin()), p_end(profiles_desc_files->end()) ;
+ tr1::shared_ptr<const FSEntrySequence> profiles_desc_files(layout->profiles_desc_files());
+ for (FSEntrySequence::Iterator p(profiles_desc_files->begin()), p_end(profiles_desc_files->end()) ;
p != p_end ; ++p)
{
if (! p->exists())
@@ -184,7 +187,7 @@ namespace paludis
if (tokens.size() < 3)
continue;
- FSEntryCollection::Concrete profiles;
+ FSEntrySequence profiles;
profiles.push_back(layout->profiles_base_dir() / tokens.at(1));
profiles_desc.push_back(RepositoryEInterface::ProfilesDescLine::create()
.arch(tokens.at(0))
@@ -320,13 +323,13 @@ ERepository::do_has_package_named(const QualifiedPackageName & q) const
return _imp->layout->has_package_named(q);
}
-tr1::shared_ptr<const CategoryNamePartCollection>
+tr1::shared_ptr<const CategoryNamePartSet>
ERepository::do_category_names() const
{
return _imp->layout->category_names();
}
-tr1::shared_ptr<const QualifiedPackageNameCollection>
+tr1::shared_ptr<const QualifiedPackageNameSet>
ERepository::do_package_names(const CategoryNamePart & c) const
{
return _imp->layout->package_names(c);
@@ -345,8 +348,8 @@ ERepository::do_query_repository_masks(const PackageID & id) const
{
Context context("When querying repository mask for '" + stringify(id) + "':");
- tr1::shared_ptr<const FSEntryCollection> repository_mask_files(_imp->layout->repository_mask_files());
- for (FSEntryCollection::Iterator p(repository_mask_files->begin()), p_end(repository_mask_files->end()) ;
+ tr1::shared_ptr<const FSEntrySequence> repository_mask_files(_imp->layout->repository_mask_files());
+ for (FSEntrySequence::Iterator p(repository_mask_files->begin()), p_end(repository_mask_files->end()) ;
p != p_end ; ++p)
{
Context context_local("When reading '" + stringify(*p) + "':");
@@ -421,17 +424,17 @@ ERepository::do_query_use_force(const UseFlagName & u, const PackageID & e) cons
return _imp->profile_ptr->use_forced(u, e);
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
ERepository::do_arch_flags() const
{
if (! _imp->arch_flags)
{
Context context("When loading arch list:");
- _imp->arch_flags.reset(new UseFlagNameCollection::Concrete);
+ _imp->arch_flags.reset(new UseFlagNameSet);
bool found_one(false);
- tr1::shared_ptr<const FSEntryCollection> arch_list_files(_imp->layout->arch_list_files());
- for (FSEntryCollection::Iterator p(arch_list_files->begin()), p_end(arch_list_files->end()) ;
+ tr1::shared_ptr<const FSEntrySequence> arch_list_files(_imp->layout->arch_list_files());
+ for (FSEntrySequence::Iterator p(arch_list_files->begin()), p_end(arch_list_files->end()) ;
p != p_end ; ++p)
{
if (! p->exists())
@@ -477,8 +480,8 @@ ERepository::need_mirrors() const
if (! _imp->has_mirrors)
{
bool found_one(false);
- tr1::shared_ptr<const FSEntryCollection> mirror_files(_imp->layout->mirror_files());
- for (FSEntryCollection::Iterator p(mirror_files->begin()), p_end(mirror_files->end()) ;
+ tr1::shared_ptr<const FSEntrySequence> mirror_files(_imp->layout->mirror_files());
+ for (FSEntrySequence::Iterator p(mirror_files->begin()), p_end(mirror_files->end()) ;
p != p_end ; ++p)
{
if (p->exists())
@@ -542,7 +545,7 @@ ERepository::do_package_set(const SetName & s) const
return _imp->sets_ptr->package_set(s);
}
-tr1::shared_ptr<const SetNameCollection>
+tr1::shared_ptr<const SetNameSet>
ERepository::sets_list() const
{
return _imp->sets_ptr->sets_list();
@@ -730,7 +733,7 @@ ERepository::virtual_packages() const
_imp->need_profiles();
- tr1::shared_ptr<VirtualsSequence> result(new VirtualsSequence::Concrete);
+ tr1::shared_ptr<VirtualsSequence> result(new VirtualsSequence);
for (ERepositoryProfile::VirtualsIterator i(_imp->profile_ptr->begin_virtuals()),
i_end(_imp->profile_ptr->end_virtuals()) ; i != i_end ; ++i)
@@ -741,12 +744,12 @@ ERepository::virtual_packages() const
return result;
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
ERepository::do_use_expand_flags() const
{
_imp->need_profiles();
- tr1::shared_ptr<UseFlagNameCollection> result(new UseFlagNameCollection::Concrete);
+ tr1::shared_ptr<UseFlagNameSet> result(new UseFlagNameSet);
for (ERepositoryProfile::UseExpandIterator i(_imp->profile_ptr->begin_use_expand()),
i_end(_imp->profile_ptr->end_use_expand()) ; i != i_end ; ++i)
{
@@ -765,12 +768,12 @@ ERepository::do_use_expand_flags() const
return result;
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
ERepository::do_use_expand_prefixes() const
{
_imp->need_profiles();
- tr1::shared_ptr<UseFlagNameCollection> result(new UseFlagNameCollection::Concrete);
+ tr1::shared_ptr<UseFlagNameSet> result(new UseFlagNameSet);
for (ERepositoryProfile::UseExpandIterator i(_imp->profile_ptr->begin_use_expand()),
i_end(_imp->profile_ptr->end_use_expand()) ; i != i_end ; ++i)
{
@@ -782,12 +785,12 @@ ERepository::do_use_expand_prefixes() const
return result;
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
ERepository::do_use_expand_hidden_prefixes() const
{
_imp->need_profiles();
- tr1::shared_ptr<UseFlagNameCollection> result(new UseFlagNameCollection::Concrete);
+ tr1::shared_ptr<UseFlagNameSet> result(new UseFlagNameSet);
for (ERepositoryProfile::UseExpandIterator i(_imp->profile_ptr->begin_use_expand_hidden()),
i_end(_imp->profile_ptr->end_use_expand_hidden()) ; i != i_end ; ++i)
{
@@ -805,13 +808,13 @@ ERepository::regenerate_cache() const
_imp->names_cache->regenerate_cache();
}
-tr1::shared_ptr<const CategoryNamePartCollection>
+tr1::shared_ptr<const CategoryNamePartSet>
ERepository::do_category_names_containing_package(const PackageNamePart & p) const
{
if (! _imp->names_cache->usable())
return Repository::do_category_names_containing_package(p);
- tr1::shared_ptr<const CategoryNamePartCollection> result(
+ tr1::shared_ptr<const CategoryNamePartSet> result(
_imp->names_cache->category_names_containing_package(p));
return result ? result : Repository::do_category_names_containing_package(p);
@@ -883,8 +886,8 @@ ERepository::do_describe_use_flag(const UseFlagName & f,
{
if (_imp->use_desc.empty())
{
- tr1::shared_ptr<const FSEntryCollection> use_desc_dirs(_imp->layout->use_desc_dirs());
- for (FSEntryCollection::Iterator p(use_desc_dirs->begin()), p_end(use_desc_dirs->end()) ;
+ tr1::shared_ptr<const FSEntrySequence> use_desc_dirs(_imp->layout->use_desc_dirs());
+ for (FSEntrySequence::Iterator p(use_desc_dirs->begin()), p_end(use_desc_dirs->end()) ;
p != p_end ; ++p)
_imp->use_desc.push_back(tr1::shared_ptr<UseDesc>(new UseDesc(*p)));
}
diff --git a/paludis/repositories/e/e_repository.hh b/paludis/repositories/e/e_repository.hh
index 990559c..b911c03 100644
--- a/paludis/repositories/e/e_repository.hh
+++ b/paludis/repositories/e/e_repository.hh
@@ -80,7 +80,7 @@ namespace paludis
virtual tr1::shared_ptr<SetSpecTree::ConstItem> do_package_set(const SetName & id) const;
- virtual tr1::shared_ptr<const SetNameCollection> sets_list() const;
+ virtual tr1::shared_ptr<const SetNameSet> sets_list() const;
/* RepositorySyncableInterface */
@@ -105,16 +105,16 @@ namespace paludis
virtual bool do_query_use_force(const UseFlagName &, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const UseFlagNameCollection> do_arch_flags() const
+ virtual tr1::shared_ptr<const UseFlagNameSet> do_arch_flags() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const UseFlagNameCollection> do_use_expand_flags() const
+ virtual tr1::shared_ptr<const UseFlagNameSet> do_use_expand_flags() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const UseFlagNameCollection> do_use_expand_hidden_prefixes() const
+ virtual tr1::shared_ptr<const UseFlagNameSet> do_use_expand_hidden_prefixes() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const UseFlagNameCollection> do_use_expand_prefixes() const
+ virtual tr1::shared_ptr<const UseFlagNameSet> do_use_expand_prefixes() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual std::string do_describe_use_flag(const UseFlagName &,
@@ -143,14 +143,14 @@ namespace paludis
const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const QualifiedPackageNameCollection> do_package_names(
+ virtual tr1::shared_ptr<const QualifiedPackageNameSet> do_package_names(
const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const CategoryNamePartCollection> do_category_names() const
+ virtual tr1::shared_ptr<const CategoryNamePartSet> do_category_names() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const CategoryNamePartCollection> do_category_names_containing_package(
+ virtual tr1::shared_ptr<const CategoryNamePartSet> do_category_names_containing_package(
const PackageNamePart &) const;
virtual bool do_has_package_named(const QualifiedPackageName &) const
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 56dd330..62bf3ae 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -19,11 +19,12 @@
#include <paludis/repositories/e/e_repository.hh>
#include <paludis/repositories/e/make_ebuild_repository.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/system.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/map.hh>
+#include <paludis/util/set.hh>
#include <paludis/eapi.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
@@ -55,8 +56,8 @@ namespace test_cases
void run()
{
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_TEST_dir/repo1");
@@ -78,8 +79,8 @@ namespace test_cases
void run()
{
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_TEST_dir/repo2");
@@ -101,8 +102,8 @@ namespace test_cases
void run()
{
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_TEST_dir/repo3");
@@ -124,8 +125,8 @@ namespace test_cases
void run()
{
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_TEST_dir/repo1");
@@ -156,8 +157,8 @@ namespace test_cases
void run()
{
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_TEST_dir/repo1");
@@ -169,7 +170,7 @@ namespace test_cases
{
TestMessageSuffix pass_suffix(stringify(pass), true);
- tr1::shared_ptr<const CategoryNamePartCollection> c(repo->category_names());
+ tr1::shared_ptr<const CategoryNamePartSet> c(repo->category_names());
TEST_CHECK(c->end() != c->find(CategoryNamePart("cat-one")));
TEST_CHECK(c->end() != c->find(CategoryNamePart("cat-two")));
TEST_CHECK(c->end() != c->find(CategoryNamePart("cat-three")));
@@ -190,8 +191,8 @@ namespace test_cases
void run()
{
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_TEST_dir/repo4");
@@ -230,8 +231,8 @@ namespace test_cases
void run()
{
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_TEST_dir/repo4");
@@ -274,8 +275,8 @@ namespace test_cases
void run()
{
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_TEST_dir/repo4");
@@ -283,7 +284,7 @@ namespace test_cases
tr1::shared_ptr<ERepository> repo(make_ebuild_repository(
&env, keys));
- tr1::shared_ptr<const QualifiedPackageNameCollection> names;
+ tr1::shared_ptr<const QualifiedPackageNameSet> names;
for (int pass = 1 ; pass <= 2 ; ++pass)
{
@@ -327,8 +328,8 @@ namespace test_cases
void run()
{
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_TEST_dir/repo5");
@@ -336,7 +337,7 @@ namespace test_cases
tr1::shared_ptr<ERepository> repo(make_ebuild_repository(
&env, keys));
- tr1::shared_ptr<const QualifiedPackageNameCollection> names;
+ tr1::shared_ptr<const QualifiedPackageNameSet> names;
for (int pass = 1 ; pass <= 2 ; ++pass)
{
@@ -359,8 +360,8 @@ namespace test_cases
using namespace tr1::placeholders;
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_TEST_dir/repo4");
@@ -407,8 +408,8 @@ namespace test_cases
using namespace tr1::placeholders;
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_TEST_dir/repo8");
@@ -453,8 +454,8 @@ namespace test_cases
void run()
{
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_TEST_dir/repo6");
@@ -494,8 +495,8 @@ namespace test_cases
TestMessageSuffix opass_suffix("opass=" + stringify(opass), true);
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("write_cache", "e_repository_TEST_dir/repo7/metadata/cache");
@@ -560,8 +561,8 @@ namespace test_cases
void run()
{
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_TEST_dir/repo7");
@@ -594,8 +595,8 @@ namespace test_cases
void run()
{
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_TEST_dir/repo9");
@@ -638,8 +639,8 @@ namespace test_cases
void run()
{
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_TEST_dir/repo10");
diff --git a/paludis/repositories/e/e_repository_news.cc b/paludis/repositories/e/e_repository_news.cc
index c0ab375..6b56df8 100644
--- a/paludis/repositories/e/e_repository_news.cc
+++ b/paludis/repositories/e/e_repository_news.cc
@@ -27,6 +27,7 @@
#include <paludis/util/log.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/query.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
@@ -148,8 +149,8 @@ ERepositoryNews::update_news() const
if (news.begin_display_if_profile() != news.end_display_if_profile())
{
bool local_show(false);
- tr1::shared_ptr<const FSEntryCollection> c(_imp->params.profiles);
- for (FSEntryCollection::Iterator p(c->begin()), p_end(c->end()) ; p != p_end ; ++p)
+ tr1::shared_ptr<const FSEntrySequence> c(_imp->params.profiles);
+ for (FSEntrySequence::Iterator p(c->begin()), p_end(c->end()) ; p != p_end ; ++p)
{
std::string profile(strip_leading_string(strip_trailing_string(
strip_leading_string(stringify(p->realpath()),
diff --git a/paludis/repositories/e/e_repository_params.hh b/paludis/repositories/e/e_repository_params.hh
index 8d2db41..02c1157 100644
--- a/paludis/repositories/e/e_repository_params.hh
+++ b/paludis/repositories/e/e_repository_params.hh
@@ -21,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_E_E_REPOSITORY_PARAMS_HH 1
#include <paludis/util/fs_entry.hh>
-#include <paludis/util/collection.hh>
#include <paludis/util/sr.hh>
/** \file
diff --git a/paludis/repositories/e/e_repository_params.sr b/paludis/repositories/e/e_repository_params.sr
index b1fd33a..aefcaf0 100644
--- a/paludis/repositories/e/e_repository_params.sr
+++ b/paludis/repositories/e/e_repository_params.sr
@@ -9,12 +9,12 @@ make_class_ERepositoryParams()
key layout std::string
key environment "Environment *"
key location FSEntry
- key profiles "tr1::shared_ptr<const FSEntryCollection>"
+ key profiles "tr1::shared_ptr<const FSEntrySequence>"
key cache FSEntry
key write_cache FSEntry
key names_cache FSEntry
key distdir FSEntry
- key eclassdirs "tr1::shared_ptr<const FSEntryCollection>"
+ key eclassdirs "tr1::shared_ptr<const FSEntrySequence>"
key setsdir FSEntry
key securitydir FSEntry
key newsdir FSEntry
diff --git a/paludis/repositories/e/e_repository_profile.cc b/paludis/repositories/e/e_repository_profile.cc
index 007504c..135f1fb 100644
--- a/paludis/repositories/e/e_repository_profile.cc
+++ b/paludis/repositories/e/e_repository_profile.cc
@@ -28,6 +28,8 @@
#include <paludis/util/save.hh>
#include <paludis/util/system.hh>
#include <paludis/util/join.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/set.hh>
#include <paludis/config_file.hh>
#include <paludis/dep_tag.hh>
#include <paludis/environment.hh>
@@ -162,7 +164,7 @@ namespace paludis
///\{
Implementation(const Environment * const e, const ERepository * const p,
- const RepositoryName & name, const FSEntryCollection & dirs,
+ const RepositoryName & name, const FSEntrySequence & dirs,
bool arch_is_special) :
env(e),
repository(p),
@@ -172,7 +174,7 @@ namespace paludis
{
load_environment();
- for (FSEntryCollection::Iterator d(dirs.begin()), d_end(dirs.end()) ;
+ for (FSEntrySequence::Iterator d(dirs.begin()), d_end(dirs.end()) ;
d != d_end ; ++d)
load_profile_directory_recursively(*d);
@@ -586,7 +588,7 @@ Implementation<ERepositoryProfile>::handle_profile_arch_var()
ERepositoryProfile::ERepositoryProfile(
const Environment * const env, const ERepository * const p, const RepositoryName & name,
- const FSEntryCollection & location,
+ const FSEntrySequence & location,
bool arch_is_special) :
PrivateImplementationPattern<ERepositoryProfile>(
new Implementation<ERepositoryProfile>(env, p, name, location, arch_is_special))
@@ -677,7 +679,7 @@ ERepositoryProfile::use_state_ignoring_masks(const UseFlagName & u,
{
if (e.iuse_key())
{
- IUseFlagCollection::Iterator i(e.iuse_key()->value()->find(IUseFlag(u, use_unspecified)));
+ IUseFlagSet::Iterator i(e.iuse_key()->value()->find(IUseFlag(u, use_unspecified)));
if (i != e.iuse_key()->value()->end())
result = i->state;
}
diff --git a/paludis/repositories/e/e_repository_profile.hh b/paludis/repositories/e/e_repository_profile.hh
index 165400a..fa69b6b 100644
--- a/paludis/repositories/e/e_repository_profile.hh
+++ b/paludis/repositories/e/e_repository_profile.hh
@@ -60,7 +60,7 @@ namespace paludis
ERepositoryProfile(const Environment * const env,
const ERepository * const,
const RepositoryName & name,
- const FSEntryCollection & location,
+ const FSEntrySequence & location,
bool arch_is_special);
~ERepositoryProfile();
diff --git a/paludis/repositories/e/e_repository_profile_file.cc b/paludis/repositories/e/e_repository_profile_file.cc
index 071d938..16de693 100644
--- a/paludis/repositories/e/e_repository_profile_file.cc
+++ b/paludis/repositories/e/e_repository_profile_file.cc
@@ -22,6 +22,7 @@
#include <paludis/util/stringify.hh>
#include <paludis/config_file.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/options.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <list>
diff --git a/paludis/repositories/e/e_repository_sets.cc b/paludis/repositories/e/e_repository_sets.cc
index 35db9d5..a26da75 100644
--- a/paludis/repositories/e/e_repository_sets.cc
+++ b/paludis/repositories/e/e_repository_sets.cc
@@ -30,7 +30,6 @@
#include <paludis/version_operator.hh>
#include <paludis/version_requirements.hh>
#include <paludis/portage_dep_parser.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/is_file_with_extension.hh>
@@ -38,9 +37,12 @@
#include <paludis/util/strip.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/tr1_functional.hh>
#include <list>
-#include <paludis/util/tr1_functional.hh>
+#include <map>
#include <set>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
@@ -115,12 +117,12 @@ ERepositorySets::package_set(const SetName & s) const
return tr1::shared_ptr<SetSpecTree::ConstItem>();
}
-tr1::shared_ptr<const SetNameCollection>
+tr1::shared_ptr<const SetNameSet>
ERepositorySets::sets_list() const
{
Context context("While generating the list of sets:");
- tr1::shared_ptr<SetNameCollection> result(new SetNameCollection::Concrete);
+ tr1::shared_ptr<SetNameSet> result(new SetNameSet);
result->insert(SetName("insecurity"));
result->insert(SetName("security"));
result->insert(SetName("system"));
@@ -263,7 +265,7 @@ ERepositorySets::security_set(bool insecurity) const
if (insecurity)
{
- tr1::shared_ptr<VersionRequirements> v(new VersionRequirements::Concrete);
+ tr1::shared_ptr<VersionRequirements> v(new VersionRequirements);
v->push_back(VersionRequirement(vo_equal, (*c)->version()));
tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(
tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName((*c)->name())),
@@ -307,7 +309,7 @@ ERepositorySets::security_set(bool insecurity) const
continue;
}
- tr1::shared_ptr<VersionRequirements> v(new VersionRequirements::Concrete);
+ tr1::shared_ptr<VersionRequirements> v(new VersionRequirements);
v->push_back(VersionRequirement(vo_equal, (*r)->version()));
tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(
tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName((*r)->name())),
diff --git a/paludis/repositories/e/e_repository_sets.hh b/paludis/repositories/e/e_repository_sets.hh
index e5c9fbd..2d8a449 100644
--- a/paludis/repositories/e/e_repository_sets.hh
+++ b/paludis/repositories/e/e_repository_sets.hh
@@ -68,7 +68,7 @@ namespace paludis
/**
* Give a list of all the sets in this repo.
*/
- tr1::shared_ptr<const SetNameCollection> sets_list() const;
+ tr1::shared_ptr<const SetNameSet> sets_list() const;
};
}
diff --git a/paludis/repositories/e/e_repository_sets_TEST.cc b/paludis/repositories/e/e_repository_sets_TEST.cc
index 557b8f0..9355de5 100644
--- a/paludis/repositories/e/e_repository_sets_TEST.cc
+++ b/paludis/repositories/e/e_repository_sets_TEST.cc
@@ -21,10 +21,11 @@
#include <paludis/repositories/e/make_ebuild_repository.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/dep_spec_pretty_printer.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/system.hh>
+#include <paludis/util/map.hh>
+#include <paludis/util/set.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
@@ -52,8 +53,8 @@ namespace test_cases
void run()
{
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_sets_TEST_dir/repo1");
@@ -61,7 +62,7 @@ namespace test_cases
tr1::shared_ptr<ERepository> repo(make_ebuild_repository(
&env, keys));
- tr1::shared_ptr<const SetNameCollection> sets_list(repo->sets_interface->sets_list());
+ tr1::shared_ptr<const SetNameSet> sets_list(repo->sets_interface->sets_list());
TEST_CHECK_EQUAL(sets_list->size(), 4U);
TEST_CHECK(sets_list->end() != sets_list->find(SetName("system")));
TEST_CHECK(sets_list->end() != sets_list->find(SetName("security")));
@@ -81,8 +82,8 @@ namespace test_cases
void run()
{
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_sets_TEST_dir/repo1");
@@ -118,8 +119,8 @@ namespace test_cases
void run()
{
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_sets_TEST_dir/repo1");
@@ -153,8 +154,8 @@ namespace test_cases
void run()
{
TestEnvironment env;
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("location", "e_repository_sets_TEST_dir/repo1");
diff --git a/paludis/repositories/e/ebin.cc b/paludis/repositories/e/ebin.cc
index 4883566..2c1479c 100644
--- a/paludis/repositories/e/ebin.cc
+++ b/paludis/repositories/e/ebin.cc
@@ -23,6 +23,7 @@
#include <paludis/util/system.hh>
#include <paludis/util/log.hh>
#include <paludis/util/strip.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/eapi.hh>
#include <paludis/about.hh>
#include <paludis/package_id.hh>
@@ -74,10 +75,10 @@ EbinCommand::operator() ()
if (use_sandbox())
cmd.with_sandbox();
- tr1::shared_ptr<const FSEntryCollection> syncers_dirs(params.environment->syncers_dirs());
- tr1::shared_ptr<const FSEntryCollection> bashrc_files(params.environment->bashrc_files());
- tr1::shared_ptr<const FSEntryCollection> fetchers_dirs(params.environment->fetchers_dirs());
- tr1::shared_ptr<const FSEntryCollection> hook_dirs(params.environment->hook_dirs());
+ tr1::shared_ptr<const FSEntrySequence> syncers_dirs(params.environment->syncers_dirs());
+ tr1::shared_ptr<const FSEntrySequence> bashrc_files(params.environment->bashrc_files());
+ tr1::shared_ptr<const FSEntrySequence> fetchers_dirs(params.environment->fetchers_dirs());
+ tr1::shared_ptr<const FSEntrySequence> hook_dirs(params.environment->hook_dirs());
cmd = extend_command(cmd
.with_setenv("P", stringify(params.package_id->name().package) + "-" +
diff --git a/paludis/repositories/e/ebin.hh b/paludis/repositories/e/ebin.hh
index 8247d56..7bd658b 100644
--- a/paludis/repositories/e/ebin.hh
+++ b/paludis/repositories/e/ebin.hh
@@ -23,7 +23,6 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/collection.hh>
#include <paludis/package_database.hh>
#include <string>
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index effc21f..1830879 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -25,7 +25,8 @@
#include <paludis/util/strip.hh>
#include <paludis/util/pstream.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/collection_concrete.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/map.hh>
#include <paludis/about.hh>
#include <paludis/environment.hh>
@@ -89,10 +90,10 @@ EbuildCommand::operator() ()
cmd.with_uid_gid(params.environment->reduced_uid(), params.environment->reduced_gid());
- tr1::shared_ptr<const FSEntryCollection> syncers_dirs(params.environment->syncers_dirs());
- tr1::shared_ptr<const FSEntryCollection> bashrc_files(params.environment->bashrc_files());
- tr1::shared_ptr<const FSEntryCollection> fetchers_dirs(params.environment->fetchers_dirs());
- tr1::shared_ptr<const FSEntryCollection> hook_dirs(params.environment->hook_dirs());
+ tr1::shared_ptr<const FSEntrySequence> syncers_dirs(params.environment->syncers_dirs());
+ tr1::shared_ptr<const FSEntrySequence> bashrc_files(params.environment->bashrc_files());
+ tr1::shared_ptr<const FSEntrySequence> fetchers_dirs(params.environment->fetchers_dirs());
+ tr1::shared_ptr<const FSEntrySequence> hook_dirs(params.environment->hook_dirs());
cmd = extend_command(cmd
.with_setenv("P", stringify(params.package_id->name().package) + "-" +
@@ -236,7 +237,7 @@ bool
EbuildMetadataCommand::do_run_command(const Command & cmd)
{
bool ok(false);
- keys.reset(new AssociativeCollection<std::string, std::string>::Concrete);
+ keys.reset(new Map<std::string, std::string>);
try
{
@@ -264,7 +265,7 @@ EbuildMetadataCommand::do_run_command(const Command & cmd)
{
Log::get_instance()->message(ll_warning, lc_context) << "Could not generate cache for '"
<< *params.package_id << "'";
- keys.reset(new AssociativeCollection<std::string, std::string>::Concrete);
+ keys.reset(new Map<std::string, std::string>);
keys->insert("EAPI", EAPIData::get_instance()->unknown_eapi()->name);
keys->insert("SLOT", "UNKNOWN");
@@ -274,9 +275,9 @@ EbuildMetadataCommand::do_run_command(const Command & cmd)
namespace
{
- std::string get(const tr1::shared_ptr<const AssociativeCollection<std::string, std::string> > & k, const std::string & s)
+ std::string get(const tr1::shared_ptr<const Map<std::string, std::string> > & k, const std::string & s)
{
- AssociativeCollection<std::string, std::string>::Iterator i(k->find(s));
+ Map<std::string, std::string>::Iterator i(k->find(s));
if (k->end() == i)
return "";
return i->second;
@@ -438,7 +439,7 @@ EbuildFetchCommand::extend_command(const Command & cmd)
.with_setenv("PALUDIS_PROFILE_DIRS", join(fetch_params.profiles->begin(),
fetch_params.profiles->end(), " ")));
- for (AssociativeCollection<std::string, std::string>::Iterator
+ for (Map<std::string, std::string>::Iterator
i(fetch_params.expand_vars->begin()),
j(fetch_params.expand_vars->end()) ; i != j ; ++i)
result.with_setenv(i->first, i->second);
@@ -507,7 +508,7 @@ EbuildInstallCommand::extend_command(const Command & cmd)
install_params.profiles->end(), " "))
.with_setenv("SLOT", stringify(install_params.slot)));
- for (AssociativeCollection<std::string, std::string>::Iterator
+ for (Map<std::string, std::string>::Iterator
i(install_params.expand_vars->begin()),
j(install_params.expand_vars->end()) ; i != j ; ++i)
result.with_setenv(i->first, i->second);
@@ -611,10 +612,10 @@ WriteVDBEntryCommand::operator() ()
stringify(params.output_directory) + "' '" +
stringify(params.environment_file) + "'");
- tr1::shared_ptr<const FSEntryCollection> syncers_dirs(params.environment->syncers_dirs());
- tr1::shared_ptr<const FSEntryCollection> bashrc_files(params.environment->bashrc_files());
- tr1::shared_ptr<const FSEntryCollection> fetchers_dirs(params.environment->fetchers_dirs());
- tr1::shared_ptr<const FSEntryCollection> hook_dirs(params.environment->hook_dirs());
+ tr1::shared_ptr<const FSEntrySequence> syncers_dirs(params.environment->syncers_dirs());
+ tr1::shared_ptr<const FSEntrySequence> bashrc_files(params.environment->bashrc_files());
+ tr1::shared_ptr<const FSEntrySequence> fetchers_dirs(params.environment->fetchers_dirs());
+ tr1::shared_ptr<const FSEntrySequence> hook_dirs(params.environment->hook_dirs());
Command cmd(Command(ebuild_cmd)
.with_setenv("PKGMANAGER", PALUDIS_PACKAGE "-" + stringify(PALUDIS_VERSION_MAJOR) + "." +
@@ -686,7 +687,7 @@ EbuildPretendCommand::extend_command(const Command & cmd)
.with_setenv("PALUDIS_PROFILE_DIRS", join(pretend_params.profiles->begin(),
pretend_params.profiles->end(), " ")));
- for (AssociativeCollection<std::string, std::string>::Iterator
+ for (Map<std::string, std::string>::Iterator
i(pretend_params.expand_vars->begin()),
j(pretend_params.expand_vars->end()) ; i != j ; ++i)
result.with_setenv(i->first, i->second);
diff --git a/paludis/repositories/e/ebuild.hh b/paludis/repositories/e/ebuild.hh
index 471a934..e326d20 100644
--- a/paludis/repositories/e/ebuild.hh
+++ b/paludis/repositories/e/ebuild.hh
@@ -21,9 +21,9 @@
#define PALUDIS_GUARD_PALUDIS_EBUILD_HH 1
#include <paludis/util/instantiation_policy.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/collection.hh>
+#include <paludis/util/map-fwd.hh>
#include <paludis/package_database.hh>
#include <string>
@@ -343,7 +343,7 @@ namespace paludis
public EbuildCommand
{
private:
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys;
+ tr1::shared_ptr<Map<std::string, std::string> > keys;
public:
EbuildMetadataCommand(const EbuildCommandParams &);
diff --git a/paludis/repositories/e/ebuild.sr b/paludis/repositories/e/ebuild.sr
index 48cde63..a87cae4 100644
--- a/paludis/repositories/e/ebuild.sr
+++ b/paludis/repositories/e/ebuild.sr
@@ -8,8 +8,8 @@ make_class_EbuildCommandParams()
key ebuild_dir FSEntry
key ebuild_file FSEntry
key files_dir FSEntry
- key eclassdirs "tr1::shared_ptr<const FSEntryCollection>"
- key exlibsdirs "tr1::shared_ptr<const FSEntryCollection>"
+ key eclassdirs "tr1::shared_ptr<const FSEntrySequence>"
+ key exlibsdirs "tr1::shared_ptr<const FSEntrySequence>"
key portdir FSEntry
key distdir FSEntry
key buildroot FSEntry
@@ -38,8 +38,8 @@ make_class_EbuildFetchCommandParams()
key use_expand std::string
key flat_src_uri std::string
key root std::string
- key profiles "tr1::shared_ptr<const FSEntryCollection>"
- key expand_vars "tr1::shared_ptr<const AssociativeCollection<std::string, std::string> >"
+ key profiles "tr1::shared_ptr<const FSEntrySequence>"
+ key expand_vars "tr1::shared_ptr<const Map<std::string, std::string> >"
key safe_resume bool
doxygen_comment << "END"
@@ -62,8 +62,8 @@ make_class_EbuildInstallCommandParams()
key use std::string
key use_expand std::string
key root std::string
- key profiles "tr1::shared_ptr<const FSEntryCollection>"
- key expand_vars "tr1::shared_ptr<const AssociativeCollection<std::string, std::string> >"
+ key profiles "tr1::shared_ptr<const FSEntrySequence>"
+ key expand_vars "tr1::shared_ptr<const Map<std::string, std::string> >"
key disable_cfgpro bool
key debug_build InstallDebugOption
key slot SlotName
@@ -89,8 +89,8 @@ make_class_EbuildPretendCommandParams()
key use std::string
key use_expand std::string
key root std::string
- key profiles "tr1::shared_ptr<const FSEntryCollection>"
- key expand_vars "tr1::shared_ptr<const AssociativeCollection<std::string, std::string> >"
+ key profiles "tr1::shared_ptr<const FSEntrySequence>"
+ key expand_vars "tr1::shared_ptr<const Map<std::string, std::string> >"
doxygen_comment << "END"
/**
diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc
index e19b8e6..a52136a 100644
--- a/paludis/repositories/e/ebuild_entries.cc
+++ b/paludis/repositories/e/ebuild_entries.cc
@@ -30,12 +30,14 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/portage_dep_parser.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/log.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/map.hh>
#include <paludis/util/system.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/visitor-impl.hh>
@@ -143,10 +145,10 @@ namespace
namespace
{
FSEntry
- get_root(tr1::shared_ptr<const DestinationsCollection> destinations)
+ get_root(tr1::shared_ptr<const DestinationsSet> destinations)
{
if (destinations)
- for (DestinationsCollection::Iterator d(destinations->begin()), d_end(destinations->end()) ;
+ for (DestinationsSet::Iterator d(destinations->begin()), d_end(destinations->end()) ;
d != d_end ; ++d)
if ((*d)->installed_interface)
return (*d)->installed_interface->root();
@@ -161,7 +163,7 @@ namespace
std::string use;
if (id.iuse_key())
- for (IUseFlagCollection::Iterator i(id.iuse_key()->value()->begin()),
+ for (IUseFlagSet::Iterator i(id.iuse_key()->value()->begin()),
i_end(id.iuse_key()->value()->end()) ; i != i_end ; ++i)
if (env->query_use(i->flag, id))
use += stringify(i->flag) + " ";
@@ -173,14 +175,14 @@ namespace
return use;
}
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> >
+ tr1::shared_ptr<Map<std::string, std::string> >
make_expand(const Environment * const env,
const PackageID & e,
tr1::shared_ptr<const ERepositoryProfile> profile,
std::string & use)
{
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > expand_vars(
- new AssociativeCollection<std::string, std::string>::Concrete);
+ tr1::shared_ptr<Map<std::string, std::string> > expand_vars(
+ new Map<std::string, std::string>);
for (ERepositoryProfile::UseExpandIterator x(profile->begin_use_expand()),
x_end(profile->end_use_expand()) ; x != x_end ; ++x)
@@ -196,9 +198,9 @@ namespace
create_inserter<UseFlagName>(std::inserter(possible_values, possible_values.end())));
/* possible values from environment */
- tr1::shared_ptr<const UseFlagNameCollection> possible_values_from_env(
+ tr1::shared_ptr<const UseFlagNameSet> possible_values_from_env(
env->known_use_expand_names(*x, e));
- for (UseFlagNameCollection::Iterator i(possible_values_from_env->begin()),
+ for (UseFlagNameSet::Iterator i(possible_values_from_env->begin()),
i_end(possible_values_from_env->end()) ; i != i_end ; ++i)
possible_values.insert(UseFlagName(stringify(*i).substr(lower_x.length() + 1)));
@@ -212,7 +214,7 @@ namespace
use.append(lower_x + "_" + stringify(*u) + " ");
std::string value;
- AssociativeCollection<std::string, std::string>::Iterator i(expand_vars->find(stringify(*x)));
+ Map<std::string, std::string>::Iterator i(expand_vars->find(stringify(*x)));
if (expand_vars->end() != i)
{
value = i->second;
@@ -297,8 +299,8 @@ EbuildEntries::install(const tr1::shared_ptr<const PackageID> & id,
archives.append(" ");
/* add * mirror entries */
- tr1::shared_ptr<const MirrorsCollection> star_mirrors(_imp->params.environment->mirrors("*"));
- for (MirrorsCollection::Iterator m(star_mirrors->begin()), m_end(star_mirrors->end()) ; m != m_end ; ++m)
+ tr1::shared_ptr<const MirrorsSequence> star_mirrors(_imp->params.environment->mirrors("*"));
+ for (MirrorsSequence::Iterator m(star_mirrors->begin()), m_end(star_mirrors->end()) ; m != m_end ; ++m)
flat_src_uri.append(*m + "/" + spec->original_url().substr(pos + 1) + " ");
if (0 == spec->original_url().compare(0, 9, "mirror://"))
@@ -309,14 +311,14 @@ EbuildEntries::install(const tr1::shared_ptr<const PackageID> & id,
if (std::string::npos == spos)
throw PackageInstallActionError("Can't install '" + stringify(*id) + "' since SRC_URI is broken");
- tr1::shared_ptr<const MirrorsCollection> mirrors(_imp->params.environment->mirrors(mirror.substr(0, spos)));
+ tr1::shared_ptr<const MirrorsSequence> mirrors(_imp->params.environment->mirrors(mirror.substr(0, spos)));
if (! _imp->e_repository->is_mirror(mirror.substr(0, spos)) &&
mirrors->empty())
throw PackageInstallActionError("Can't install '" + stringify(*id) +
"' since SRC_URI references unknown mirror:// '" +
mirror.substr(0, spos) + "'");
- for (MirrorsCollection::Iterator m(mirrors->begin()), m_end(mirrors->end()) ; m != m_end ; ++m)
+ for (MirrorsSequence::Iterator m(mirrors->begin()), m_end(mirrors->end()) ; m != m_end ; ++m)
flat_src_uri.append(*m + "/" + mirror.substr(spos + 1) + " ");
for (RepositoryMirrorsInterface::MirrorsIterator
@@ -333,9 +335,9 @@ EbuildEntries::install(const tr1::shared_ptr<const PackageID> & id,
std::string master_mirror(strip_trailing_string(stringify(_imp->e_repository->name()), "x-"));
if (! no_mirror && _imp->e_repository->is_mirror(master_mirror))
{
- tr1::shared_ptr<const MirrorsCollection> repo_mirrors(_imp->params.environment->mirrors(master_mirror));
+ tr1::shared_ptr<const MirrorsSequence> repo_mirrors(_imp->params.environment->mirrors(master_mirror));
- for (MirrorsCollection::Iterator m(repo_mirrors->begin()), m_end(repo_mirrors->end()) ; m != m_end ; ++m)
+ for (MirrorsSequence::Iterator m(repo_mirrors->begin()), m_end(repo_mirrors->end()) ; m != m_end ; ++m)
flat_src_uri.append(*m + "/" + spec->original_url().substr(pos + 1) + " ");
for (RepositoryMirrorsInterface::MirrorsIterator
@@ -392,10 +394,10 @@ EbuildEntries::install(const tr1::shared_ptr<const PackageID> & id,
/* add expand to use (iuse isn't reliable for use_expand things), and make the expand
* environment variables */
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > expand_vars(make_expand(
+ tr1::shared_ptr<Map<std::string, std::string> > expand_vars(make_expand(
_imp->params.environment, *id, p, use));
- tr1::shared_ptr<const FSEntryCollection> exlibsdirs(_imp->e_repository->layout()->exlibsdirs(id->name()));
+ tr1::shared_ptr<const FSEntrySequence> exlibsdirs(_imp->e_repository->layout()->exlibsdirs(id->name()));
/* fetch */
{
@@ -567,7 +569,7 @@ EbuildEntries::get_environment_variable(const tr1::shared_ptr<const PackageID> &
throw EAPIConfigurationError("EAPI '" + id->eapi()->name + "' defines "
+ (c == 0 ? "no" : stringify(c)) + " ebuild variable phases but expected exactly one");
- tr1::shared_ptr<const FSEntryCollection> exlibsdirs(_imp->e_repository->layout()->exlibsdirs(id->name()));
+ tr1::shared_ptr<const FSEntrySequence> exlibsdirs(_imp->e_repository->layout()->exlibsdirs(id->name()));
EbuildVariableCommand cmd(EbuildCommandParams::create()
.environment(_imp->params.environment)
@@ -646,10 +648,10 @@ EbuildEntries::pretend(const tr1::shared_ptr<const PackageID> & id,
return true;
std::string use(make_use(_imp->params.environment, *id, p));
- tr1::shared_ptr<AssociativeCollection<std::string, std::string> > expand_vars(make_expand(
+ tr1::shared_ptr<Map<std::string, std::string> > expand_vars(make_expand(
_imp->params.environment, *id, p, use));
- tr1::shared_ptr<const FSEntryCollection> exlibsdirs(_imp->e_repository->layout()->exlibsdirs(id->name()));
+ tr1::shared_ptr<const FSEntrySequence> exlibsdirs(_imp->e_repository->layout()->exlibsdirs(id->name()));
EAPIPhases phases(id->eapi()->supported->ebuild_phases->ebuild_pretend);
for (EAPIPhases::Iterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index 37315f1..6ff332b 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -22,6 +22,7 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/join.hh>
#include <paludis/util/visitor-impl.hh>
+#include <paludis/util/set.hh>
#include <paludis/dep_spec_pretty_printer.hh>
#include <paludis/eapi.hh>
#include <fstream>
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 91723a7..ff8bb50 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -314,20 +314,20 @@ EbuildID::virtual_for_key() const
return tr1::shared_ptr<const MetadataPackageIDKey>();
}
-const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameCollection> >
+const tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> >
EbuildID::keywords_key() const
{
need_keys_added();
return _imp->keywords;
}
-const tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameCollection> >
+const tr1::shared_ptr<const MetadataSetKey<UseFlagNameSet> >
EbuildID::use_key() const
{
- return tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameCollection> >();
+ return tr1::shared_ptr<const MetadataSetKey<UseFlagNameSet> >();
}
-const tr1::shared_ptr<const MetadataCollectionKey<IUseFlagCollection> >
+const tr1::shared_ptr<const MetadataSetKey<IUseFlagSet> >
EbuildID::iuse_key() const
{
need_keys_added();
@@ -439,7 +439,7 @@ EbuildID::binary_origin_key() const
return tr1::shared_ptr<const MetadataStringKey>();
}
-const tr1::shared_ptr<const MetadataCollectionKey<InheritedCollection> >
+const tr1::shared_ptr<const MetadataSetKey<InheritedSet> >
EbuildID::inherited_key() const
{
return _imp->inherited;
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index 6820b2b..b6d3d44 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -64,10 +64,10 @@ namespace paludis
virtual const tr1::shared_ptr<const EAPI> eapi() const;
virtual const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for_key() const;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameCollection> > keywords_key() const;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameCollection> > use_key() const;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<IUseFlagCollection> > iuse_key() const;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<InheritedCollection> > inherited_key() const;
+ virtual const tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> > keywords_key() const;
+ virtual const tr1::shared_ptr<const MetadataSetKey<UseFlagNameSet> > use_key() const;
+ virtual const tr1::shared_ptr<const MetadataSetKey<IUseFlagSet> > iuse_key() const;
+ virtual const tr1::shared_ptr<const MetadataSetKey<InheritedSet> > inherited_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<LicenseSpecTree> > license_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<ProvideSpecTree> > provide_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > build_dependencies_key() const;
diff --git a/paludis/repositories/e/eclass_mtimes.cc b/paludis/repositories/e/eclass_mtimes.cc
index 041cdfe..60a630c 100644
--- a/paludis/repositories/e/eclass_mtimes.cc
+++ b/paludis/repositories/e/eclass_mtimes.cc
@@ -20,6 +20,8 @@
#include "eclass_mtimes.hh"
#include <paludis/hashed_containers.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/fs_entry.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
@@ -30,17 +32,17 @@ namespace paludis
template<>
struct Implementation<EclassMtimes>
{
- tr1::shared_ptr<const FSEntryCollection> eclass_dirs;
+ tr1::shared_ptr<const FSEntrySequence> eclass_dirs;
mutable MakeHashedMap<std::string, time_t>::Type eclass_mtimes;
- Implementation(tr1::shared_ptr<const FSEntryCollection> d) :
+ Implementation(tr1::shared_ptr<const FSEntrySequence> d) :
eclass_dirs(d)
{
}
};
}
-EclassMtimes::EclassMtimes(tr1::shared_ptr<const FSEntryCollection> d) :
+EclassMtimes::EclassMtimes(tr1::shared_ptr<const FSEntrySequence> d) :
PrivateImplementationPattern<EclassMtimes>(new Implementation<EclassMtimes>(d))
{
}
@@ -57,7 +59,7 @@ EclassMtimes::mtime(const std::string & e) const
return i->second;
time_t r(0);
- for (FSEntryCollection::Iterator d(_imp->eclass_dirs->begin()),
+ for (FSEntrySequence::Iterator d(_imp->eclass_dirs->begin()),
d_end(_imp->eclass_dirs->end()) ; d != d_end ; ++d)
{
FSEntry f(*d / (e + ".eclass"));
diff --git a/paludis/repositories/e/eclass_mtimes.hh b/paludis/repositories/e/eclass_mtimes.hh
index 083f6f4..df96940 100644
--- a/paludis/repositories/e/eclass_mtimes.hh
+++ b/paludis/repositories/e/eclass_mtimes.hh
@@ -21,8 +21,8 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_E_ECLASS_MTIMES_HH 1
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/fs_entry.hh>
-#include <paludis/util/collection.hh>
+#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/tr1_memory.hh>
namespace paludis
{
@@ -40,7 +40,7 @@ namespace paludis
///\name Basic operations
///\{
- EclassMtimes(tr1::shared_ptr<const FSEntryCollection>);
+ EclassMtimes(tr1::shared_ptr<const FSEntrySequence>);
~EclassMtimes();
///\}
diff --git a/paludis/repositories/e/exheres_layout.cc b/paludis/repositories/e/exheres_layout.cc
index 153fd89..0abd938 100644
--- a/paludis/repositories/e/exheres_layout.cc
+++ b/paludis/repositories/e/exheres_layout.cc
@@ -30,17 +30,19 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/strip.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/set.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <paludis/util/tr1_functional.hh>
#include <functional>
#include <algorithm>
+#include <list>
using namespace paludis;
@@ -61,14 +63,14 @@ namespace paludis
mutable PackagesMap package_names;
mutable IDMap ids;
- mutable tr1::shared_ptr<CategoryNamePartCollection> category_names_collection;
+ mutable tr1::shared_ptr<CategoryNamePartSet> category_names_collection;
tr1::shared_ptr<const ERepositoryEntries> entries;
- tr1::shared_ptr<FSEntryCollection> arch_list_files;
- tr1::shared_ptr<FSEntryCollection> repository_mask_files;
- tr1::shared_ptr<FSEntryCollection> profiles_desc_files;
- tr1::shared_ptr<FSEntryCollection> mirror_files;
- tr1::shared_ptr<FSEntryCollection> use_desc_dirs;
+ tr1::shared_ptr<FSEntrySequence> arch_list_files;
+ tr1::shared_ptr<FSEntrySequence> repository_mask_files;
+ tr1::shared_ptr<FSEntrySequence> profiles_desc_files;
+ tr1::shared_ptr<FSEntrySequence> mirror_files;
+ tr1::shared_ptr<FSEntrySequence> use_desc_dirs;
Implementation(const ERepository * const n, const FSEntry & t,
tr1::shared_ptr<const ERepositoryEntries> e) :
@@ -76,11 +78,11 @@ namespace paludis
tree_root(t),
has_category_names(false),
entries(e),
- arch_list_files(new FSEntryCollection::Concrete),
- repository_mask_files(new FSEntryCollection::Concrete),
- profiles_desc_files(new FSEntryCollection::Concrete),
- mirror_files(new FSEntryCollection::Concrete),
- use_desc_dirs(new FSEntryCollection::Concrete)
+ arch_list_files(new FSEntrySequence),
+ repository_mask_files(new FSEntrySequence),
+ profiles_desc_files(new FSEntrySequence),
+ mirror_files(new FSEntrySequence),
+ use_desc_dirs(new FSEntrySequence)
{
}
};
@@ -173,7 +175,7 @@ ExheresLayout::need_package_ids(const QualifiedPackageName & n) const
Context context("When loading versions for '" + stringify(n) + "' in "
+ stringify(_imp->repository->name()) + ":");
- tr1::shared_ptr<PackageIDSequence> v(new PackageIDSequence::Concrete);
+ tr1::shared_ptr<PackageIDSequence> v(new PackageIDSequence);
FSEntry path(_imp->tree_root / "packages" / stringify(n.category) / stringify(n.package));
@@ -256,13 +258,13 @@ ExheresLayout::need_category_names_collection() const
need_category_names();
- _imp->category_names_collection.reset(new CategoryNamePartCollection::Concrete);
+ _imp->category_names_collection.reset(new CategoryNamePartSet);
std::copy(_imp->category_names.begin(), _imp->category_names.end(),
transform_inserter(_imp->category_names_collection->inserter(),
tr1::mem_fn(&std::pair<const CategoryNamePart, bool>::first)));
}
-tr1::shared_ptr<const CategoryNamePartCollection>
+tr1::shared_ptr<const CategoryNamePartSet>
ExheresLayout::category_names() const
{
Context context("When fetching category names in " + stringify(stringify(_imp->repository->name())) + ":");
@@ -271,7 +273,7 @@ ExheresLayout::category_names() const
return _imp->category_names_collection;
}
-tr1::shared_ptr<const QualifiedPackageNameCollection>
+tr1::shared_ptr<const QualifiedPackageNameSet>
ExheresLayout::package_names(const CategoryNamePart & c) const
{
using namespace tr1::placeholders;
@@ -286,7 +288,7 @@ ExheresLayout::package_names(const CategoryNamePart & c) const
need_category_names();
if (_imp->category_names.end() == _imp->category_names.find(c))
- return tr1::shared_ptr<QualifiedPackageNameCollection>(new QualifiedPackageNameCollection::Concrete);
+ return tr1::shared_ptr<QualifiedPackageNameSet>(new QualifiedPackageNameSet);
if ((_imp->tree_root / "packages" / stringify(c)).is_directory_or_symlink_to_directory())
for (DirIterator d(_imp->tree_root / "packages" / stringify(c)), d_end ; d != d_end ; ++d)
@@ -313,7 +315,7 @@ ExheresLayout::package_names(const CategoryNamePart & c) const
_imp->category_names[c] = true;
- tr1::shared_ptr<QualifiedPackageNameCollection> result(new QualifiedPackageNameCollection::Concrete);
+ tr1::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
for (PackagesMap::const_iterator p(_imp->package_names.begin()), p_end(_imp->package_names.end()) ;
p != p_end ; ++p)
@@ -334,7 +336,7 @@ ExheresLayout::package_ids(const QualifiedPackageName & n) const
return _imp->ids.find(n)->second;
}
else
- return tr1::shared_ptr<PackageIDSequence>(new PackageIDSequence::Concrete);
+ return tr1::shared_ptr<PackageIDSequence>(new PackageIDSequence);
}
FSEntry
@@ -361,31 +363,31 @@ ExheresLayout::category_directory(const CategoryNamePart & cat) const
return _imp->tree_root / "packages" / stringify(cat);
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
ExheresLayout::arch_list_files() const
{
return _imp->arch_list_files;
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
ExheresLayout::repository_mask_files() const
{
return _imp->repository_mask_files;
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
ExheresLayout::profiles_desc_files() const
{
return _imp->profiles_desc_files;
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
ExheresLayout::mirror_files() const
{
return _imp->mirror_files;
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
ExheresLayout::use_desc_dirs() const
{
return _imp->use_desc_dirs;
@@ -421,10 +423,10 @@ ExheresLayout::profiles_base_dir() const
return _imp->tree_root / "profiles";
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
ExheresLayout::exlibsdirs(const QualifiedPackageName & q) const
{
- tr1::shared_ptr<FSEntryCollection> result(new FSEntryCollection::Concrete);
+ tr1::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
if (_imp->repository->params().master_repository)
result->push_back(_imp->repository->params().master_repository->params().location / "exlibs");
diff --git a/paludis/repositories/e/exheres_layout.hh b/paludis/repositories/e/exheres_layout.hh
index 9bfd074..b7f159f 100644
--- a/paludis/repositories/e/exheres_layout.hh
+++ b/paludis/repositories/e/exheres_layout.hh
@@ -60,10 +60,10 @@ namespace paludis
virtual bool has_package_named(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const CategoryNamePartCollection> category_names() const
+ virtual tr1::shared_ptr<const CategoryNamePartSet> category_names() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const QualifiedPackageNameCollection> package_names(
+ virtual tr1::shared_ptr<const QualifiedPackageNameSet> package_names(
const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -86,19 +86,19 @@ namespace paludis
virtual FSEntry package_file(const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> arch_list_files() const
+ virtual tr1::shared_ptr<const FSEntrySequence> arch_list_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> repository_mask_files() const
+ virtual tr1::shared_ptr<const FSEntrySequence> repository_mask_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> profiles_desc_files() const
+ virtual tr1::shared_ptr<const FSEntrySequence> profiles_desc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> mirror_files() const
+ virtual tr1::shared_ptr<const FSEntrySequence> mirror_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> use_desc_dirs() const
+ virtual tr1::shared_ptr<const FSEntrySequence> use_desc_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool eapi_ebuild_suffix() const
@@ -107,7 +107,7 @@ namespace paludis
virtual FSEntry profiles_base_dir() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> exlibsdirs(const QualifiedPackageName &) const;
+ virtual tr1::shared_ptr<const FSEntrySequence> exlibsdirs(const QualifiedPackageName &) const;
};
}
diff --git a/paludis/repositories/e/glsa.hh b/paludis/repositories/e/glsa.hh
index 6de46d3..7fa03f8 100644
--- a/paludis/repositories/e/glsa.hh
+++ b/paludis/repositories/e/glsa.hh
@@ -22,6 +22,7 @@
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/sr.hh>
+#include <paludis/util/tr1_memory.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
diff --git a/paludis/repositories/e/layout.cc b/paludis/repositories/e/layout.cc
index 6fa7aa7..cec1ab1 100644
--- a/paludis/repositories/e/layout.cc
+++ b/paludis/repositories/e/layout.cc
@@ -21,7 +21,6 @@
#include <paludis/repositories/e/layout.hh>
#include <paludis/repositories/e/traditional_layout.hh>
#include <paludis/repositories/e/exheres_layout.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/virtual_constructor-impl.hh>
#include <paludis/util/instantiation_policy-impl.hh>
diff --git a/paludis/repositories/e/layout.hh b/paludis/repositories/e/layout.hh
index c7caf83..c223de9 100644
--- a/paludis/repositories/e/layout.hh
+++ b/paludis/repositories/e/layout.hh
@@ -78,10 +78,10 @@ namespace paludis
virtual bool has_package_named(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual tr1::shared_ptr<const CategoryNamePartCollection> category_names() const
+ virtual tr1::shared_ptr<const CategoryNamePartSet> category_names() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual tr1::shared_ptr<const QualifiedPackageNameCollection> package_names(
+ virtual tr1::shared_ptr<const QualifiedPackageNameSet> package_names(
const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
@@ -104,19 +104,19 @@ namespace paludis
virtual FSEntry package_file(const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual tr1::shared_ptr<const FSEntryCollection> arch_list_files() const
+ virtual tr1::shared_ptr<const FSEntrySequence> arch_list_files() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual tr1::shared_ptr<const FSEntryCollection> repository_mask_files() const
+ virtual tr1::shared_ptr<const FSEntrySequence> repository_mask_files() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual tr1::shared_ptr<const FSEntryCollection> profiles_desc_files() const
+ virtual tr1::shared_ptr<const FSEntrySequence> profiles_desc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual tr1::shared_ptr<const FSEntryCollection> mirror_files() const
+ virtual tr1::shared_ptr<const FSEntrySequence> mirror_files() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual tr1::shared_ptr<const FSEntryCollection> use_desc_dirs() const
+ virtual tr1::shared_ptr<const FSEntrySequence> use_desc_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
virtual bool eapi_ebuild_suffix() const
@@ -125,7 +125,7 @@ namespace paludis
virtual FSEntry profiles_base_dir() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual tr1::shared_ptr<const FSEntryCollection> exlibsdirs(const QualifiedPackageName &) const
+ virtual tr1::shared_ptr<const FSEntrySequence> exlibsdirs(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
///\}
diff --git a/paludis/repositories/e/make_ebin_repository.cc b/paludis/repositories/e/make_ebin_repository.cc
index d7019b7..a6c49a1 100644
--- a/paludis/repositories/e/make_ebin_repository.cc
+++ b/paludis/repositories/e/make_ebin_repository.cc
@@ -19,8 +19,9 @@
#include "make_ebin_repository.hh"
#include <paludis/util/log.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/map.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/repositories/e/e_repository_exceptions.hh>
#include <paludis/environment.hh>
#include <paludis/distribution.hh>
@@ -32,7 +33,7 @@ using namespace paludis;
tr1::shared_ptr<ERepository>
paludis::make_ebin_repository(
Environment * const env,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> > m)
+ tr1::shared_ptr<const Map<std::string, std::string> > m)
{
std::string repo_file(m->end() == m->find("repo_file") ? std::string("?") :
m->find("repo_file")->second);
@@ -67,7 +68,7 @@ paludis::make_ebin_repository(
"be used as a master repository");
}
- tr1::shared_ptr<FSEntryCollection> profiles(new FSEntryCollection::Concrete);
+ tr1::shared_ptr<FSEntrySequence> profiles(new FSEntrySequence);
if (m->end() != m->find("profiles"))
WhitespaceTokeniser::get_instance()->tokenise(m->find("profiles")->second,
create_inserter<FSEntry>(std::back_inserter(*profiles)));
@@ -76,12 +77,12 @@ paludis::make_ebin_repository(
{
if (master_repository)
std::copy(master_repository->params().profiles->begin(),
- master_repository->params().profiles->end(), profiles->inserter());
+ master_repository->params().profiles->end(), profiles->back_inserter());
else
throw ERepositoryConfigurationError("No profiles have been specified");
}
- tr1::shared_ptr<FSEntryCollection> eclassdirs(new FSEntryCollection::Concrete);
+ tr1::shared_ptr<FSEntrySequence> eclassdirs(new FSEntrySequence);
std::string setsdir;
if (m->end() == m->find("setsdir") || ((setsdir = m->find("setsdir")->second)).empty())
@@ -170,7 +171,7 @@ paludis::make_ebin_repository(
.cache(FSEntry("/var/empty"))
.write_cache(FSEntry("/var/empty"))
.names_cache(names_cache)
- .eclassdirs(tr1::shared_ptr<const FSEntryCollection>(new FSEntryCollection::Concrete))
+ .eclassdirs(tr1::shared_ptr<const FSEntrySequence>(new FSEntrySequence))
.distdir(FSEntry("/var/empty"))
.securitydir(securitydir)
.setsdir(setsdir)
@@ -188,7 +189,7 @@ paludis::make_ebin_repository(
tr1::shared_ptr<Repository>
paludis::make_ebin_repository_wrapped(
Environment * const env,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> > m)
+ tr1::shared_ptr<const Map<std::string, std::string> > m)
{
return make_ebin_repository(env, m);
}
diff --git a/paludis/repositories/e/make_ebin_repository.hh b/paludis/repositories/e/make_ebin_repository.hh
index dee233b..aaa8644 100644
--- a/paludis/repositories/e/make_ebin_repository.hh
+++ b/paludis/repositories/e/make_ebin_repository.hh
@@ -21,6 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_GENTOO_MAKE_EBIN_REPOSITORY_HH 1
#include <paludis/repositories/e/e_repository.hh>
+#include <paludis/util/map-fwd.hh>
namespace paludis
{
@@ -33,7 +34,7 @@ namespace paludis
tr1::shared_ptr<ERepository>
make_ebin_repository(
Environment * const,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> >) PALUDIS_VISIBLE;
+ tr1::shared_ptr<const Map<std::string, std::string> >) PALUDIS_VISIBLE;
/**
* Create an ebin format repository (wrapper for our virtual constructor).
@@ -44,7 +45,7 @@ namespace paludis
tr1::shared_ptr<Repository>
make_ebin_repository_wrapped(
Environment * const env,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> > m);
+ tr1::shared_ptr<const Map<std::string, std::string> > m);
}
diff --git a/paludis/repositories/e/make_ebuild_repository.cc b/paludis/repositories/e/make_ebuild_repository.cc
index a3b9b24..0fd8c9b 100644
--- a/paludis/repositories/e/make_ebuild_repository.cc
+++ b/paludis/repositories/e/make_ebuild_repository.cc
@@ -19,8 +19,9 @@
#include "make_ebuild_repository.hh"
#include <paludis/util/log.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/map.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/repositories/e/e_repository_exceptions.hh>
#include <paludis/environment.hh>
#include <paludis/distribution.hh>
@@ -32,7 +33,7 @@ using namespace paludis;
tr1::shared_ptr<ERepository>
paludis::make_ebuild_repository(
Environment * const env,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> > m)
+ tr1::shared_ptr<const Map<std::string, std::string> > m)
{
std::string repo_file(m->end() == m->find("repo_file") ? std::string("?") :
m->find("repo_file")->second);
@@ -67,7 +68,7 @@ paludis::make_ebuild_repository(
"be used as a master repository");
}
- tr1::shared_ptr<FSEntryCollection> profiles(new FSEntryCollection::Concrete);
+ tr1::shared_ptr<FSEntrySequence> profiles(new FSEntrySequence);
if (m->end() != m->find("profiles"))
WhitespaceTokeniser::get_instance()->tokenise(m->find("profiles")->second,
create_inserter<FSEntry>(std::back_inserter(*profiles)));
@@ -76,12 +77,12 @@ paludis::make_ebuild_repository(
{
if (master_repository)
std::copy(master_repository->params().profiles->begin(),
- master_repository->params().profiles->end(), profiles->inserter());
+ master_repository->params().profiles->end(), profiles->back_inserter());
else
throw ERepositoryConfigurationError("No profiles have been specified");
}
- tr1::shared_ptr<FSEntryCollection> eclassdirs(new FSEntryCollection::Concrete);
+ tr1::shared_ptr<FSEntrySequence> eclassdirs(new FSEntrySequence);
if (m->end() != m->find("eclassdirs"))
WhitespaceTokeniser::get_instance()->tokenise(m->find("eclassdirs")->second,
@@ -91,7 +92,7 @@ paludis::make_ebuild_repository(
{
if (master_repository)
std::copy(master_repository->params().eclassdirs->begin(),
- master_repository->params().eclassdirs->end(), eclassdirs->inserter());
+ master_repository->params().eclassdirs->end(), eclassdirs->back_inserter());
eclassdirs->push_back(location + "/eclass");
}
@@ -215,7 +216,7 @@ paludis::make_ebuild_repository(
tr1::shared_ptr<Repository>
paludis::make_ebuild_repository_wrapped(
Environment * const env,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> > m)
+ tr1::shared_ptr<const Map<std::string, std::string> > m)
{
return make_ebuild_repository(env, m);
}
diff --git a/paludis/repositories/e/make_ebuild_repository.hh b/paludis/repositories/e/make_ebuild_repository.hh
index fe4e182..7cc482d 100644
--- a/paludis/repositories/e/make_ebuild_repository.hh
+++ b/paludis/repositories/e/make_ebuild_repository.hh
@@ -21,6 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_E_MAKE_EBUILD_REPOSITORY_HH 1
#include <paludis/repositories/e/e_repository.hh>
+#include <paludis/util/map-fwd.hh>
namespace paludis
{
@@ -33,7 +34,7 @@ namespace paludis
tr1::shared_ptr<ERepository>
make_ebuild_repository(
Environment * const,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> >) PALUDIS_VISIBLE;
+ tr1::shared_ptr<const Map<std::string, std::string> >) PALUDIS_VISIBLE;
/**
* Create an ebuild format repository (wrapper for our virtual constructor).
@@ -44,7 +45,7 @@ namespace paludis
tr1::shared_ptr<Repository>
make_ebuild_repository_wrapped(
Environment * const env,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> > m);
+ tr1::shared_ptr<const Map<std::string, std::string> > m);
}
#endif
diff --git a/paludis/repositories/e/qa/qa_controller.cc b/paludis/repositories/e/qa/qa_controller.cc
index ff2838d..47f003b 100644
--- a/paludis/repositories/e/qa/qa_controller.cc
+++ b/paludis/repositories/e/qa/qa_controller.cc
@@ -22,6 +22,7 @@
#include <paludis/repositories/e/e_repository.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/set.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
@@ -90,8 +91,8 @@ QAController::run()
tr1::bind<bool>(tr1::mem_fn(&TreeCheckFunction::operator() ),
_1, tr1::ref(_imp->reporter), _imp->env, _imp->repo, _imp->repo->params().location)));
- tr1::shared_ptr<const CategoryNamePartCollection> categories(_imp->repo->category_names());
- for (CategoryNamePartCollection::Iterator c(categories->begin()), c_end(categories->end()) ;
+ tr1::shared_ptr<const CategoryNamePartSet> categories(_imp->repo->category_names());
+ for (CategoryNamePartSet::Iterator c(categories->begin()), c_end(categories->end()) ;
c != c_end ; ++c)
std::find_if(
QAChecks::get_instance()->category_dir_checks_group()->begin(),
diff --git a/paludis/repositories/e/registration.cc b/paludis/repositories/e/registration.cc
index 7656a9b..3fde466 100644
--- a/paludis/repositories/e/registration.cc
+++ b/paludis/repositories/e/registration.cc
@@ -22,6 +22,7 @@
#include <paludis/repositories/e/make_ebin_repository.hh>
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/util/log.hh>
+#include <paludis/util/map.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include "config.h"
@@ -40,7 +41,7 @@ namespace
tr1::shared_ptr<Repository>
make_portage_repository(
Environment * const env,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> > m)
+ tr1::shared_ptr<const Map<std::string, std::string> > m)
{
std::string repo_file = "?";
if (m->end() != m->find("repo_file"))
diff --git a/paludis/repositories/e/traditional_layout.cc b/paludis/repositories/e/traditional_layout.cc
index 8fb5ee8..a4fd202 100644
--- a/paludis/repositories/e/traditional_layout.cc
+++ b/paludis/repositories/e/traditional_layout.cc
@@ -29,15 +29,17 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/strip.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/set.hh>
#include <paludis/util/tr1_functional.hh>
#include <functional>
#include <algorithm>
+#include <list>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
@@ -61,14 +63,14 @@ namespace paludis
mutable PackagesMap package_names;
mutable IDMap ids;
- mutable tr1::shared_ptr<CategoryNamePartCollection> category_names_collection;
+ mutable tr1::shared_ptr<CategoryNamePartSet> category_names_collection;
tr1::shared_ptr<const ERepositoryEntries> entries;
- tr1::shared_ptr<FSEntryCollection> arch_list_files;
- tr1::shared_ptr<FSEntryCollection> repository_mask_files;
- tr1::shared_ptr<FSEntryCollection> profiles_desc_files;
- tr1::shared_ptr<FSEntryCollection> mirror_files;
- tr1::shared_ptr<FSEntryCollection> use_desc_dirs;
+ tr1::shared_ptr<FSEntrySequence> arch_list_files;
+ tr1::shared_ptr<FSEntrySequence> repository_mask_files;
+ tr1::shared_ptr<FSEntrySequence> profiles_desc_files;
+ tr1::shared_ptr<FSEntrySequence> mirror_files;
+ tr1::shared_ptr<FSEntrySequence> use_desc_dirs;
Implementation(const ERepository * const r, const FSEntry & t,
tr1::shared_ptr<const ERepositoryEntries> e) :
@@ -76,11 +78,11 @@ namespace paludis
tree_root(t),
has_category_names(false),
entries(e),
- arch_list_files(new FSEntryCollection::Concrete),
- repository_mask_files(new FSEntryCollection::Concrete),
- profiles_desc_files(new FSEntryCollection::Concrete),
- mirror_files(new FSEntryCollection::Concrete),
- use_desc_dirs(new FSEntryCollection::Concrete)
+ arch_list_files(new FSEntrySequence),
+ repository_mask_files(new FSEntrySequence),
+ profiles_desc_files(new FSEntrySequence),
+ mirror_files(new FSEntrySequence),
+ use_desc_dirs(new FSEntrySequence)
{
}
};
@@ -193,7 +195,7 @@ TraditionalLayout::need_package_ids(const QualifiedPackageName & n) const
Context context("When loading versions for '" + stringify(n) + "' in "
+ stringify(_imp->repository->name()) + ":");
- tr1::shared_ptr<PackageIDSequence> v(new PackageIDSequence::Concrete);
+ tr1::shared_ptr<PackageIDSequence> v(new PackageIDSequence);
FSEntry path(_imp->tree_root / stringify(n.category) / stringify(n.package));
@@ -275,13 +277,13 @@ TraditionalLayout::need_category_names_collection() const
need_category_names();
- _imp->category_names_collection.reset(new CategoryNamePartCollection::Concrete);
+ _imp->category_names_collection.reset(new CategoryNamePartSet);
std::copy(_imp->category_names.begin(), _imp->category_names.end(),
transform_inserter(_imp->category_names_collection->inserter(),
tr1::mem_fn(&std::pair<const CategoryNamePart, bool>::first)));
}
-tr1::shared_ptr<const CategoryNamePartCollection>
+tr1::shared_ptr<const CategoryNamePartSet>
TraditionalLayout::category_names() const
{
Context context("When fetching category names in " + stringify(stringify(_imp->repository->name())) + ":");
@@ -290,7 +292,7 @@ TraditionalLayout::category_names() const
return _imp->category_names_collection;
}
-tr1::shared_ptr<const QualifiedPackageNameCollection>
+tr1::shared_ptr<const QualifiedPackageNameSet>
TraditionalLayout::package_names(const CategoryNamePart & c) const
{
using namespace tr1::placeholders;
@@ -305,7 +307,7 @@ TraditionalLayout::package_names(const CategoryNamePart & c) const
need_category_names();
if (_imp->category_names.end() == _imp->category_names.find(c))
- return tr1::shared_ptr<QualifiedPackageNameCollection>(new QualifiedPackageNameCollection::Concrete);
+ return tr1::shared_ptr<QualifiedPackageNameSet>(new QualifiedPackageNameSet);
if ((_imp->tree_root / stringify(c)).is_directory_or_symlink_to_directory())
for (DirIterator d(_imp->tree_root / stringify(c)), d_end ; d != d_end ; ++d)
@@ -332,7 +334,7 @@ TraditionalLayout::package_names(const CategoryNamePart & c) const
_imp->category_names[c] = true;
- tr1::shared_ptr<QualifiedPackageNameCollection> result(new QualifiedPackageNameCollection::Concrete);
+ tr1::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
for (PackagesMap::const_iterator p(_imp->package_names.begin()), p_end(_imp->package_names.end()) ;
p != p_end ; ++p)
@@ -353,7 +355,7 @@ TraditionalLayout::package_ids(const QualifiedPackageName & n) const
return _imp->ids.find(n)->second;
}
else
- return tr1::shared_ptr<PackageIDSequence>(new PackageIDSequence::Concrete);
+ return tr1::shared_ptr<PackageIDSequence>(new PackageIDSequence);
}
FSEntry
@@ -380,31 +382,31 @@ TraditionalLayout::category_directory(const CategoryNamePart & cat) const
return _imp->tree_root / stringify(cat);
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
TraditionalLayout::arch_list_files() const
{
return _imp->arch_list_files;
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
TraditionalLayout::repository_mask_files() const
{
return _imp->repository_mask_files;
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
TraditionalLayout::profiles_desc_files() const
{
return _imp->profiles_desc_files;
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
TraditionalLayout::mirror_files() const
{
return _imp->mirror_files;
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
TraditionalLayout::use_desc_dirs() const
{
return _imp->use_desc_dirs;
@@ -440,10 +442,10 @@ TraditionalLayout::profiles_base_dir() const
return _imp->tree_root / "profiles";
}
-tr1::shared_ptr<const FSEntryCollection>
+tr1::shared_ptr<const FSEntrySequence>
TraditionalLayout::exlibsdirs(const QualifiedPackageName & q) const
{
- tr1::shared_ptr<FSEntryCollection> result(new FSEntryCollection::Concrete);
+ tr1::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
if (_imp->repository->params().master_repository)
result->push_back(_imp->repository->params().master_repository->params().location / "exlibs");
diff --git a/paludis/repositories/e/traditional_layout.hh b/paludis/repositories/e/traditional_layout.hh
index 76e9e8e..9b97305 100644
--- a/paludis/repositories/e/traditional_layout.hh
+++ b/paludis/repositories/e/traditional_layout.hh
@@ -61,10 +61,10 @@ namespace paludis
virtual bool has_package_named(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const CategoryNamePartCollection> category_names() const
+ virtual tr1::shared_ptr<const CategoryNamePartSet> category_names() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const QualifiedPackageNameCollection> package_names(
+ virtual tr1::shared_ptr<const QualifiedPackageNameSet> package_names(
const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -87,19 +87,19 @@ namespace paludis
virtual FSEntry package_file(const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> arch_list_files() const
+ virtual tr1::shared_ptr<const FSEntrySequence> arch_list_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> repository_mask_files() const
+ virtual tr1::shared_ptr<const FSEntrySequence> repository_mask_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> profiles_desc_files() const
+ virtual tr1::shared_ptr<const FSEntrySequence> profiles_desc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> mirror_files() const
+ virtual tr1::shared_ptr<const FSEntrySequence> mirror_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> use_desc_dirs() const
+ virtual tr1::shared_ptr<const FSEntrySequence> use_desc_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool eapi_ebuild_suffix() const
@@ -108,7 +108,7 @@ namespace paludis
virtual FSEntry profiles_base_dir() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntryCollection> exlibsdirs(const QualifiedPackageName &) const
+ virtual tr1::shared_ptr<const FSEntrySequence> exlibsdirs(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
diff --git a/paludis/repositories/e/vdb_id.cc b/paludis/repositories/e/vdb_id.cc
index ba9fad2..f5ca6e1 100644
--- a/paludis/repositories/e/vdb_id.cc
+++ b/paludis/repositories/e/vdb_id.cc
@@ -65,9 +65,9 @@ namespace paludis
tr1::shared_ptr<const SlotName> slot;
tr1::shared_ptr<const EAPI> eapi;
- tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameCollection> > use;
- tr1::shared_ptr<const MetadataCollectionKey<InheritedCollection> > inherited;
- tr1::shared_ptr<const MetadataCollectionKey<IUseFlagCollection> > iuse;
+ tr1::shared_ptr<const MetadataSetKey<UseFlagNameSet> > use;
+ tr1::shared_ptr<const MetadataSetKey<InheritedSet> > inherited;
+ tr1::shared_ptr<const MetadataSetKey<IUseFlagSet> > iuse;
tr1::shared_ptr<const MetadataSpecTreeKey<LicenseSpecTree> > license;
tr1::shared_ptr<const MetadataSpecTreeKey<ProvideSpecTree> > provide;
tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > build_dependencies;
@@ -385,27 +385,27 @@ VDBID::virtual_for_key() const
return tr1::shared_ptr<const MetadataPackageIDKey>();
}
-const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameCollection> >
+const tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> >
VDBID::keywords_key() const
{
- return tr1::shared_ptr<const MetadataCollectionKey<KeywordNameCollection> >();
+ return tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> >();
}
-const tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameCollection> >
+const tr1::shared_ptr<const MetadataSetKey<UseFlagNameSet> >
VDBID::use_key() const
{
need_keys_added();
return _imp->use;
}
-const tr1::shared_ptr<const MetadataCollectionKey<IUseFlagCollection> >
+const tr1::shared_ptr<const MetadataSetKey<IUseFlagSet> >
VDBID::iuse_key() const
{
need_keys_added();
return _imp->iuse;
}
-const tr1::shared_ptr<const MetadataCollectionKey<InheritedCollection> >
+const tr1::shared_ptr<const MetadataSetKey<InheritedSet> >
VDBID::inherited_key() const
{
need_keys_added();
diff --git a/paludis/repositories/e/vdb_id.hh b/paludis/repositories/e/vdb_id.hh
index 2c14db3..3eee1cd 100644
--- a/paludis/repositories/e/vdb_id.hh
+++ b/paludis/repositories/e/vdb_id.hh
@@ -57,10 +57,10 @@ namespace paludis
virtual const tr1::shared_ptr<const EAPI> eapi() const;
virtual const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for_key() const;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameCollection> > keywords_key() const;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameCollection> > use_key() const;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<InheritedCollection> > inherited_key() const;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<IUseFlagCollection> > iuse_key() const;
+ virtual const tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> > keywords_key() const;
+ virtual const tr1::shared_ptr<const MetadataSetKey<UseFlagNameSet> > use_key() const;
+ virtual const tr1::shared_ptr<const MetadataSetKey<InheritedSet> > inherited_key() const;
+ virtual const tr1::shared_ptr<const MetadataSetKey<IUseFlagSet> > iuse_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<LicenseSpecTree> > license_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<ProvideSpecTree> > provide_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > build_dependencies_key() const;
diff --git a/paludis/repositories/e/vdb_merger.cc b/paludis/repositories/e/vdb_merger.cc
index 4d80a75..5bc6c2f 100644
--- a/paludis/repositories/e/vdb_merger.cc
+++ b/paludis/repositories/e/vdb_merger.cc
@@ -23,6 +23,8 @@
#include <paludis/util/system.hh>
#include <paludis/util/join.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/fs_entry.hh>
#include <paludis/hook.hh>
#include <paludis/package_id.hh>
#include <paludis/digests/md5.hh>
@@ -78,7 +80,7 @@ VDBMerger::~VDBMerger()
Hook
VDBMerger::extend_hook(const Hook & h)
{
- tr1::shared_ptr<const FSEntryCollection> bashrc_files(_imp->options.environment->bashrc_files());
+ tr1::shared_ptr<const FSEntrySequence> bashrc_files(_imp->options.environment->bashrc_files());
if (_imp->options.package_id)
{
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 2a19706..e2f2589 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -46,7 +46,6 @@
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/tr1_functional.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/fast_unique_copy.hh>
#include <paludis/util/fs_entry.hh>
@@ -54,6 +53,9 @@
#include <paludis/util/iterator.hh>
#include <paludis/util/log.hh>
#include <paludis/util/pstream.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/map.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/strip.hh>
@@ -81,7 +83,7 @@ using namespace paludis::erepository;
#include <paludis/repositories/e/vdb_repository-sr.cc>
-typedef MakeHashedMap<CategoryNamePart, tr1::shared_ptr<QualifiedPackageNameCollection> >::Type CategoryMap;
+typedef MakeHashedMap<CategoryNamePart, tr1::shared_ptr<QualifiedPackageNameSet> >::Type CategoryMap;
typedef MakeHashedMap<QualifiedPackageName, tr1::shared_ptr<PackageIDSequence> >::Type IDMap;
namespace paludis
@@ -190,33 +192,33 @@ VDBRepository::do_has_package_named(const QualifiedPackageName & q) const
return cat_iter->second->end() != cat_iter->second->find(q);
}
-tr1::shared_ptr<const CategoryNamePartCollection>
+tr1::shared_ptr<const CategoryNamePartSet>
VDBRepository::do_category_names() const
{
Context context("When fetching category names in " + stringify(name()) + ":");
need_category_names();
- tr1::shared_ptr<CategoryNamePartCollection> result(new CategoryNamePartCollection::Concrete);
+ tr1::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
std::copy(_imp->categories.begin(), _imp->categories.end(),
transform_inserter(result->inserter(),
- tr1::mem_fn(&std::pair<const CategoryNamePart, tr1::shared_ptr<QualifiedPackageNameCollection> >::first)));
+ tr1::mem_fn(&std::pair<const CategoryNamePart, tr1::shared_ptr<QualifiedPackageNameSet> >::first)));
return result;
}
-tr1::shared_ptr<const QualifiedPackageNameCollection>
+tr1::shared_ptr<const QualifiedPackageNameSet>
VDBRepository::do_package_names(const CategoryNamePart & c) const
{
Context context("When fetching package names in category '" + stringify(c)
+ "' in " + stringify(name()) + ":");
- tr1::shared_ptr<QualifiedPackageNameCollection> result(new QualifiedPackageNameCollection::Concrete);
+ tr1::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
need_category_names();
if (! has_category_named(c))
- return make_shared_ptr(new QualifiedPackageNameCollection::Concrete);
+ return make_shared_ptr(new QualifiedPackageNameSet);
need_package_ids(c);
@@ -232,11 +234,11 @@ VDBRepository::do_package_ids(const QualifiedPackageName & n) const
need_category_names();
if (! has_category_named(n.category))
- return make_shared_ptr(new PackageIDSequence::Concrete);
+ return make_shared_ptr(new PackageIDSequence);
need_package_ids(n.category);
if (! has_package_named(n))
- return make_shared_ptr(new PackageIDSequence::Concrete);
+ return make_shared_ptr(new PackageIDSequence);
return _imp->ids.find(n)->second;
}
@@ -268,7 +270,7 @@ VDBRepository::do_query_use_force(const UseFlagName & u, const PackageID & e) co
tr1::shared_ptr<Repository>
VDBRepository::make_vdb_repository(
Environment * const env,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> > m)
+ tr1::shared_ptr<const Map<std::string, std::string> > m)
{
std::string repo_file(m->end() == m->find("repo_file") ? std::string("?") : m->find("repo_file")->second);
Context context("When making VDB repository from repo_file '" + repo_file + "':");
@@ -347,7 +349,7 @@ VDBRepository::_uninstall(const tr1::shared_ptr<const PackageID> & id,
std::string reinstalling_str(reinstalling ? "-reinstalling-" : "");
- tr1::shared_ptr<FSEntryCollection> eclassdirs(new FSEntryCollection::Concrete);
+ tr1::shared_ptr<FSEntrySequence> eclassdirs(new FSEntrySequence);
eclassdirs->push_back(FSEntry(_imp->params.location / stringify(id->name().category) /
(reinstalling_str + stringify(id->name().package) + "-" + stringify(id->version()))));
@@ -395,7 +397,7 @@ VDBRepository::_uninstall(const tr1::shared_ptr<const PackageID> & id,
.ebuild_file(pkg_dir / (stringify(id->name().package) + "-" + stringify(id->version()) + ".ebuild"))
.files_dir(pkg_dir)
.eclassdirs(eclassdirs)
- .exlibsdirs(make_shared_ptr(new FSEntryCollection::Concrete))
+ .exlibsdirs(make_shared_ptr(new FSEntrySequence))
.portdir(_imp->params.location)
.distdir(pkg_dir)
.sandbox(phase->option("sandbox"))
@@ -430,7 +432,7 @@ VDBRepository::do_config(const tr1::shared_ptr<const PackageID> & id) const
throw PackageInstallActionError("Couldn't configure '" + stringify(*id) +
"' because root ('" + stringify(_imp->params.root) + "') is not a directory");
- tr1::shared_ptr<FSEntryCollection> eclassdirs(new FSEntryCollection::Concrete);
+ tr1::shared_ptr<FSEntrySequence> eclassdirs(new FSEntrySequence);
eclassdirs->push_back(FSEntry(_imp->params.location / stringify(id->name().category) /
(stringify(id->name().package) + "-" + stringify(id->version()))));
@@ -450,7 +452,7 @@ VDBRepository::do_config(const tr1::shared_ptr<const PackageID> & id) const
.ebuild_file(pkg_dir / (stringify(id->name().package) + "-" + stringify(id->version()) + ".ebuild"))
.files_dir(pkg_dir)
.eclassdirs(eclassdirs)
- .exlibsdirs(make_shared_ptr(new FSEntryCollection::Concrete))
+ .exlibsdirs(make_shared_ptr(new FSEntrySequence))
.portdir(_imp->params.location)
.distdir(pkg_dir)
.sandbox(phase->option("sandbox"))
@@ -484,11 +486,11 @@ VDBRepository::do_package_set(const SetName & s) const
std::for_each(_imp->categories.begin(), _imp->categories.end(),
tr1::bind(tr1::mem_fn(&VDBRepository::need_package_ids), this,
tr1::bind<CategoryNamePart>(tr1::mem_fn(
- &std::pair<const CategoryNamePart, tr1::shared_ptr<QualifiedPackageNameCollection> >::first), _1)));
+ &std::pair<const CategoryNamePart, tr1::shared_ptr<QualifiedPackageNameSet> >::first), _1)));
for (CategoryMap::const_iterator i(_imp->categories.begin()), i_end(_imp->categories.end()) ;
i != i_end ; ++i)
- for (QualifiedPackageNameCollection::Iterator e(i->second->begin()), e_end(i->second->end()) ;
+ for (QualifiedPackageNameSet::Iterator e(i->second->begin()), e_end(i->second->end()) ;
e != e_end ; ++e)
{
tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(
@@ -525,12 +527,12 @@ VDBRepository::do_package_set(const SetName & s) const
return tr1::shared_ptr<SetSpecTree::ConstItem>();
}
-tr1::shared_ptr<const SetNameCollection>
+tr1::shared_ptr<const SetNameSet>
VDBRepository::sets_list() const
{
Context context("While generating the list of sets:");
- tr1::shared_ptr<SetNameCollection> result(new SetNameCollection::Concrete);
+ tr1::shared_ptr<SetNameSet> result(new SetNameSet);
result->insert(SetName("everything"));
result->insert(SetName("world"));
return result;
@@ -665,28 +667,28 @@ VDBRepository::provided_packages() const
return _imp->provides;
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
VDBRepository::do_arch_flags() const
{
- return tr1::shared_ptr<const UseFlagNameCollection>(new UseFlagNameCollection::Concrete);
+ return tr1::shared_ptr<const UseFlagNameSet>(new UseFlagNameSet);
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
VDBRepository::do_use_expand_flags() const
{
- return tr1::shared_ptr<const UseFlagNameCollection>(new UseFlagNameCollection::Concrete);
+ return tr1::shared_ptr<const UseFlagNameSet>(new UseFlagNameSet);
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
VDBRepository::do_use_expand_prefixes() const
{
- return tr1::shared_ptr<const UseFlagNameCollection>(new UseFlagNameCollection::Concrete);
+ return tr1::shared_ptr<const UseFlagNameSet>(new UseFlagNameSet);
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
VDBRepository::do_use_expand_hidden_prefixes() const
{
- return tr1::shared_ptr<const UseFlagNameCollection>(new UseFlagNameCollection::Concrete);
+ return tr1::shared_ptr<const UseFlagNameSet>(new UseFlagNameSet);
}
bool
@@ -697,7 +699,7 @@ VDBRepository::load_provided_using_cache() const
Context context("When loading VDB PROVIDEs map using '" + stringify(_imp->params.provides_cache) + "':");
- tr1::shared_ptr<ProvidesSequence> result(new ProvidesSequence::Concrete);
+ tr1::shared_ptr<ProvidesSequence> result(new ProvidesSequence);
if (! _imp->params.provides_cache.is_regular_file())
{
@@ -771,13 +773,13 @@ VDBRepository::load_provided_the_slow_way() const
Log::get_instance()->message(ll_debug, lc_no_context, "Starting VDB PROVIDEs map creation");
- tr1::shared_ptr<ProvidesSequence> result(new ProvidesSequence::Concrete);
+ tr1::shared_ptr<ProvidesSequence> result(new ProvidesSequence);
need_category_names();
std::for_each(_imp->categories.begin(), _imp->categories.end(),
tr1::bind(tr1::mem_fn(&VDBRepository::need_package_ids), this,
tr1::bind<CategoryNamePart>(tr1::mem_fn(
- &std::pair<const CategoryNamePart, tr1::shared_ptr<QualifiedPackageNameCollection> >::first), _1)));
+ &std::pair<const CategoryNamePart, tr1::shared_ptr<QualifiedPackageNameSet> >::first), _1)));
for (IDMap::const_iterator i(_imp->ids.begin()), i_end(_imp->ids.end()) ;
@@ -853,7 +855,7 @@ VDBRepository::regenerate_provides_cache() const
std::for_each(_imp->categories.begin(), _imp->categories.end(),
tr1::bind(tr1::mem_fn(&VDBRepository::need_package_ids), this,
tr1::bind<CategoryNamePart>(tr1::mem_fn(
- &std::pair<const CategoryNamePart, tr1::shared_ptr<QualifiedPackageNameCollection> >::first), _1)));
+ &std::pair<const CategoryNamePart, tr1::shared_ptr<QualifiedPackageNameSet> >::first), _1)));
std::ofstream f(stringify(_imp->params.provides_cache).c_str());
if (! f)
@@ -887,13 +889,13 @@ VDBRepository::regenerate_provides_cache() const
}
}
-tr1::shared_ptr<const CategoryNamePartCollection>
+tr1::shared_ptr<const CategoryNamePartSet>
VDBRepository::do_category_names_containing_package(const PackageNamePart & p) const
{
if (! _imp->names_cache->usable())
return Repository::do_category_names_containing_package(p);
- tr1::shared_ptr<const CategoryNamePartCollection> result(
+ tr1::shared_ptr<const CategoryNamePartSet> result(
_imp->names_cache->category_names_containing_package(p));
return result ? result : Repository::do_category_names_containing_package(p);
@@ -1040,7 +1042,7 @@ VDBRepository::need_category_names() const
{
if (d->is_directory_or_symlink_to_directory())
_imp->categories.insert(std::make_pair(CategoryNamePart(d->basename()),
- tr1::shared_ptr<QualifiedPackageNameCollection>()));
+ tr1::shared_ptr<QualifiedPackageNameSet>()));
}
catch (const Exception & e)
{
@@ -1060,7 +1062,7 @@ VDBRepository::need_package_ids(const CategoryNamePart & c) const
Context context("When loading package names from '" + stringify(_imp->params.location) +
"' in category '" + stringify(c) + "':");
- tr1::shared_ptr<QualifiedPackageNameCollection> q(new QualifiedPackageNameCollection::Concrete);
+ tr1::shared_ptr<QualifiedPackageNameSet> q(new QualifiedPackageNameSet);
for (DirIterator d(_imp->params.location / stringify(c)), d_end ; d != d_end ; ++d)
try
@@ -1075,7 +1077,7 @@ VDBRepository::need_package_ids(const CategoryNamePart & c) const
q->insert(*p.package_ptr());
IDMap::iterator i(_imp->ids.find(*p.package_ptr()));
if (_imp->ids.end() == i)
- i = _imp->ids.insert(std::make_pair(*p.package_ptr(), make_shared_ptr(new PackageIDSequence::Concrete))).first;
+ i = _imp->ids.insert(std::make_pair(*p.package_ptr(), make_shared_ptr(new PackageIDSequence))).first;
i->second->push_back(make_id(*p.package_ptr(), p.version_requirements_ptr()->begin()->version_spec, *d));
}
}
diff --git a/paludis/repositories/e/vdb_repository.hh b/paludis/repositories/e/vdb_repository.hh
index fdfb49f..4adc995 100644
--- a/paludis/repositories/e/vdb_repository.hh
+++ b/paludis/repositories/e/vdb_repository.hh
@@ -25,6 +25,7 @@
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/tr1_memory.hh>
+#include <paludis/util/map.hh>
/** \file
* Declarations for VDBRepository.
@@ -99,16 +100,16 @@ namespace paludis
virtual bool do_query_use_force(const UseFlagName &, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const UseFlagNameCollection> do_arch_flags() const
+ virtual tr1::shared_ptr<const UseFlagNameSet> do_arch_flags() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const UseFlagNameCollection> do_use_expand_flags() const
+ virtual tr1::shared_ptr<const UseFlagNameSet> do_use_expand_flags() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const UseFlagNameCollection> do_use_expand_hidden_prefixes() const
+ virtual tr1::shared_ptr<const UseFlagNameSet> do_use_expand_hidden_prefixes() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const UseFlagNameCollection> do_use_expand_prefixes() const
+ virtual tr1::shared_ptr<const UseFlagNameSet> do_use_expand_prefixes() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual std::string do_describe_use_flag(const UseFlagName &,
@@ -120,7 +121,7 @@ namespace paludis
virtual tr1::shared_ptr<SetSpecTree::ConstItem> do_package_set(const SetName & id) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const SetNameCollection> sets_list() const
+ virtual tr1::shared_ptr<const SetNameSet> sets_list() const
PALUDIS_ATTRIBUTE((warn_unused_result));
/* RepositoryUninstallableInterface */
@@ -180,21 +181,21 @@ namespace paludis
/**
* Override in descendents: fetch package names.
*/
- virtual tr1::shared_ptr<const QualifiedPackageNameCollection> do_package_names(
+ virtual tr1::shared_ptr<const QualifiedPackageNameSet> do_package_names(
const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
/**
* Override in descendents: fetch category names.
*/
- virtual tr1::shared_ptr<const CategoryNamePartCollection> do_category_names() const
+ virtual tr1::shared_ptr<const CategoryNamePartSet> do_category_names() const
PALUDIS_ATTRIBUTE((warn_unused_result));
/**
* Override in descendents if a fast implementation is available: fetch category names
* that contain a particular package.
*/
- virtual tr1::shared_ptr<const CategoryNamePartCollection> do_category_names_containing_package(
+ virtual tr1::shared_ptr<const CategoryNamePartSet> do_category_names_containing_package(
const PackageNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -221,7 +222,7 @@ namespace paludis
*/
static tr1::shared_ptr<Repository> make_vdb_repository(
Environment * const env,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> > m);
+ tr1::shared_ptr<const Map<std::string, std::string> > m);
/**
* Destructor.
diff --git a/paludis/repositories/e/vdb_unmerger.cc b/paludis/repositories/e/vdb_unmerger.cc
index 093493c..a306f7e 100644
--- a/paludis/repositories/e/vdb_unmerger.cc
+++ b/paludis/repositories/e/vdb_unmerger.cc
@@ -33,6 +33,7 @@ using namespace paludis;
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/util/tokeniser.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
@@ -133,7 +134,7 @@ VDBUnmerger::~VDBUnmerger()
Hook
VDBUnmerger::extend_hook(const Hook & h) const
{
- tr1::shared_ptr<const FSEntryCollection> bashrc_files(_imp->options.environment->bashrc_files());
+ tr1::shared_ptr<const FSEntrySequence> bashrc_files(_imp->options.environment->bashrc_files());
Hook result(Unmerger::extend_hook(h)
("CONFIG_PROTECT", _imp->options.config_protect)
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index 1d99905..d5418be 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -18,9 +18,10 @@
*/
#include "fake_installed_repository.hh"
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/visitor-impl.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/set.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
@@ -70,14 +71,14 @@ FakeInstalledRepository::is_suitable_destination_for(const PackageID &) const
tr1::shared_ptr<const FakeInstalledRepository::ProvidesSequence>
FakeInstalledRepository::provided_packages() const
{
- tr1::shared_ptr<ProvidesSequence> result(new ProvidesSequence::Concrete);
+ tr1::shared_ptr<ProvidesSequence> result(new ProvidesSequence);
- tr1::shared_ptr<const CategoryNamePartCollection> cats(category_names());
- for (CategoryNamePartCollection::Iterator c(cats->begin()), c_end(cats->end()) ;
+ tr1::shared_ptr<const CategoryNamePartSet> cats(category_names());
+ for (CategoryNamePartSet::Iterator c(cats->begin()), c_end(cats->end()) ;
c != c_end ; ++c)
{
- tr1::shared_ptr<const QualifiedPackageNameCollection> pkgs(package_names(*c));
- for (QualifiedPackageNameCollection::Iterator p(pkgs->begin()), p_end(pkgs->end()) ;
+ tr1::shared_ptr<const QualifiedPackageNameSet> pkgs(package_names(*c));
+ for (QualifiedPackageNameSet::Iterator p(pkgs->begin()), p_end(pkgs->end()) ;
p != p_end ; ++p)
{
tr1::shared_ptr<const PackageIDSequence> vers(package_ids(*p));
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index 0314616..52b3b4f 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -26,72 +26,74 @@
#include <paludis/hashed_containers.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/iterator.hh>
+#include <paludis/util/set.hh>
#include <paludis/util/visitor-impl.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
+#include <list>
+
using namespace paludis;
namespace paludis
{
template <>
template <typename C_>
- struct Implementation<FakeMetadataCollectionKey<C_> >
+ struct Implementation<FakeMetadataSetKey<C_> >
{
tr1::shared_ptr<C_> collection;
};
}
template <typename C_>
-FakeMetadataCollectionKey<C_>::FakeMetadataCollectionKey(
+FakeMetadataSetKey<C_>::FakeMetadataSetKey(
const std::string & r, const std::string & h, const MetadataKeyType t) :
- MetadataCollectionKey<C_>(r, h, t),
- PrivateImplementationPattern<FakeMetadataCollectionKey<C_> >(new Implementation<FakeMetadataCollectionKey<C_> >),
- _imp(PrivateImplementationPattern<FakeMetadataCollectionKey<C_> >::_imp.get())
+ MetadataSetKey<C_>(r, h, t),
+ PrivateImplementationPattern<FakeMetadataSetKey<C_> >(new Implementation<FakeMetadataSetKey<C_> >),
+ _imp(PrivateImplementationPattern<FakeMetadataSetKey<C_> >::_imp.get())
{
}
template <typename C_>
-FakeMetadataCollectionKey<C_>::~FakeMetadataCollectionKey()
+FakeMetadataSetKey<C_>::~FakeMetadataSetKey()
{
}
template <typename C_>
const tr1::shared_ptr<const C_>
-FakeMetadataCollectionKey<C_>::value() const
+FakeMetadataSetKey<C_>::value() const
{
return _imp->collection;
}
-FakeMetadataKeywordCollectionKey::FakeMetadataKeywordCollectionKey(const std::string & r,
+FakeMetadataKeywordSetKey::FakeMetadataKeywordSetKey(const std::string & r,
const std::string & h, const std::string & v, const MetadataKeyType t) :
- FakeMetadataCollectionKey<KeywordNameCollection>(r, h, t)
+ FakeMetadataSetKey<KeywordNameSet>(r, h, t)
{
set_from_string(v);
}
void
-FakeMetadataKeywordCollectionKey::set_from_string(const std::string & s)
+FakeMetadataKeywordSetKey::set_from_string(const std::string & s)
{
- _imp->collection.reset(new KeywordNameCollection::Concrete);
+ _imp->collection.reset(new KeywordNameSet);
WhitespaceTokeniser::get_instance()->tokenise(s, create_inserter<KeywordName>(_imp->collection->inserter()));
}
-FakeMetadataIUseCollectionKey::FakeMetadataIUseCollectionKey(const std::string & r,
+FakeMetadataIUseSetKey::FakeMetadataIUseSetKey(const std::string & r,
const std::string & h, const std::string & v, const IUseFlagParseMode m, const MetadataKeyType t) :
- FakeMetadataCollectionKey<IUseFlagCollection>(r, h, t)
+ FakeMetadataSetKey<IUseFlagSet>(r, h, t)
{
set_from_string(v, m);
}
void
-FakeMetadataIUseCollectionKey::set_from_string(const std::string & s, const IUseFlagParseMode m)
+FakeMetadataIUseSetKey::set_from_string(const std::string & s, const IUseFlagParseMode m)
{
- _imp->collection.reset(new IUseFlagCollection::Concrete);
+ _imp->collection.reset(new IUseFlagSet);
std::list<std::string> tokens;
WhitespaceTokeniser::get_instance()->tokenise(s, std::back_inserter(tokens));
for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
@@ -187,8 +189,8 @@ namespace paludis
tr1::shared_ptr<FakeMetadataPackageIDKey> package_id;
tr1::shared_ptr<FakeMetadataPackageIDKey> virtual_for;
- tr1::shared_ptr<FakeMetadataKeywordCollectionKey> keywords;
- tr1::shared_ptr<FakeMetadataIUseCollectionKey> iuse;
+ tr1::shared_ptr<FakeMetadataKeywordSetKey> keywords;
+ tr1::shared_ptr<FakeMetadataIUseSetKey> iuse;
tr1::shared_ptr<FakeMetadataSpecTreeKey<LicenseSpecTree> > license;
tr1::shared_ptr<FakeMetadataSpecTreeKey<ProvideSpecTree> > provide;
tr1::shared_ptr<FakeMetadataSpecTreeKey<DependencySpecTree> > build_dependencies;
@@ -207,8 +209,8 @@ namespace paludis
version(v),
slot("0"),
eapi(EAPIData::get_instance()->eapi_from_string("0")),
- keywords(new FakeMetadataKeywordCollectionKey("KEYWORDS", "Keywords", "test", mkt_normal)),
- iuse(new FakeMetadataIUseCollectionKey("IUSE", "Used USE flags", "", iuse_pm_permissive, mkt_normal)),
+ keywords(new FakeMetadataKeywordSetKey("KEYWORDS", "Keywords", "test", mkt_normal)),
+ iuse(new FakeMetadataIUseSetKey("IUSE", "Used USE flags", "", iuse_pm_permissive, mkt_normal)),
license(new FakeMetadataSpecTreeKey<LicenseSpecTree>("LICENSE", "Licenses",
"", tr1::bind(&PortageDepParser::parse_license, _1, tr1::cref(*eapi)), mkt_normal)),
provide(new FakeMetadataSpecTreeKey<ProvideSpecTree>("PROVIDE", "Provided packages",
@@ -302,28 +304,28 @@ FakePackageID::virtual_for_key() const
return _imp->virtual_for;
}
-const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameCollection> >
+const tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> >
FakePackageID::keywords_key() const
{
return _imp->keywords;
}
-const tr1::shared_ptr<const MetadataCollectionKey<IUseFlagCollection> >
+const tr1::shared_ptr<const MetadataSetKey<IUseFlagSet> >
FakePackageID::iuse_key() const
{
return _imp->iuse;
}
-const tr1::shared_ptr<const MetadataCollectionKey<InheritedCollection> >
+const tr1::shared_ptr<const MetadataSetKey<InheritedSet> >
FakePackageID::inherited_key() const
{
- return tr1::shared_ptr<const MetadataCollectionKey<InheritedCollection> >();
+ return tr1::shared_ptr<const MetadataSetKey<InheritedSet> >();
}
-const tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameCollection> >
+const tr1::shared_ptr<const MetadataSetKey<UseFlagNameSet> >
FakePackageID::use_key() const
{
- return tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameCollection> >();
+ return tr1::shared_ptr<const MetadataSetKey<UseFlagNameSet> >();
}
const tr1::shared_ptr<const MetadataSpecTreeKey<LicenseSpecTree> >
@@ -368,13 +370,13 @@ FakePackageID::restrict_key() const
return _imp->restrictions;
}
-const tr1::shared_ptr<FakeMetadataKeywordCollectionKey>
+const tr1::shared_ptr<FakeMetadataKeywordSetKey>
FakePackageID::keywords_key()
{
return _imp->keywords;
}
-const tr1::shared_ptr<FakeMetadataIUseCollectionKey>
+const tr1::shared_ptr<FakeMetadataIUseSetKey>
FakePackageID::iuse_key()
{
return _imp->iuse;
@@ -493,6 +495,6 @@ template class FakeMetadataSpecTreeKey<DependencySpecTree>;
template class FakeMetadataSpecTreeKey<RestrictSpecTree>;
template class FakeMetadataSpecTreeKey<URISpecTree>;
-template class FakeMetadataCollectionKey<KeywordNameCollection>;
-template class FakeMetadataCollectionKey<IUseFlagCollection>;
+template class FakeMetadataSetKey<KeywordNameSet>;
+template class FakeMetadataSetKey<IUseFlagSet>;
diff --git a/paludis/repositories/fake/fake_package_id.hh b/paludis/repositories/fake/fake_package_id.hh
index 76b5cdb..26b6c29 100644
--- a/paludis/repositories/fake/fake_package_id.hh
+++ b/paludis/repositories/fake/fake_package_id.hh
@@ -29,35 +29,35 @@ namespace paludis
class FakeRepositoryBase;
template <typename C_>
- class PALUDIS_VISIBLE FakeMetadataCollectionKey :
- public MetadataCollectionKey<C_>,
- private PrivateImplementationPattern<FakeMetadataCollectionKey<C_> >
+ class PALUDIS_VISIBLE FakeMetadataSetKey :
+ public MetadataSetKey<C_>,
+ private PrivateImplementationPattern<FakeMetadataSetKey<C_> >
{
protected:
- Implementation<FakeMetadataCollectionKey> * const _imp;
+ Implementation<FakeMetadataSetKey> * const _imp;
- FakeMetadataCollectionKey(const std::string &, const std::string &, const MetadataKeyType);
+ FakeMetadataSetKey(const std::string &, const std::string &, const MetadataKeyType);
public:
- ~FakeMetadataCollectionKey();
+ ~FakeMetadataSetKey();
virtual const tr1::shared_ptr<const C_> value() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
- class PALUDIS_VISIBLE FakeMetadataKeywordCollectionKey :
- public FakeMetadataCollectionKey<KeywordNameCollection>
+ class PALUDIS_VISIBLE FakeMetadataKeywordSetKey :
+ public FakeMetadataSetKey<KeywordNameSet>
{
public:
- FakeMetadataKeywordCollectionKey(const std::string &, const std::string &, const std::string &, const MetadataKeyType);
+ FakeMetadataKeywordSetKey(const std::string &, const std::string &, const std::string &, const MetadataKeyType);
void set_from_string(const std::string &);
};
- class PALUDIS_VISIBLE FakeMetadataIUseCollectionKey :
- public FakeMetadataCollectionKey<IUseFlagCollection>
+ class PALUDIS_VISIBLE FakeMetadataIUseSetKey :
+ public FakeMetadataSetKey<IUseFlagSet>
{
public:
- FakeMetadataIUseCollectionKey(const std::string &, const std::string &, const std::string &, const IUseFlagParseMode,
+ FakeMetadataIUseSetKey(const std::string &, const std::string &, const std::string &, const IUseFlagParseMode,
const MetadataKeyType);
void set_from_string(const std::string &, const IUseFlagParseMode);
@@ -122,10 +122,10 @@ namespace paludis
virtual const tr1::shared_ptr<const EAPI> eapi() const;
virtual const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for_key() const;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameCollection> > keywords_key() const;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameCollection> > use_key() const;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<IUseFlagCollection> > iuse_key() const;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<InheritedCollection> > inherited_key() const;
+ virtual const tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> > keywords_key() const;
+ virtual const tr1::shared_ptr<const MetadataSetKey<UseFlagNameSet> > use_key() const;
+ virtual const tr1::shared_ptr<const MetadataSetKey<IUseFlagSet> > iuse_key() const;
+ virtual const tr1::shared_ptr<const MetadataSetKey<InheritedSet> > inherited_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<LicenseSpecTree> > license_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<ProvideSpecTree> > provide_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > build_dependencies_key() const;
@@ -143,8 +143,8 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataStringKey> source_origin_key() const;
virtual const tr1::shared_ptr<const MetadataStringKey> binary_origin_key() const;
- const tr1::shared_ptr<FakeMetadataKeywordCollectionKey> keywords_key();
- const tr1::shared_ptr<FakeMetadataIUseCollectionKey> iuse_key();
+ const tr1::shared_ptr<FakeMetadataKeywordSetKey> keywords_key();
+ const tr1::shared_ptr<FakeMetadataIUseSetKey> iuse_key();
const tr1::shared_ptr<FakeMetadataSpecTreeKey<ProvideSpecTree> > provide_key();
const tr1::shared_ptr<FakeMetadataSpecTreeKey<DependencySpecTree> > build_dependencies_key();
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index 4518cbf..d24b5de 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -19,9 +19,9 @@
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/distribution.hh>
#include <paludis/environment.hh>
@@ -40,7 +40,7 @@ namespace paludis
tr1::shared_ptr<FakeRepository::VirtualsSequence> virtual_packages;
Implementation() :
- virtual_packages(new FakeRepository::VirtualsSequence::Concrete)
+ virtual_packages(new FakeRepository::VirtualsSequence)
{
}
};
diff --git a/paludis/repositories/fake/fake_repository_base.cc b/paludis/repositories/fake/fake_repository_base.cc
index e78cf4d..71168c0 100644
--- a/paludis/repositories/fake/fake_repository_base.cc
+++ b/paludis/repositories/fake/fake_repository_base.cc
@@ -20,11 +20,12 @@
#include <paludis/repositories/fake/fake_repository_base.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/eapi.hh>
#include <paludis/repository_info.hh>
@@ -52,10 +53,10 @@ namespace paludis
private InstantiationPolicy<Implementation<FakeRepositoryBase>, instantiation_method::NonCopyableTag>
{
/// Our category names.
- tr1::shared_ptr<CategoryNamePartCollection> category_names;
+ tr1::shared_ptr<CategoryNamePartSet> category_names;
/// Our package names.
- std::map<CategoryNamePart, tr1::shared_ptr<PackageNamePartCollection> > package_names;
+ std::map<CategoryNamePart, tr1::shared_ptr<PackageNamePartSet> > package_names;
/// Our IDs.
std::map<QualifiedPackageName, tr1::shared_ptr<PackageIDSequence> > ids;
@@ -70,7 +71,7 @@ namespace paludis
};
Implementation<FakeRepositoryBase>::Implementation(const Environment * const e) :
- category_names(new CategoryNamePartCollection::Concrete),
+ category_names(new CategoryNamePartSet),
env(e)
{
}
@@ -108,20 +109,20 @@ FakeRepositoryBase::do_has_package_named(const QualifiedPackageName & q) const
_imp->package_names.find(q.category)->second->find(q.package));
}
-tr1::shared_ptr<const CategoryNamePartCollection>
+tr1::shared_ptr<const CategoryNamePartSet>
FakeRepositoryBase::do_category_names() const
{
return _imp->category_names;
}
-tr1::shared_ptr<const QualifiedPackageNameCollection>
+tr1::shared_ptr<const QualifiedPackageNameSet>
FakeRepositoryBase::do_package_names(const CategoryNamePart & c) const
{
- tr1::shared_ptr<QualifiedPackageNameCollection> result(new QualifiedPackageNameCollection::Concrete);
+ tr1::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
if (! has_category_named(c))
return result;
- PackageNamePartCollection::Iterator p(_imp->package_names.find(c)->second->begin()),
+ PackageNamePartSet::Iterator p(_imp->package_names.find(c)->second->begin()),
p_end(_imp->package_names.find(c)->second->end());
for ( ; p != p_end ; ++p)
result->insert(c + *p);
@@ -132,9 +133,9 @@ tr1::shared_ptr<const PackageIDSequence>
FakeRepositoryBase::do_package_ids(const QualifiedPackageName & n) const
{
if (! has_category_named(n.category))
- return tr1::shared_ptr<PackageIDSequence>(new PackageIDSequence::Concrete);
+ return tr1::shared_ptr<PackageIDSequence>(new PackageIDSequence);
if (! has_package_named(n))
- return tr1::shared_ptr<PackageIDSequence>(new PackageIDSequence::Concrete);
+ return tr1::shared_ptr<PackageIDSequence>(new PackageIDSequence);
return _imp->ids.find(n)->second;
}
@@ -142,7 +143,7 @@ void
FakeRepositoryBase::add_category(const CategoryNamePart & c)
{
_imp->category_names->insert(c);
- _imp->package_names.insert(std::make_pair(c, new PackageNamePartCollection::Concrete));
+ _imp->package_names.insert(std::make_pair(c, new PackageNamePartSet));
}
void
@@ -150,7 +151,7 @@ FakeRepositoryBase::add_package(const QualifiedPackageName & q)
{
add_category(q.category);
_imp->package_names.find(q.category)->second->insert(q.package);
- _imp->ids.insert(std::make_pair(q, new PackageIDSequence::Concrete));
+ _imp->ids.insert(std::make_pair(q, new PackageIDSequence));
}
tr1::shared_ptr<FakePackageID>
@@ -192,10 +193,10 @@ FakeRepositoryBase::do_query_use_force(const UseFlagName &, const PackageID &) c
return false;
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
FakeRepositoryBase::do_arch_flags() const
{
- return tr1::shared_ptr<const UseFlagNameCollection>(new UseFlagNameCollection::Concrete);
+ return tr1::shared_ptr<const UseFlagNameSet>(new UseFlagNameSet);
}
void
@@ -203,22 +204,22 @@ FakeRepositoryBase::invalidate()
{
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
FakeRepositoryBase::do_use_expand_flags() const
{
- return tr1::shared_ptr<const UseFlagNameCollection>(new UseFlagNameCollection::Concrete);
+ return tr1::shared_ptr<const UseFlagNameSet>(new UseFlagNameSet);
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
FakeRepositoryBase::do_use_expand_hidden_prefixes() const
{
- return tr1::shared_ptr<const UseFlagNameCollection>(new UseFlagNameCollection::Concrete);
+ return tr1::shared_ptr<const UseFlagNameSet>(new UseFlagNameSet);
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
FakeRepositoryBase::do_use_expand_prefixes() const
{
- return tr1::shared_ptr<const UseFlagNameCollection>(new UseFlagNameCollection::Concrete);
+ return tr1::shared_ptr<const UseFlagNameSet>(new UseFlagNameSet);
}
void
@@ -237,10 +238,10 @@ FakeRepositoryBase::do_package_set(const SetName & id) const
return i->second;
}
-tr1::shared_ptr<const SetNameCollection>
+tr1::shared_ptr<const SetNameSet>
FakeRepositoryBase::sets_list() const
{
- tr1::shared_ptr<SetNameCollection> result(new SetNameCollection::Concrete);
+ tr1::shared_ptr<SetNameSet> result(new SetNameSet);
std::copy(_imp->sets.begin(), _imp->sets.end(), transform_inserter(result->inserter(),
tr1::mem_fn(&std::pair<const SetName, tr1::shared_ptr<SetSpecTree::ConstItem> >::first)));
return result;
diff --git a/paludis/repositories/fake/fake_repository_base.hh b/paludis/repositories/fake/fake_repository_base.hh
index ef0539f..da07a71 100644
--- a/paludis/repositories/fake/fake_repository_base.hh
+++ b/paludis/repositories/fake/fake_repository_base.hh
@@ -75,16 +75,16 @@ namespace paludis
virtual bool do_query_use_force(const UseFlagName &, const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const UseFlagNameCollection> do_arch_flags() const
+ virtual tr1::shared_ptr<const UseFlagNameSet> do_arch_flags() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const UseFlagNameCollection> do_use_expand_flags() const
+ virtual tr1::shared_ptr<const UseFlagNameSet> do_use_expand_flags() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const UseFlagNameCollection> do_use_expand_hidden_prefixes() const
+ virtual tr1::shared_ptr<const UseFlagNameSet> do_use_expand_hidden_prefixes() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const UseFlagNameCollection> do_use_expand_prefixes() const
+ virtual tr1::shared_ptr<const UseFlagNameSet> do_use_expand_prefixes() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual std::string do_describe_use_flag(const UseFlagName &,
@@ -96,7 +96,7 @@ namespace paludis
virtual tr1::shared_ptr<SetSpecTree::ConstItem> do_package_set(const SetName & id) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const SetNameCollection> sets_list() const
+ virtual tr1::shared_ptr<const SetNameSet> sets_list() const
PALUDIS_ATTRIBUTE((warn_unused_result));
/* Repository */
@@ -105,11 +105,11 @@ namespace paludis
const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const QualifiedPackageNameCollection> do_package_names(
+ virtual tr1::shared_ptr<const QualifiedPackageNameSet> do_package_names(
const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const CategoryNamePartCollection> do_category_names() const
+ virtual tr1::shared_ptr<const CategoryNamePartSet> do_category_names() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool do_has_package_named(const QualifiedPackageName &) const
diff --git a/paludis/repositories/repository_maker.cc b/paludis/repositories/repository_maker.cc
index 6025477..8b9323c 100644
--- a/paludis/repositories/repository_maker.cc
+++ b/paludis/repositories/repository_maker.cc
@@ -23,6 +23,7 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/instantiation_policy-impl.hh>
#include <paludis/util/is_file_with_extension.hh>
+#include <paludis/util/map.hh>
#include <paludis/util/system.hh>
#include <paludis/util/virtual_constructor-impl.hh>
#include <paludis/about.hh>
@@ -43,7 +44,7 @@ using namespace paludis;
template class VirtualConstructor<std::string,
tr1::shared_ptr<Repository> (*) (Environment * const,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> >),
+ tr1::shared_ptr<const Map<std::string, std::string> >),
virtual_constructor_not_found::ThrowException<NoSuchRepositoryTypeError> >;
template class InstantiationPolicy<RepositoryMaker, instantiation_method::SingletonTag>;
diff --git a/paludis/repositories/repository_maker.hh b/paludis/repositories/repository_maker.hh
index 3d8ff6d..a3a4de2 100644
--- a/paludis/repositories/repository_maker.hh
+++ b/paludis/repositories/repository_maker.hh
@@ -23,6 +23,7 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/virtual_constructor.hh>
+#include <paludis/util/map-fwd.hh>
#include <paludis/repository.hh>
namespace paludis
@@ -93,7 +94,7 @@ namespace paludis
class PALUDIS_VISIBLE RepositoryMaker :
public VirtualConstructor<std::string,
tr1::shared_ptr<Repository> (*) (Environment * const,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> >),
+ tr1::shared_ptr<const Map<std::string, std::string> >),
virtual_constructor_not_found::ThrowException<NoSuchRepositoryTypeError> >,
public InstantiationPolicy<RepositoryMaker, instantiation_method::SingletonTag>,
private PrivateImplementationPattern<RepositoryMaker>
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 6e81657..c88e17f 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -26,10 +26,12 @@
#include <paludis/package_database.hh>
#include <paludis/repository_info.hh>
#include <paludis/util/make_shared_ptr.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/map.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
@@ -152,7 +154,7 @@ InstalledVirtualsRepository::need_ids() const
{
IDMap::iterator i(_imp->ids.find(p->virtual_name));
if (i == _imp->ids.end())
- i = _imp->ids.insert(std::make_pair(p->virtual_name, make_shared_ptr(new PackageIDSequence::Concrete))).first;
+ i = _imp->ids.insert(std::make_pair(p->virtual_name, make_shared_ptr(new PackageIDSequence))).first;
tr1::shared_ptr<const PackageID> id(new virtuals::VirtualsPackageID(shared_from_this(), p->virtual_name, p->provided_by));
i->second->push_back(id);
@@ -165,7 +167,7 @@ InstalledVirtualsRepository::need_ids() const
tr1::shared_ptr<Repository>
InstalledVirtualsRepository::make_installed_virtuals_repository(
Environment * const env,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> > k)
+ tr1::shared_ptr<const Map<std::string, std::string> > k)
{
std::string root_str;
@@ -182,36 +184,36 @@ tr1::shared_ptr<const PackageIDSequence>
InstalledVirtualsRepository::do_package_ids(const QualifiedPackageName & q) const
{
if (q.category.data() != "virtual")
- return tr1::shared_ptr<PackageIDSequence>(new PackageIDSequence::Concrete);
+ return tr1::shared_ptr<PackageIDSequence>(new PackageIDSequence);
need_ids();
IDMap::const_iterator i(_imp->ids.find(q));
if (i == _imp->ids.end())
- return tr1::shared_ptr<PackageIDSequence>(new PackageIDSequence::Concrete);
+ return tr1::shared_ptr<PackageIDSequence>(new PackageIDSequence);
return i->second;
}
-tr1::shared_ptr<const QualifiedPackageNameCollection>
+tr1::shared_ptr<const QualifiedPackageNameSet>
InstalledVirtualsRepository::do_package_names(const CategoryNamePart & c) const
{
if (c.data() != "virtual")
- return tr1::shared_ptr<QualifiedPackageNameCollection>(new QualifiedPackageNameCollection::Concrete);
+ return tr1::shared_ptr<QualifiedPackageNameSet>(new QualifiedPackageNameSet);
need_ids();
- tr1::shared_ptr<QualifiedPackageNameCollection> result(new QualifiedPackageNameCollection::Concrete);
+ tr1::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
std::copy(_imp->ids.begin(), _imp->ids.end(), transform_inserter(result->inserter(),
tr1::mem_fn(&std::pair<const QualifiedPackageName, tr1::shared_ptr<PackageIDSequence> >::first)));
return result;
}
-tr1::shared_ptr<const CategoryNamePartCollection>
+tr1::shared_ptr<const CategoryNamePartSet>
InstalledVirtualsRepository::do_category_names() const
{
- tr1::shared_ptr<CategoryNamePartCollection> result(new CategoryNamePartCollection::Concrete);
+ tr1::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
result->insert(CategoryNamePart("virtual"));
return result;
}
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.hh b/paludis/repositories/virtuals/installed_virtuals_repository.hh
index 00d5f35..db4813e 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.hh
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.hh
@@ -22,6 +22,8 @@
#include <paludis/repository.hh>
#include <paludis/util/tr1_memory.hh>
+#include <paludis/util/map-fwd.hh>
+#include <paludis/util/sequence-fwd.hh>
namespace paludis
{
@@ -51,11 +53,11 @@ namespace paludis
const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const QualifiedPackageNameCollection> do_package_names(
+ virtual tr1::shared_ptr<const QualifiedPackageNameSet> do_package_names(
const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const CategoryNamePartCollection> do_category_names() const
+ virtual tr1::shared_ptr<const CategoryNamePartSet> do_category_names() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool do_has_package_named(const QualifiedPackageName &) const
@@ -80,7 +82,7 @@ namespace paludis
*/
static tr1::shared_ptr<Repository> make_installed_virtuals_repository(
Environment * const env,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> >);
+ tr1::shared_ptr<const Map<std::string, std::string> >);
virtual void invalidate();
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index ce6fce9..5cf0f11 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -210,28 +210,28 @@ VirtualsPackageID::virtual_for_key() const
return _imp->virtual_for;
}
-const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameCollection> >
+const tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> >
VirtualsPackageID::keywords_key() const
{
- return tr1::shared_ptr<const MetadataCollectionKey<KeywordNameCollection> >();
+ return tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> >();
}
-const tr1::shared_ptr<const MetadataCollectionKey<IUseFlagCollection> >
+const tr1::shared_ptr<const MetadataSetKey<IUseFlagSet> >
VirtualsPackageID::iuse_key() const
{
- return tr1::shared_ptr<const MetadataCollectionKey<IUseFlagCollection> >();
+ return tr1::shared_ptr<const MetadataSetKey<IUseFlagSet> >();
}
-const tr1::shared_ptr<const MetadataCollectionKey<InheritedCollection> >
+const tr1::shared_ptr<const MetadataSetKey<InheritedSet> >
VirtualsPackageID::inherited_key() const
{
- return tr1::shared_ptr<const MetadataCollectionKey<InheritedCollection> >();
+ return tr1::shared_ptr<const MetadataSetKey<InheritedSet> >();
}
-const tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameCollection> >
+const tr1::shared_ptr<const MetadataSetKey<UseFlagNameSet> >
VirtualsPackageID::use_key() const
{
- return tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameCollection> >();
+ return tr1::shared_ptr<const MetadataSetKey<UseFlagNameSet> >();
}
const tr1::shared_ptr<const MetadataSpecTreeKey<LicenseSpecTree> >
diff --git a/paludis/repositories/virtuals/package_id.hh b/paludis/repositories/virtuals/package_id.hh
index bbdd33d..535196f 100644
--- a/paludis/repositories/virtuals/package_id.hh
+++ b/paludis/repositories/virtuals/package_id.hh
@@ -86,10 +86,10 @@ namespace paludis
virtual const tr1::shared_ptr<const EAPI> eapi() const;
virtual const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for_key() const;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameCollection> > keywords_key() const;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameCollection> > use_key() const;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<IUseFlagCollection> > iuse_key() const;
- virtual const tr1::shared_ptr<const MetadataCollectionKey<InheritedCollection> > inherited_key() const;
+ virtual const tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> > keywords_key() const;
+ virtual const tr1::shared_ptr<const MetadataSetKey<UseFlagNameSet> > use_key() const;
+ virtual const tr1::shared_ptr<const MetadataSetKey<IUseFlagSet> > iuse_key() const;
+ virtual const tr1::shared_ptr<const MetadataSetKey<InheritedSet> > inherited_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<LicenseSpecTree> > license_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<ProvideSpecTree> > provide_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > build_dependencies_key() const;
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 97da1b8..b8c255e 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -27,12 +27,14 @@
#include <paludis/query.hh>
#include <paludis/repository_info.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/log.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/operators.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/map.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/sequence.hh>
#include <vector>
#include <utility>
@@ -211,7 +213,7 @@ VirtualsRepository::need_ids() const
{
IDMap::iterator i(_imp->ids.find(v->first));
if (_imp->ids.end() == i)
- i = _imp->ids.insert(std::make_pair(v->first, make_shared_ptr(new PackageIDSequence::Concrete))).first;
+ i = _imp->ids.insert(std::make_pair(v->first, make_shared_ptr(new PackageIDSequence))).first;
tr1::shared_ptr<const PackageID> id(make_virtual_package_id(QualifiedPackageName(v->first), *m));
if (stringify(id->name().category) != "virtual")
@@ -226,7 +228,7 @@ VirtualsRepository::need_ids() const
tr1::shared_ptr<Repository>
VirtualsRepository::make_virtuals_repository(
Environment * const env,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> >)
+ tr1::shared_ptr<const Map<std::string, std::string> >)
{
return tr1::shared_ptr<Repository>(new VirtualsRepository(env));
}
@@ -235,36 +237,36 @@ tr1::shared_ptr<const PackageIDSequence>
VirtualsRepository::do_package_ids(const QualifiedPackageName & q) const
{
if (q.category.data() != "virtual")
- return tr1::shared_ptr<PackageIDSequence>(new PackageIDSequence::Concrete);
+ return tr1::shared_ptr<PackageIDSequence>(new PackageIDSequence);
need_ids();
IDMap::const_iterator i(_imp->ids.find(q));
if (i == _imp->ids.end())
- return tr1::shared_ptr<PackageIDSequence>(new PackageIDSequence::Concrete);
+ return tr1::shared_ptr<PackageIDSequence>(new PackageIDSequence);
return i->second;
}
-tr1::shared_ptr<const QualifiedPackageNameCollection>
+tr1::shared_ptr<const QualifiedPackageNameSet>
VirtualsRepository::do_package_names(const CategoryNamePart & c) const
{
if (c.data() != "virtual")
- return tr1::shared_ptr<QualifiedPackageNameCollection>(new QualifiedPackageNameCollection::Concrete);
+ return tr1::shared_ptr<QualifiedPackageNameSet>(new QualifiedPackageNameSet);
need_ids();
- tr1::shared_ptr<QualifiedPackageNameCollection> result(new QualifiedPackageNameCollection::Concrete);
+ tr1::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
std::copy(_imp->ids.begin(), _imp->ids.end(), transform_inserter(result->inserter(),
tr1::mem_fn(&std::pair<const QualifiedPackageName, tr1::shared_ptr<PackageIDSequence> >::first)));
return result;
}
-tr1::shared_ptr<const CategoryNamePartCollection>
+tr1::shared_ptr<const CategoryNamePartSet>
VirtualsRepository::do_category_names() const
{
- tr1::shared_ptr<CategoryNamePartCollection> result(new CategoryNamePartCollection::Concrete);
+ tr1::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
result->insert(CategoryNamePart("virtual"));
return result;
}
diff --git a/paludis/repositories/virtuals/virtuals_repository.hh b/paludis/repositories/virtuals/virtuals_repository.hh
index 9e9a6bc..872b1cf 100644
--- a/paludis/repositories/virtuals/virtuals_repository.hh
+++ b/paludis/repositories/virtuals/virtuals_repository.hh
@@ -22,6 +22,7 @@
#include <paludis/repository.hh>
#include <paludis/util/tr1_memory.hh>
+#include <paludis/util/map-fwd.hh>
namespace paludis
{
@@ -52,11 +53,11 @@ namespace paludis
const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const QualifiedPackageNameCollection> do_package_names(
+ virtual tr1::shared_ptr<const QualifiedPackageNameSet> do_package_names(
const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const CategoryNamePartCollection> do_category_names() const
+ virtual tr1::shared_ptr<const CategoryNamePartSet> do_category_names() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool do_has_package_named(const QualifiedPackageName &) const
@@ -86,7 +87,7 @@ namespace paludis
*/
static tr1::shared_ptr<Repository> make_virtuals_repository(
Environment * const env,
- tr1::shared_ptr<const AssociativeCollection<std::string, std::string> >);
+ tr1::shared_ptr<const Map<std::string, std::string> >);
virtual void invalidate();
diff --git a/paludis/repositories/virtuals/virtuals_repository_TEST.cc b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
index 901b58f..3d3b1c3 100644
--- a/paludis/repositories/virtuals/virtuals_repository_TEST.cc
+++ b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
@@ -26,6 +26,7 @@
#include <paludis/repositories/virtuals/virtuals_repository.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/package_database.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/query.hh>
diff --git a/paludis/repository-fwd.hh b/paludis/repository-fwd.hh
index 7b37304..06ca2e7 100644
--- a/paludis/repository-fwd.hh
+++ b/paludis/repository-fwd.hh
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORY_FWD_HH
#define PALUDIS_GUARD_PALUDIS_REPOSITORY_FWD_HH 1
-#include <paludis/util/collection-fwd.hh>
+#include <paludis/util/set-fwd.hh>
#include <paludis/util/tr1_memory.hh>
namespace paludis
@@ -62,7 +62,7 @@ namespace paludis
*
* \ingroup grpdepresolver
*/
- typedef SortedCollection<paludis::tr1::shared_ptr<Repository> > DestinationsCollection;
+ typedef Set<paludis::tr1::shared_ptr<Repository> > DestinationsSet;
/**
* What debug build option to use when installing a package.
diff --git a/paludis/repository.cc b/paludis/repository.cc
index 8115c82..6fe2976 100644
--- a/paludis/repository.cc
+++ b/paludis/repository.cc
@@ -19,12 +19,16 @@
#include <paludis/repository.hh>
#include <paludis/repository_info.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/log.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/instantiation_policy-impl.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/options.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/sequence-impl.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/set-impl.hh>
#include <paludis/config_file.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
@@ -44,6 +48,10 @@ using namespace paludis;
#include <paludis/repository-sr.cc>
+template class Set<tr1::shared_ptr<Repository> >;
+template class Sequence<RepositoryVirtualsEntry>;
+template class Sequence<RepositoryProvidesEntry>;
+
namespace
{
struct RepositoryBlacklist :
@@ -130,14 +138,14 @@ Repository::info(bool) const
return _info;
}
-tr1::shared_ptr<const CategoryNamePartCollection>
+tr1::shared_ptr<const CategoryNamePartSet>
Repository::do_category_names_containing_package(const PackageNamePart & p) const
{
Context context("When finding category names containing package '" + stringify(p) + "':");
- tr1::shared_ptr<CategoryNamePartCollection> result(new CategoryNamePartCollection::Concrete);
- tr1::shared_ptr<const CategoryNamePartCollection> cats(category_names());
- for (CategoryNamePartCollection::Iterator c(cats->begin()), c_end(cats->end()) ;
+ tr1::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ tr1::shared_ptr<const CategoryNamePartSet> cats(category_names());
+ for (CategoryNamePartSet::Iterator c(cats->begin()), c_end(cats->end()) ;
c != c_end ; ++c)
if (has_package_named(*c + p))
result->insert(*c);
@@ -271,25 +279,25 @@ RepositoryUseInterface::query_use_force(const UseFlagName & u, const PackageID &
return do_query_use_force(u, pde);
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
RepositoryUseInterface::arch_flags() const
{
return do_arch_flags();
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
RepositoryUseInterface::use_expand_flags() const
{
return do_use_expand_flags();
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
RepositoryUseInterface::use_expand_hidden_prefixes() const
{
return do_use_expand_hidden_prefixes();
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
RepositoryUseInterface::use_expand_prefixes() const
{
return do_use_expand_prefixes();
@@ -343,19 +351,19 @@ Repository::has_category_named(const CategoryNamePart & q) const
return do_has_category_named(q);
}
-tr1::shared_ptr<const CategoryNamePartCollection>
+tr1::shared_ptr<const CategoryNamePartSet>
Repository::category_names_containing_package(const PackageNamePart & p) const
{
return do_category_names_containing_package(p);
}
-tr1::shared_ptr<const QualifiedPackageNameCollection>
+tr1::shared_ptr<const QualifiedPackageNameSet>
Repository::package_names(const CategoryNamePart & c) const
{
return do_package_names(c);
}
-tr1::shared_ptr<const CategoryNamePartCollection>
+tr1::shared_ptr<const CategoryNamePartSet>
Repository::category_names() const
{
return do_category_names();
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 741d639..97d3309 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -103,21 +103,21 @@ namespace paludis
/**
* Override in descendents: fetch package names.
*/
- virtual tr1::shared_ptr<const QualifiedPackageNameCollection> do_package_names(
+ virtual tr1::shared_ptr<const QualifiedPackageNameSet> do_package_names(
const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
* Override in descendents: fetch category names.
*/
- virtual tr1::shared_ptr<const CategoryNamePartCollection> do_category_names() const
+ virtual tr1::shared_ptr<const CategoryNamePartSet> do_category_names() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
* Override in descendents if a fast implementation is available: fetch category names
* that contain a particular package.
*/
- virtual tr1::shared_ptr<const CategoryNamePartCollection> do_category_names_containing_package(
+ virtual tr1::shared_ptr<const CategoryNamePartSet> do_category_names_containing_package(
const PackageNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -187,18 +187,18 @@ namespace paludis
/**
* Fetch our category names.
*/
- tr1::shared_ptr<const CategoryNamePartCollection> category_names() const;
+ tr1::shared_ptr<const CategoryNamePartSet> category_names() const;
/**
* Fetch categories that contain a named package.
*/
- tr1::shared_ptr<const CategoryNamePartCollection> category_names_containing_package(
+ tr1::shared_ptr<const CategoryNamePartSet> category_names_containing_package(
const PackageNamePart & p) const;
/**
* Fetch our package names.
*/
- tr1::shared_ptr<const QualifiedPackageNameCollection> package_names(
+ tr1::shared_ptr<const QualifiedPackageNameSet> package_names(
const CategoryNamePart & c) const;
/**
@@ -305,25 +305,25 @@ namespace paludis
/**
* Override in descendents: fetch all arch flags.
*/
- virtual tr1::shared_ptr<const UseFlagNameCollection> do_arch_flags() const
+ virtual tr1::shared_ptr<const UseFlagNameSet> do_arch_flags() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
* Override in descendents: fetch all use expand flags.
*/
- virtual tr1::shared_ptr<const UseFlagNameCollection> do_use_expand_flags() const
+ virtual tr1::shared_ptr<const UseFlagNameSet> do_use_expand_flags() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
* Override in descendents: fetch all use expand hidden prefixes.
*/
- virtual tr1::shared_ptr<const UseFlagNameCollection> do_use_expand_hidden_prefixes() const
+ virtual tr1::shared_ptr<const UseFlagNameSet> do_use_expand_hidden_prefixes() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
* Override in descendents: fetch all use expand prefixes.
*/
- virtual tr1::shared_ptr<const UseFlagNameCollection> do_use_expand_prefixes() const
+ virtual tr1::shared_ptr<const UseFlagNameSet> do_use_expand_prefixes() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
@@ -357,22 +357,22 @@ namespace paludis
/**
* Fetch all arch flags.
*/
- tr1::shared_ptr<const UseFlagNameCollection> arch_flags() const;
+ tr1::shared_ptr<const UseFlagNameSet> arch_flags() const;
/**
* Fetch all expand flags.
*/
- tr1::shared_ptr<const UseFlagNameCollection> use_expand_flags() const;
+ tr1::shared_ptr<const UseFlagNameSet> use_expand_flags() const;
/**
* Fetch all expand hidden flags.
*/
- tr1::shared_ptr<const UseFlagNameCollection> use_expand_hidden_prefixes() const;
+ tr1::shared_ptr<const UseFlagNameSet> use_expand_hidden_prefixes() const;
/**
* Fetch all use expand prefixes.
*/
- tr1::shared_ptr<const UseFlagNameCollection> use_expand_prefixes() const;
+ tr1::shared_ptr<const UseFlagNameSet> use_expand_prefixes() const;
/**
* Describe a use flag.
@@ -513,7 +513,7 @@ namespace paludis
/**
* Gives a list of the names of all the sets provided by this repo.
*/
- virtual tr1::shared_ptr<const SetNameCollection> sets_list() const
+ virtual tr1::shared_ptr<const SetNameSet> sets_list() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
///\}
@@ -670,7 +670,7 @@ namespace paludis
*
* \ingroup grprepository
*/
- typedef SequentialCollection<RepositoryVirtualsEntry> VirtualsSequence;
+ typedef Sequence<RepositoryVirtualsEntry> VirtualsSequence;
/**
* Fetch our virtual packages.
@@ -718,7 +718,7 @@ namespace paludis
*
* \ingroup grprepository
*/
- typedef SequentialCollection<RepositoryProvidesEntry> ProvidesSequence;
+ typedef Sequence<RepositoryProvidesEntry> ProvidesSequence;
/**
* Fetch our provided packages.
diff --git a/paludis/repository_info.cc b/paludis/repository_info.cc
index 90c7eff..b135fb4 100644
--- a/paludis/repository_info.cc
+++ b/paludis/repository_info.cc
@@ -23,7 +23,6 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/instantiation_policy-impl.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/collection_concrete.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <list>
diff --git a/paludis/repository_name_cache.cc b/paludis/repository_name_cache.cc
index 3bb8025..28ff6f4 100644
--- a/paludis/repository_name_cache.cc
+++ b/paludis/repository_name_cache.cc
@@ -21,9 +21,10 @@
#include <paludis/repository.hh>
#include <paludis/hashed_containers.hh>
#include <paludis/util/fs_entry.hh>
-#include <paludis/util/collection_concrete.hh>
+#include <paludis/util/tr1_memory.hh>
#include <paludis/util/log.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/set.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
@@ -68,15 +69,15 @@ RepositoryNameCache::~RepositoryNameCache()
{
}
-tr1::shared_ptr<const CategoryNamePartCollection>
+tr1::shared_ptr<const CategoryNamePartSet>
RepositoryNameCache::category_names_containing_package(const PackageNamePart & p) const
{
if (! usable())
- return tr1::shared_ptr<const CategoryNamePartCollection>();
+ return tr1::shared_ptr<const CategoryNamePartSet>();
Context context("When using name cache at '" + stringify(_imp->location) + "':");
- tr1::shared_ptr<CategoryNamePartCollection> result(new CategoryNamePartCollection::Concrete);
+ tr1::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
NameCacheMap::iterator r(_imp->name_cache_map.find(p));
_imp->location = FSEntry(stringify(_imp->location));
@@ -98,7 +99,7 @@ RepositoryNameCache::category_names_containing_package(const PackageNamePart & p
+ "' has version string '" + line + "', which is not supported. Was it generated using "
"a different Paludis version?");
_usable = false;
- return tr1::shared_ptr<const CategoryNamePartCollection>();
+ return tr1::shared_ptr<const CategoryNamePartSet>();
}
std::getline(vvf, line);
if (line != stringify(_imp->repo->name()))
@@ -107,7 +108,7 @@ RepositoryNameCache::category_names_containing_package(const PackageNamePart & p
+ "' was generated for repository '" + line + "', so it cannot be used. You must not "
"have multiple name caches at the same location.");
_usable = false;
- return tr1::shared_ptr<const CategoryNamePartCollection>();
+ return tr1::shared_ptr<const CategoryNamePartSet>();
}
_imp->checked_name_cache_map = true;
}
@@ -120,7 +121,7 @@ RepositoryNameCache::category_names_containing_package(const PackageNamePart & p
"directory. You probably want to manually remove '" + stringify(_imp->location.dirname()) +
"' and then regenerate the cache.");
_usable = false;
- return tr1::shared_ptr<const CategoryNamePartCollection>();
+ return tr1::shared_ptr<const CategoryNamePartSet>();
}
else
{
@@ -128,7 +129,7 @@ RepositoryNameCache::category_names_containing_package(const PackageNamePart & p
+ "' has no version information, so cannot be used. Either it was generated using "
"an older Paludis version or it has not yet been generated.");
_usable = false;
- return tr1::shared_ptr<const CategoryNamePartCollection>();
+ return tr1::shared_ptr<const CategoryNamePartSet>();
}
}
@@ -169,12 +170,12 @@ RepositoryNameCache::regenerate_cache() const
MakeHashedMap<std::string, std::string>::Type m;
- tr1::shared_ptr<const CategoryNamePartCollection> cats(_imp->repo->category_names());
- for (CategoryNamePartCollection::Iterator c(cats->begin()), c_end(cats->end()) ;
+ tr1::shared_ptr<const CategoryNamePartSet> cats(_imp->repo->category_names());
+ for (CategoryNamePartSet::Iterator c(cats->begin()), c_end(cats->end()) ;
c != c_end ; ++c)
{
- tr1::shared_ptr<const QualifiedPackageNameCollection> pkgs(_imp->repo->package_names(*c));
- for (QualifiedPackageNameCollection::Iterator p(pkgs->begin()), p_end(pkgs->end()) ;
+ tr1::shared_ptr<const QualifiedPackageNameSet> pkgs(_imp->repo->package_names(*c));
+ for (QualifiedPackageNameSet::Iterator p(pkgs->begin()), p_end(pkgs->end()) ;
p != p_end ; ++p)
m[stringify(p->package)].append(stringify(*c) + "\n");
}
diff --git a/paludis/repository_name_cache.hh b/paludis/repository_name_cache.hh
index 910f112..677f112 100644
--- a/paludis/repository_name_cache.hh
+++ b/paludis/repository_name_cache.hh
@@ -21,6 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORY_NAME_CACHE_HH 1
#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/tr1_memory.hh>
#include <paludis/name.hh>
namespace paludis
@@ -64,7 +65,7 @@ namespace paludis
* fall back to Repository::do_category_names_containing_package or
* its own implementation.
*/
- tr1::shared_ptr<const CategoryNamePartCollection> category_names_containing_package(
+ tr1::shared_ptr<const CategoryNamePartSet> category_names_containing_package(
const PackageNamePart & p) const;
/**
diff --git a/paludis/repository_name_cache_TEST.cc b/paludis/repository_name_cache_TEST.cc
index a75172f..401f951 100644
--- a/paludis/repository_name_cache_TEST.cc
+++ b/paludis/repository_name_cache_TEST.cc
@@ -22,6 +22,7 @@
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/join.hh>
+#include <paludis/util/set.hh>
#include <paludis/package_database.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
@@ -129,12 +130,12 @@ namespace test_cases
RepositoryNameCache cache(FSEntry("repository_name_cache_TEST_dir/good_repo"), repo.get());
TEST_CHECK(cache.usable());
- tr1::shared_ptr<const CategoryNamePartCollection> foo(cache.category_names_containing_package(PackageNamePart("foo")));
+ tr1::shared_ptr<const CategoryNamePartSet> foo(cache.category_names_containing_package(PackageNamePart("foo")));
TEST_CHECK(cache.usable());
TEST_CHECK(foo);
TEST_CHECK_EQUAL(join(foo->begin(), foo->end(), " "), "bar baz");
- tr1::shared_ptr<const CategoryNamePartCollection> moo(cache.category_names_containing_package(PackageNamePart("moo")));
+ tr1::shared_ptr<const CategoryNamePartSet> moo(cache.category_names_containing_package(PackageNamePart("moo")));
TEST_CHECK(cache.usable());
TEST_CHECK(moo);
TEST_CHECK(moo->empty());
@@ -159,12 +160,12 @@ namespace test_cases
cache.regenerate_cache();
TEST_CHECK(cache.usable());
- tr1::shared_ptr<const CategoryNamePartCollection> foo(cache.category_names_containing_package(PackageNamePart("foo")));
+ tr1::shared_ptr<const CategoryNamePartSet> foo(cache.category_names_containing_package(PackageNamePart("foo")));
TEST_CHECK(cache.usable());
TEST_CHECK(foo);
TEST_CHECK_EQUAL(join(foo->begin(), foo->end(), " "), "bar baz");
- tr1::shared_ptr<const CategoryNamePartCollection> moo(cache.category_names_containing_package(PackageNamePart("moo")));
+ tr1::shared_ptr<const CategoryNamePartSet> moo(cache.category_names_containing_package(PackageNamePart("moo")));
TEST_CHECK(cache.usable());
TEST_CHECK(moo);
TEST_CHECK(moo->empty());
diff --git a/paludis/set_file.cc b/paludis/set_file.cc
index 7913141..35b6e31 100644
--- a/paludis/set_file.cc
+++ b/paludis/set_file.cc
@@ -23,6 +23,7 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/pstream.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/config_file.hh>
#include <paludis/environment.hh>
#include <paludis/query.hh>
diff --git a/paludis/syncer.cc b/paludis/syncer.cc
index d4cb412..a88fc3f 100644
--- a/paludis/syncer.cc
+++ b/paludis/syncer.cc
@@ -26,6 +26,7 @@
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/join.hh>
+#include <paludis/util/sequence.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <list>
@@ -69,10 +70,10 @@ DefaultSyncer::DefaultSyncer(const SyncerParams & params)
Log::get_instance()->message(ll_debug, lc_context) << "looking for syncer protocol '"
+ stringify(format) << "'";
- tr1::shared_ptr<const FSEntryCollection> syncer_dirs(_environment->syncers_dirs());
+ tr1::shared_ptr<const FSEntrySequence> syncer_dirs(_environment->syncers_dirs());
FSEntry syncer("/var/empty");
bool ok(false);
- for (FSEntryCollection::Iterator d(syncer_dirs->begin()), d_end(syncer_dirs->end()) ;
+ for (FSEntrySequence::Iterator d(syncer_dirs->begin()), d_end(syncer_dirs->end()) ;
d != d_end && ! ok; ++d)
{
syncer = FSEntry(*d) / ("do" + format);
@@ -92,9 +93,9 @@ DefaultSyncer::DefaultSyncer(const SyncerParams & params)
void
DefaultSyncer::sync(const SyncOptions & opts) const
{
- tr1::shared_ptr<const FSEntryCollection> bashrc_files(_environment->bashrc_files());
- tr1::shared_ptr<const FSEntryCollection> fetchers_dirs(_environment->fetchers_dirs());
- tr1::shared_ptr<const FSEntryCollection> syncers_dirs(_environment->syncers_dirs());
+ tr1::shared_ptr<const FSEntrySequence> bashrc_files(_environment->bashrc_files());
+ tr1::shared_ptr<const FSEntrySequence> fetchers_dirs(_environment->fetchers_dirs());
+ tr1::shared_ptr<const FSEntrySequence> syncers_dirs(_environment->syncers_dirs());
Command cmd(Command(stringify(_syncer) + " " + opts.options + " '" + _local + "' '" + _remote + "'")
.with_setenv("PALUDIS_ACTION", "sync")
diff --git a/paludis/tasks/find_unused_packages_task.cc b/paludis/tasks/find_unused_packages_task.cc
index 6fadf16..3f66d12 100644
--- a/paludis/tasks/find_unused_packages_task.cc
+++ b/paludis/tasks/find_unused_packages_task.cc
@@ -25,7 +25,8 @@
#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/collection_concrete.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/set.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
@@ -40,7 +41,7 @@ FindUnusedPackagesTask::~FindUnusedPackagesTask()
tr1::shared_ptr<const PackageIDSequence>
FindUnusedPackagesTask::execute(const QualifiedPackageName & package)
{
- tr1::shared_ptr<PackageIDSequence> result(new PackageIDSequence::Concrete);
+ tr1::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
tr1::shared_ptr<const PackageIDSequence> packages(_env->package_database()->query(
query::Matches(PackageDepSpec(
tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(package)),
@@ -66,9 +67,9 @@ FindUnusedPackagesTask::execute(const QualifiedPackageName & package)
old_slot = (*p)->slot();
}
- tr1::shared_ptr<const KeywordNameCollection> current_keywords((*p)->keywords_key()->value());
+ tr1::shared_ptr<const KeywordNameSet> current_keywords((*p)->keywords_key()->value());
bool used(false);
- for (KeywordNameCollection::Iterator k(current_keywords->begin()), k_end(current_keywords->end()) ;
+ for (KeywordNameSet::Iterator k(current_keywords->begin()), k_end(current_keywords->end()) ;
k != k_end ; ++k)
{
std::string stable_keyword(stringify(*k));
diff --git a/paludis/tasks/install_task.cc b/paludis/tasks/install_task.cc
index 596f09a..7a7af46 100644
--- a/paludis/tasks/install_task.cc
+++ b/paludis/tasks/install_task.cc
@@ -21,7 +21,6 @@
#include <paludis/dep_spec.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/dep_spec_pretty_printer.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
@@ -32,6 +31,7 @@
#include <paludis/tasks/exceptions.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/set.hh>
#include <paludis/util/log.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
@@ -53,7 +53,7 @@ namespace paludis
std::list<std::string> raw_targets;
tr1::shared_ptr<ConstTreeSequence<SetSpecTree, AllDepSpec> > targets;
tr1::shared_ptr<std::string> add_to_world_spec;
- tr1::shared_ptr<const DestinationsCollection> destinations;
+ tr1::shared_ptr<const DestinationsSet> destinations;
bool pretend;
bool preserve_world;
@@ -63,7 +63,7 @@ namespace paludis
bool override_target_type;
Implementation<InstallTask>(Environment * const e, const DepListOptions & o,
- tr1::shared_ptr<const DestinationsCollection> d) :
+ tr1::shared_ptr<const DestinationsSet> d) :
env(e),
dep_list(e, o),
current_dep_list_entry(dep_list.begin()),
@@ -82,7 +82,7 @@ namespace paludis
}
InstallTask::InstallTask(Environment * const env, const DepListOptions & options,
- const tr1::shared_ptr<const DestinationsCollection> d) :
+ const tr1::shared_ptr<const DestinationsSet> d) :
PrivateImplementationPattern<InstallTask>(new Implementation<InstallTask>(env, options, d))
{
}
@@ -370,7 +370,7 @@ InstallTask::execute()
query::RepositoryHasInstalledInterface(), qo_order_by_version);
// don't clean the thing we just installed
- PackageIDSequence::Concrete clean_list;
+ PackageIDSequence clean_list;
if (collision_list)
for (PackageIDSequence::Iterator c(collision_list->begin()),
c_end(collision_list->end()) ; c != c_end ; ++c)
diff --git a/paludis/tasks/install_task.hh b/paludis/tasks/install_task.hh
index 2952c15..239ea1b 100644
--- a/paludis/tasks/install_task.hh
+++ b/paludis/tasks/install_task.hh
@@ -45,7 +45,7 @@ namespace paludis
///\{
InstallTask(Environment * const env, const DepListOptions & options,
- tr1::shared_ptr<const DestinationsCollection> destinations);
+ tr1::shared_ptr<const DestinationsSet> destinations);
///\}
diff --git a/paludis/tasks/report_task.cc b/paludis/tasks/report_task.cc
index c80535a..c8713df 100644
--- a/paludis/tasks/report_task.cc
+++ b/paludis/tasks/report_task.cc
@@ -26,10 +26,12 @@
#include <paludis/dep_tag.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/visitor-impl.hh>
+#include <paludis/util/set.hh>
#include <paludis/package_database.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <set>
+#include <map>
using namespace paludis;
@@ -161,12 +163,12 @@ ReportTask::execute()
if (! rr->installed_interface)
continue;
- tr1::shared_ptr<const CategoryNamePartCollection> cat_names(rr->category_names());
- for (CategoryNamePartCollection::Iterator c(cat_names->begin()), c_end(cat_names->end()) ;
+ tr1::shared_ptr<const CategoryNamePartSet> cat_names(rr->category_names());
+ for (CategoryNamePartSet::Iterator c(cat_names->begin()), c_end(cat_names->end()) ;
c != c_end ; ++c)
{
- tr1::shared_ptr<const QualifiedPackageNameCollection> packages(rr->package_names(*c));
- for (QualifiedPackageNameCollection::Iterator p(packages->begin()), p_end(packages->end()) ;
+ tr1::shared_ptr<const QualifiedPackageNameSet> packages(rr->package_names(*c));
+ for (QualifiedPackageNameSet::Iterator p(packages->begin()), p_end(packages->end()) ;
p != p_end ; ++p)
{
on_report_check_package_pre(*p);
diff --git a/paludis/tasks/uninstall_task.cc b/paludis/tasks/uninstall_task.cc
index 760c81a..1cf45da 100644
--- a/paludis/tasks/uninstall_task.cc
+++ b/paludis/tasks/uninstall_task.cc
@@ -21,11 +21,11 @@
#include <paludis/environment.hh>
#include <paludis/dep_list/uninstall_list.hh>
#include <paludis/dep_spec_flattener.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/tasks/exceptions.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/query.hh>
#include <paludis/package_database.hh>
#include <paludis/hook.hh>
@@ -33,6 +33,8 @@
#include <paludis/repository.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
+#include <map>
+#include <set>
#include <list>
using namespace paludis;
diff --git a/paludis/tasks/uninstall_task.hh b/paludis/tasks/uninstall_task.hh
index ab411e2..a5abbb1 100644
--- a/paludis/tasks/uninstall_task.hh
+++ b/paludis/tasks/uninstall_task.hh
@@ -24,6 +24,7 @@
#include <paludis/package_id.hh>
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/sequence.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
namespace paludis
diff --git a/paludis/util/collection.hh b/paludis/util/collection.hh
deleted file mode 100644
index 38c3fbd..0000000
--- a/paludis/util/collection.hh
+++ /dev/null
@@ -1,363 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2005, 2006, 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_SEQUENTIAL_COLLECTION_HH
-#define PALUDIS_GUARD_PALUDIS_SEQUENTIAL_COLLECTION_HH 1
-
-#include <paludis/util/collection-fwd.hh>
-#include <paludis/util/instantiation_policy.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-#include <libwrapiter/libwrapiter_output_iterator-fwd.hh>
-#include <iterator>
-#include <functional>
-#include <paludis/util/tr1_memory.hh>
-
-/** \file
- * Various wrappers around collections of items, for convenience and
- * avoiding passing around huge containers.
- *
- * \ingroup grpcollections
- */
-
-namespace paludis
-{
- /**
- * Wrapper around a std::list of a particular item. Multiple items
- * with the same value are disallowed.
- *
- * This item cannot be constructed. Use SequentialCollection::Concrete,
- * which requires including paludis/util/collection_concrete.hh .
- *
- * \ingroup grpcollections
- * \nosubgrouping
- */
- template <typename T_>
- class PALUDIS_VISIBLE SequentialCollection :
- private InstantiationPolicy<SequentialCollection<T_>, instantiation_method::NonCopyableTag>,
- public std::iterator<typename std::iterator_traits<
- typename libwrapiter::ForwardIterator<SequentialCollection<T_>, const T_> >::iterator_category, T_>
- {
- protected:
- ///\name Basic operations
- ///\{
-
- SequentialCollection()
- {
- }
-
- ///\}
-
- public:
- class Concrete;
-
- /**
- * Issue with g++ 3.4.6: const_reference isn't defined via our std::iterator
- * inherit, but it is needed by many standard algorithms.
- */
- typedef const T_ & const_reference;
-
- ///\name Basic operations
- ///\{
-
- virtual ~SequentialCollection()
- {
- }
-
- ///\}
-
- ///\name Iterate over our items
- ///\{
-
- typedef libwrapiter::ForwardIterator<SequentialCollection<T_>, const T_> Iterator;
-
- virtual Iterator begin() const = 0;
-
- virtual Iterator end() const = 0;
-
- virtual Iterator last() const = 0;
-
- struct ReverseTag;
- typedef libwrapiter::ForwardIterator<ReverseTag, const T_> ReverseIterator;
-
- virtual ReverseIterator rbegin() const = 0;
-
- virtual ReverseIterator rend() const = 0;
-
- ///\}
-
- ///\name Adding and modifying items
- ///\{
-
- /**
- * Append an item.
- */
- virtual void push_back(const T_ & v) = 0;
-
- /**
- * Our insert iterator type.
- */
- typedef libwrapiter::OutputIterator<SequentialCollection<T_>, T_> Inserter;
-
- /**
- * Fetch an inserter.
- */
- virtual Inserter inserter() = 0;
-
- ///\}
-
- ///\name Queries
- ///\{
-
- /**
- * Are we empty?
- */
- virtual bool empty() const = 0;
-
- ///\}
- };
-
- /**
- * Wrapper around a std::set of a particular item.
- *
- * This item cannot be constructed. Use SortedCollection::Concrete,
- * which requires including paludis/util/collection_concrete.hh .
- *
- * \ingroup grpcollections
- * \nosubgrouping
- */
- template <typename T_, typename C_>
- class PALUDIS_VISIBLE SortedCollection :
- private InstantiationPolicy<SortedCollection<T_, C_>, instantiation_method::NonCopyableTag>,
- public std::iterator<typename std::iterator_traits<
- typename libwrapiter::ForwardIterator<SortedCollection<T_, C_>, const T_> >::iterator_category, T_>
- {
- protected:
- ///\name Basic operations
- ///\{
-
- SortedCollection()
- {
- }
-
- ///\}
-
- public:
- class Concrete;
-
- ///\name Basic operations
- ///\{
-
- virtual ~SortedCollection()
- {
- }
-
- ///\}
-
- ///\name Iterate over our items
- ///\{
-
- typedef libwrapiter::ForwardIterator<SortedCollection<T_, C_>, const T_> Iterator;
-
- virtual Iterator begin() const = 0;
-
- virtual Iterator end() const = 0;
-
- struct ReverseTag;
- typedef libwrapiter::ForwardIterator<ReverseTag, const T_> ReverseIterator;
-
- virtual ReverseIterator rbegin() const = 0;
-
- virtual ReverseIterator rend() const = 0;
-
- virtual Iterator last() const = 0;
-
- ///\}
-
- ///\name Finding items
- ///\{
-
- virtual Iterator find(const T_ & v) const = 0;
-
- virtual int count(const T_ & v) const = 0;
-
- ///\}
-
- ///\name Adding, removing and modifying items
- ///\{
-
- /**
- * Insert an item, return whether we succeeded.
- */
- virtual bool insert(const T_ & v) = 0;
-
- /**
- * Insert a range of items, return whether we inserted everything.
- */
- template <typename I_>
- bool insert(I_ b, const I_ & e)
- {
- bool result(false);
- for ( ; b != e ; ++b)
- result |= insert(*b);
- return result;
- }
-
- /**
- * Erase an item, return whether we succeeded.
- */
- virtual bool erase(const T_ & v) = 0;
-
- /**
- * Insert all items from another container.
- */
- virtual bool merge(typename tr1::shared_ptr<const SortedCollection<T_, C_> > o) = 0;
-
- /**
- * Our insert iterator type.
- */
- typedef libwrapiter::OutputIterator<SortedCollection<T_, C_>, T_> Inserter;
-
- /**
- * Fetch an inserter.
- */
- virtual Inserter inserter() = 0;
-
- ///\}
-
- ///\name Queries
- ///\{
-
- /**
- * Are we empty?
- */
- virtual bool empty() const = 0;
-
- /**
- * How big are we?
- */
- virtual unsigned size() const = 0;
-
- ///\}
- };
-
- /**
- * Wrapper around a std::map of a particular item.
- *
- * This item cannot be constructed. Use AssociativeCollection::Concrete,
- * which requires including paludis/util/collection_concrete.hh .
- *
- * \ingroup grpcollections
- * \nosubgrouping
- */
- template <typename K_, typename V_>
- class PALUDIS_VISIBLE AssociativeCollection :
- private InstantiationPolicy<AssociativeCollection<K_, V_>, instantiation_method::NonCopyableTag>,
- public std::iterator<typename std::iterator_traits<
- typename libwrapiter::ForwardIterator<AssociativeCollection<K_, V_>,
- const std::pair<const K_, V_> > >::iterator_category, const std::pair<const K_, V_> >
- {
- protected:
- ///\name Basic operations
- ///\{
-
- AssociativeCollection()
- {
- }
-
- ///\}
-
- public:
- class Concrete;
-
- ///\name Basic operations
- ///\{
-
- virtual ~AssociativeCollection()
- {
- }
-
- ///\}
-
- ///\name Iterate over our items
- ///\{
-
- typedef libwrapiter::ForwardIterator<AssociativeCollection<K_, V_>,
- const std::pair<const K_, V_> > Iterator;
-
- virtual Iterator begin() const = 0;
-
- virtual Iterator end() const = 0;
-
- ///\}
-
- ///\name Finding items
- ///\{
-
- virtual Iterator find(const K_ & v) const = 0;
-
- ///\}
-
- ///\name Adding, removing and modifying items
- ///\{
-
- /**
- * Insert an item, return whether we succeeded.
- */
- virtual bool insert(const K_ & k, const V_ & v) = 0;
-
- /**
- * Erase an item, return whether we succeeded.
- */
- virtual bool erase(const K_ & k) = 0;
-
- /**
- * Erase an item, return whether we succeeded.
- */
- virtual bool erase(const Iterator & i) = 0;
-
- ///\}
-
- ///\name Queries
- ///\{
-
- /**
- * Are we empty?
- */
- virtual bool empty() const = 0;
-
- ///\}
-
- ///\name Inserter
- ///\{
-
- /**
- * Our insert iterator type.
- */
- typedef libwrapiter::OutputIterator<AssociativeCollection<K_, V_>, std::pair<K_, V_> > Inserter;
-
- /**
- * Fetch an inserter.
- */
- virtual Inserter inserter() = 0;
-
- ///\}
- };
-}
-
-#endif
diff --git a/paludis/util/collection_concrete.hh b/paludis/util/collection_concrete.hh
deleted file mode 100644
index 698c6c7..0000000
--- a/paludis/util/collection_concrete.hh
+++ /dev/null
@@ -1,301 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2005, 2006, 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_UTIL_COLLECTION_CONCRETE_HH
-#define PALUDIS_GUARD_PALUDIS_UTIL_COLLECTION_CONCRETE_HH 1
-
-#include <paludis/util/collection.hh>
-#include <list>
-#include <set>
-#include <map>
-#include <algorithm>
-
-/** \file
- * Concrete implementations for the collection classes.
- *
- * Do not include this file in other headers if possible. It pulls in big
- * STL things, slowing down compilation.
- *
- * \ingroup grpcollections
- */
-
-namespace paludis
-{
- /**
- * Concrete implementation for a SequentialCollection.
- *
- * \see SequentialCollection
- * \ingroup grpcollections
- * \nosubgrouping
- */
- template <typename T_>
- class PALUDIS_VISIBLE SequentialCollection<T_>::Concrete :
- public SequentialCollection<T_>
- {
- private:
- std::list<T_> _items;
-
- public:
- /// Access to the underlying data structure
- std::list<T_> & list;
-
- ///\name Basic operations
- ///\{
-
- Concrete() :
- SequentialCollection(),
- list(_items)
- {
- }
-
- virtual ~Concrete()
- {
- }
-
- ///\}
-
- virtual Iterator begin() const
- {
- return Iterator(_items.begin());
- }
-
- virtual Iterator end() const
- {
- return Iterator(_items.end());
- }
-
- virtual Iterator last() const
- {
- return Iterator(_items.begin() == _items.end() ? _items.end() : --(_items.end()));
- }
-
- virtual ReverseIterator rbegin() const
- {
- return ReverseIterator(_items.rbegin());
- }
-
- virtual ReverseIterator rend() const
- {
- return ReverseIterator(_items.rend());
- }
-
- void push_back(const T_ & v)
- {
- _items.push_back(v);
- }
-
- virtual bool empty() const
- {
- return _items.empty();
- }
-
- virtual Inserter inserter()
- {
- return Inserter(std::back_inserter(_items));
- }
-
- ///\name Extra functions
- ///\{
-
- template <typename C_>
- void sort(const C_ & t)
- {
- _items.sort(t);
- }
- };
-
- /**
- * Concrete implementation for a SortedCollection.
- *
- * \see SortedCollection
- * \ingroup grpcollections
- * \nosubgrouping
- */
- template <typename T_, typename C_>
- class PALUDIS_VISIBLE SortedCollection<T_, C_>::Concrete :
- public SortedCollection<T_, C_>
- {
- private:
- std::set<T_, C_> _items;
-
- public:
- ///\name Basic operations
- ///\{
-
- Concrete()
- {
- }
-
- virtual ~Concrete()
- {
- }
-
- ///\}
-
- virtual Iterator begin() const
- {
- return Iterator(_items.begin());
- }
-
- virtual Iterator end() const
- {
- return Iterator(_items.end());
- }
-
- virtual ReverseIterator rbegin() const
- {
- return ReverseIterator(_items.rbegin());
- }
-
- virtual ReverseIterator rend() const
- {
- return ReverseIterator(_items.rend());
- }
-
- virtual Iterator last() const
- {
- typename std::set<T_, C_>::const_iterator result(_items.end());
- if (result != _items.begin())
- --result;
- return Iterator(result);
- }
-
- virtual Iterator find(const T_ & v) const
- {
- return Iterator(_items.find(v));
- }
-
- virtual int count(const T_ & v) const
- {
- return _items.count(v);
- }
-
- virtual bool insert(const T_ & v)
- {
- return _items.insert(v).second;
- }
-
- virtual bool erase(const T_ & v)
- {
- return 0 != _items.erase(v);
- }
-
- virtual bool merge(typename tr1::shared_ptr<const SortedCollection<T_, C_> > o)
- {
- bool result(true);
- Iterator o_begin(o->begin()), o_end(o->end());
- for ( ; o_begin != o_end ; ++o_begin)
- result &= insert(*o_begin);
- return result;
- }
-
- virtual Inserter inserter()
- {
- return Inserter(std::inserter(_items, _items.begin()));
- }
-
- virtual bool empty() const
- {
- return _items.empty();
- }
-
- virtual unsigned size() const
- {
- return _items.size();
- }
- };
-
- /**
- * Concrete implementation for an AssociativeCollection.
- *
- * \see AssociativeCollection
- * \ingroup grpcollections
- * \nosubgrouping
- */
- template <typename K_, typename V_>
- class PALUDIS_VISIBLE AssociativeCollection<K_, V_>::Concrete :
- public AssociativeCollection<K_, V_>
- {
- private:
- std::map<K_, V_> _items;
-
- public:
- ///\name Basic operations
- ///\{
-
- Concrete()
- {
- }
-
- template <typename I_>
- Concrete(const I_ & b, const I_ & b_end) :
- _items(b, b_end)
- {
- }
-
- virtual ~Concrete()
- {
- }
-
- ///\}
-
- virtual Iterator begin() const
- {
- return Iterator(_items.begin());
- }
-
- virtual Iterator end() const
- {
- return Iterator(_items.end());
- }
-
- virtual Iterator find(const K_ & v) const
- {
- return Iterator(_items.find(v));
- }
-
- virtual bool insert(const K_ & k, const V_ & v)
- {
- return _items.insert(std::make_pair(k, v)).second;
- }
-
- virtual bool erase(const K_ & k)
- {
- return 0 != _items.erase(k);
- }
-
- virtual bool erase(const Iterator & i)
- {
- _items.erase(i->first);
- return true;
- }
-
- virtual bool empty() const
- {
- return _items.empty();
- }
-
- virtual Inserter inserter()
- {
- return Inserter(std::inserter(_items, _items.begin()));
- }
- };
-}
-
-#endif
diff --git a/paludis/util/files.m4 b/paludis/util/files.m4
index 7c4e724..7aebcd9 100644
--- a/paludis/util/files.m4
+++ b/paludis/util/files.m4
@@ -11,8 +11,6 @@ dnl on this file at present...
add(`action_queue', `hh', `cc', `test')
add(`attributes', `hh')
add(`clone', `hh', `impl')
-add(`collection', `hh', `fwd')
-add(`collection_concrete', `hh')
add(`condition_variable', `hh', `cc', `test')
add(`destringify', `hh', `cc', `test')
add(`dir_iterator', `hh', `cc', `test', `testscript')
@@ -29,6 +27,7 @@ add(`is_file_with_extension', `hh', `cc', `se', `test', `testscript')
add(`join', `hh', `test')
add(`log', `hh', `cc', `se', `test')
add(`make_shared_ptr', `hh', `fwd')
+add(`map', `hh', `fwd', `impl', `cc')
add(`mutex', `hh', `cc', `test')
add(`operators', `hh')
add(`options', `hh', `fwd', `cc', `test')
@@ -37,6 +36,8 @@ add(`pipe', `hh', `cc')
add(`private_implementation_pattern', `hh', `impl')
add(`pstream', `hh', `cc', `test')
add(`random', `hh', `cc', `test')
+add(`sequence', `hh', `fwd', `impl')
+add(`set', `hh', `fwd', `impl')
add(`save', `hh', `test')
add(`sr', `hh', `cc')
add(`stringify', `hh', `test')
diff --git a/paludis/util/fs_entry-fwd.hh b/paludis/util/fs_entry-fwd.hh
index 9c89d5e..d174991 100644
--- a/paludis/util/fs_entry-fwd.hh
+++ b/paludis/util/fs_entry-fwd.hh
@@ -22,8 +22,9 @@
#define PALUDIS_GUARD_PALUDIS_UTIL_FS_ENTRY_FWD_HH 1
#include <iosfwd>
-#include <paludis/util/collection-fwd.hh>
#include <paludis/util/attributes.hh>
+#include <paludis/util/set-fwd.hh>
+#include <paludis/util/sequence-fwd.hh>
namespace paludis
{
@@ -62,14 +63,19 @@ namespace paludis
*/
std::ostream & operator<< (std::ostream & s, const FSEntry & f) PALUDIS_VISIBLE;
- template <typename T_> class SequentialCollection;
+ /**
+ * A sequence of FSEntry instances.
+ *
+ * \ingroup grpfilesystem
+ */
+ typedef Sequence<FSEntry> FSEntrySequence;
/**
- * An ordered group of FSEntry instances.
+ * A set of FSEntry instances.
*
* \ingroup grpfilesystem
*/
- typedef SequentialCollection<FSEntry> FSEntryCollection;
+ typedef Set<FSEntry> FSEntrySet;
}
#endif
diff --git a/paludis/util/fs_entry.cc b/paludis/util/fs_entry.cc
index b0b6e45..330da60 100644
--- a/paludis/util/fs_entry.cc
+++ b/paludis/util/fs_entry.cc
@@ -21,6 +21,10 @@
#include <paludis/util/exception.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/sequence-impl.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/set-impl.hh>
#include <sys/stat.h>
#include <sys/types.h>
@@ -29,6 +33,7 @@
#include <limits.h>
#include <cstring>
#include <cstdlib>
+
#include "config.h"
/** \file
@@ -39,6 +44,9 @@
using namespace paludis;
+template class Sequence<FSEntry>;
+template class Set<FSEntry>;
+
FSError::FSError(const std::string & our_message) throw () :
Exception(our_message)
{
diff --git a/paludis/util/fs_entry.hh b/paludis/util/fs_entry.hh
index 26cb84c..ce1957e 100644
--- a/paludis/util/fs_entry.hh
+++ b/paludis/util/fs_entry.hh
@@ -357,10 +357,6 @@ namespace paludis
};
std::ostream & operator<< (std::ostream & s, const FSEntry & f) PALUDIS_VISIBLE;
-
- template <typename T_> class SequentialCollection;
-
- typedef SequentialCollection<FSEntry> FSEntryCollection;
}
#endif
diff --git a/paludis/util/map-fwd.hh b/paludis/util/map-fwd.hh
new file mode 100644
index 0000000..6aceffb
--- /dev/null
+++ b/paludis/util/map-fwd.hh
@@ -0,0 +1,29 @@
+/* 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_UTIL_MAP_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_MAP_FWD_HH 1
+
+namespace paludis
+{
+ template <typename K_, typename V_>
+ struct Map;
+}
+
+#endif
diff --git a/paludis/util/map-impl.hh b/paludis/util/map-impl.hh
new file mode 100644
index 0000000..ef0747f
--- /dev/null
+++ b/paludis/util/map-impl.hh
@@ -0,0 +1,114 @@
+/* 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_UTIL_MAP_IMPL_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_MAP_IMPL_HH 1
+
+#include <paludis/util/map.hh>
+#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <libwrapiter/libwrapiter_output_iterator.hh>
+#include <libwrapiter/libwrapiter_forward_iterator.hh>
+#include <map>
+#include <iterator>
+
+namespace paludis
+{
+ template <>
+ template <typename K_, typename V_>
+ struct Implementation<Map<K_, V_> >
+ {
+ std::map<K_, V_> map;
+ };
+}
+
+template <typename K_, typename V_>
+paludis::Map<K_, V_>::Map() :
+ paludis::PrivateImplementationPattern<paludis::Map<K_, V_> >(new paludis::Implementation<paludis::Map<K_, V_> >)
+{
+}
+
+template <typename K_, typename V_>
+paludis::Map<K_, V_>::~Map()
+{
+}
+
+template <typename K_, typename V_>
+typename paludis::Map<K_, V_>::Iterator
+paludis::Map<K_, V_>::begin() const
+{
+ return Iterator(_imp->map.begin());
+}
+
+template <typename K_, typename V_>
+typename paludis::Map<K_, V_>::Iterator
+paludis::Map<K_, V_>::end() const
+{
+ return Iterator(_imp->map.end());
+}
+
+template <typename K_, typename V_>
+typename paludis::Map<K_, V_>::Iterator
+paludis::Map<K_, V_>::find(const K_ & k) const
+{
+ return Iterator(_imp->map.find(k));
+}
+
+template <typename K_, typename V_>
+typename paludis::Map<K_, V_>::Inserter
+paludis::Map<K_, V_>::inserter()
+{
+ return Inserter(std::inserter(_imp->map, _imp->map.begin()));
+}
+
+template <typename K_, typename V_>
+bool
+paludis::Map<K_, V_>::empty() const
+{
+ return _imp->map.empty();
+}
+
+template <typename K_, typename V_>
+unsigned
+paludis::Map<K_, V_>::size() const
+{
+ return _imp->map.size();
+}
+
+template <typename K_, typename V_>
+void
+paludis::Map<K_, V_>::insert(const K_ & k, const V_ & v)
+{
+ _imp->map.insert(std::make_pair(k, v));
+}
+
+template <typename K_, typename V_>
+void
+paludis::Map<K_, V_>::erase(const typename paludis::Map<K_, V_>::Iterator & i)
+{
+ _imp->map.erase(i->first);
+}
+
+template <typename K_, typename V_>
+void
+paludis::Map<K_, V_>::erase(const K_ & i)
+{
+ _imp->map.erase(i);
+}
+
+#endif
diff --git a/paludis/util/map.cc b/paludis/util/map.cc
new file mode 100644
index 0000000..fe88424
--- /dev/null
+++ b/paludis/util/map.cc
@@ -0,0 +1,27 @@
+/* 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
+ */
+
+#include <paludis/util/map.hh>
+#include <paludis/util/map-impl.hh>
+#include <string>
+
+using namespace paludis;
+
+template class Map<std::string, std::string>;
+
diff --git a/paludis/util/map.hh b/paludis/util/map.hh
new file mode 100644
index 0000000..0e67a8d
--- /dev/null
+++ b/paludis/util/map.hh
@@ -0,0 +1,64 @@
+/* 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_UTIL_MAP_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_MAP_HH 1
+
+#include <paludis/util/map-fwd.hh>
+#include <paludis/util/attributes.hh>
+#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/private_implementation_pattern.hh>
+
+#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
+#include <libwrapiter/libwrapiter_output_iterator-fwd.hh>
+
+#include <utility>
+
+namespace paludis
+{
+ template <typename K_, typename V_>
+ class PALUDIS_VISIBLE Map :
+ private PrivateImplementationPattern<Map<K_, V_> >,
+ private InstantiationPolicy<Map<K_, V_>, instantiation_method::NonCopyableTag>
+ {
+ private:
+ using PrivateImplementationPattern<Map<K_, V_> >::_imp;
+
+ public:
+ Map();
+ ~Map();
+
+ typedef libwrapiter::ForwardIterator<Map<K_, V_>, const std::pair<const K_, V_> > Iterator;
+ Iterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ Iterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ Iterator find(const K_ &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ typedef libwrapiter::OutputIterator<Map<K_, V_>, std::pair<const K_, V_> > Inserter;
+ Inserter inserter() PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ bool empty() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ unsigned size() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ void insert(const K_ &, const V_ &);
+ void erase(const Iterator &);
+ void erase(const K_ &);
+ };
+}
+
+#endif
diff --git a/paludis/util/sequence-fwd.hh b/paludis/util/sequence-fwd.hh
new file mode 100644
index 0000000..401e75a
--- /dev/null
+++ b/paludis/util/sequence-fwd.hh
@@ -0,0 +1,29 @@
+/* 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_UTIL_SEQUENCE_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_SEQUENCE_FWD_HH 1
+
+namespace paludis
+{
+ template <typename T_>
+ struct Sequence;
+}
+
+#endif
diff --git a/paludis/util/sequence-impl.hh b/paludis/util/sequence-impl.hh
new file mode 100644
index 0000000..851b61e
--- /dev/null
+++ b/paludis/util/sequence-impl.hh
@@ -0,0 +1,129 @@
+/* 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_UTIL_SEQUENCE_IMPL_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_SEQUENCE_IMPL_HH 1
+
+#include <paludis/util/sequence.hh>
+#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <libwrapiter/libwrapiter_output_iterator.hh>
+#include <libwrapiter/libwrapiter_forward_iterator.hh>
+#include <list>
+#include <iterator>
+
+namespace paludis
+{
+ template <>
+ template <typename T_>
+ struct Implementation<Sequence<T_> >
+ {
+ std::list<T_> list;
+ };
+}
+
+template <typename T_>
+paludis::Sequence<T_>::Sequence() :
+ paludis::PrivateImplementationPattern<paludis::Sequence<T_> >(new paludis::Implementation<paludis::Sequence<T_> >)
+{
+}
+
+template <typename T_>
+paludis::Sequence<T_>::~Sequence()
+{
+}
+
+template <typename T_>
+typename paludis::Sequence<T_>::Iterator
+paludis::Sequence<T_>::begin() const
+{
+ return Iterator(_imp->list.begin());
+}
+
+template <typename T_>
+typename paludis::Sequence<T_>::Iterator
+paludis::Sequence<T_>::end() const
+{
+ return Iterator(_imp->list.end());
+}
+
+template <typename T_>
+typename paludis::Sequence<T_>::Iterator
+paludis::Sequence<T_>::last() const
+{
+ return Iterator(_imp->list.begin() == _imp->list.end() ? _imp->list.end() : --(_imp->list.end()));
+}
+
+template <typename T_>
+typename paludis::Sequence<T_>::ReverseIterator
+paludis::Sequence<T_>::rbegin() const
+{
+ return ReverseIterator(_imp->list.rbegin());
+}
+
+template <typename T_>
+typename paludis::Sequence<T_>::ReverseIterator
+paludis::Sequence<T_>::rend() const
+{
+ return ReverseIterator(_imp->list.rend());
+}
+
+template <typename T_>
+typename paludis::Sequence<T_>::Inserter
+paludis::Sequence<T_>::back_inserter()
+{
+ return Inserter(std::back_inserter(_imp->list));
+}
+
+template <typename T_>
+typename paludis::Sequence<T_>::Inserter
+paludis::Sequence<T_>::front_inserter()
+{
+ return Inserter(std::front_inserter(_imp->list));
+}
+
+template <typename T_>
+void
+paludis::Sequence<T_>::push_back(const T_ & t)
+{
+ _imp->list.push_back(t);
+}
+
+template <typename T_>
+void
+paludis::Sequence<T_>::push_front(const T_ & t)
+{
+ _imp->list.push_front(t);
+}
+
+template <typename T_>
+bool
+paludis::Sequence<T_>::empty() const
+{
+ return _imp->list.empty();
+}
+
+template <typename T_>
+template <typename C_>
+void
+paludis::Sequence<T_>::sort(const C_ & c)
+{
+ _imp->list.sort<const C_ &>(c);
+}
+
+#endif
diff --git a/paludis/util/sequence.hh b/paludis/util/sequence.hh
new file mode 100644
index 0000000..d83416f
--- /dev/null
+++ b/paludis/util/sequence.hh
@@ -0,0 +1,72 @@
+/* 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_UTIL_SEQUENCE_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_SEQUENCE_HH 1
+
+#include <paludis/util/sequence-fwd.hh>
+#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/instantiation_policy.hh>
+
+#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
+#include <libwrapiter/libwrapiter_output_iterator-fwd.hh>
+
+namespace paludis
+{
+ template <typename T_>
+ class PALUDIS_VISIBLE Sequence :
+ private PrivateImplementationPattern<Sequence<T_> >,
+ private InstantiationPolicy<Sequence<T_>, instantiation_method::NonCopyableTag>
+ {
+ private:
+ using PrivateImplementationPattern<Sequence<T_> >::_imp;
+
+ public:
+ typedef T_ value_type;
+ typedef T_ & reference;
+ typedef const T_ & const_reference;
+
+ Sequence();
+ ~Sequence();
+
+ typedef libwrapiter::ForwardIterator<Sequence<T_>, const T_> Iterator;
+ Iterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ Iterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ Iterator last() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ struct ReverseIteratorTag;
+ typedef libwrapiter::ForwardIterator<typename Sequence<T_>::ReverseIteratorTag, const T_> ReverseIterator;
+ ReverseIterator rbegin() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ ReverseIterator rend() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ bool empty() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ typedef libwrapiter::OutputIterator<Sequence<T_>, T_> Inserter;
+ Inserter back_inserter();
+ Inserter front_inserter();
+
+ void push_back(const T_ &);
+ void push_front(const T_ &);
+
+ template <typename C_>
+ void sort(const C_ &);
+ };
+}
+
+#endif
diff --git a/paludis/util/collection-fwd.hh b/paludis/util/set-fwd.hh
index fb0013d..ed30854 100644
--- a/paludis/util/collection-fwd.hh
+++ b/paludis/util/set-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * 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
@@ -17,21 +17,16 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_PALUDIS_UTIL_COLLECTION_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_UTIL_COLLECTION_FWD_HH 1
-
-#include <functional>
+#ifndef PALUDIS_GUARD_PALUDIS_UTIL_SET_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_SET_FWD_HH 1
namespace paludis
{
- template <typename>
- class SequentialCollection;
-
- template <typename T_, typename C_ = std::less<T_> >
- class SortedCollection;
+ template <typename T_>
+ struct DefaultSetComparator;
- template <typename, typename>
- class AssociativeCollection;
+ template <typename T_, typename C_ = DefaultSetComparator<T_> >
+ struct Set;
}
#endif
diff --git a/paludis/util/set-impl.hh b/paludis/util/set-impl.hh
new file mode 100644
index 0000000..d8f8aae
--- /dev/null
+++ b/paludis/util/set-impl.hh
@@ -0,0 +1,113 @@
+/* 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_UTIL_SET_IMPL_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_SET_IMPL_HH 1
+
+#include <paludis/util/set.hh>
+#include <paludis/util/private_implementation_pattern-impl.hh>
+
+#include <set>
+#include <functional>
+#include <iterator>
+
+namespace paludis
+{
+ template <typename T_>
+ struct PALUDIS_VISIBLE DefaultSetComparator :
+ std::less<T_>
+ {
+ };
+
+ template <>
+ template <typename T_, typename C_>
+ struct Implementation<Set<T_, C_> >
+ {
+ std::set<T_, C_> set;
+ };
+}
+
+template <typename T_, typename C_>
+paludis::Set<T_, C_>::Set() :
+ paludis::PrivateImplementationPattern<Set<T_, C_> >(new Implementation<Set<T_, C_> >)
+{
+}
+
+template <typename T_, typename C_>
+paludis::Set<T_, C_>::~Set()
+{
+}
+
+template <typename T_, typename C_>
+typename paludis::Set<T_, C_>::Iterator
+paludis::Set<T_, C_>::begin() const
+{
+ return Iterator(_imp->set.begin());
+}
+
+template <typename T_, typename C_>
+typename paludis::Set<T_, C_>::Iterator
+paludis::Set<T_, C_>::end() const
+{
+ return Iterator(_imp->set.end());
+}
+
+template <typename T_, typename C_>
+typename paludis::Set<T_, C_>::Iterator
+paludis::Set<T_, C_>::find(const T_ & t) const
+{
+ return Iterator(_imp->set.find(t));
+}
+
+template <typename T_, typename C_>
+bool
+paludis::Set<T_, C_>::empty() const
+{
+ return _imp->set.empty();
+}
+
+template <typename T_, typename C_>
+unsigned
+paludis::Set<T_, C_>::size() const
+{
+ return _imp->set.size();
+}
+
+template <typename T_, typename C_>
+unsigned
+paludis::Set<T_, C_>::count(const T_ & t) const
+{
+ return _imp->set.count(t);
+}
+
+template <typename T_, typename C_>
+typename paludis::Set<T_, C_>::Inserter
+paludis::Set<T_, C_>::inserter()
+{
+ return Inserter(std::inserter(_imp->set, _imp->set.begin()));
+}
+
+template <typename T_, typename C_>
+void
+paludis::Set<T_, C_>::insert(const T_ & t)
+{
+ _imp->set.insert(t);
+}
+
+#endif
diff --git a/paludis/util/set.hh b/paludis/util/set.hh
new file mode 100644
index 0000000..08fb0ad
--- /dev/null
+++ b/paludis/util/set.hh
@@ -0,0 +1,65 @@
+/* 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_UTIL_SET_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_SET_HH 1
+
+#include <paludis/util/set-fwd.hh>
+#include <paludis/util/attributes.hh>
+#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/instantiation_policy.hh>
+
+#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
+#include <libwrapiter/libwrapiter_output_iterator-fwd.hh>
+
+namespace paludis
+{
+ template <typename T_, typename C_>
+ class PALUDIS_VISIBLE Set :
+ private PrivateImplementationPattern<Set<T_, C_> >,
+ private InstantiationPolicy<Set<T_, C_>, instantiation_method::NonCopyableTag>
+ {
+ private:
+ using PrivateImplementationPattern<Set<T_, C_> >::_imp;
+
+ public:
+ typedef T_ value_type;
+ typedef T_ & reference;
+ typedef const T_ & const_reference;
+
+ Set();
+ ~Set();
+
+ typedef libwrapiter::ForwardIterator<Set<T_, C_>, const T_> Iterator;
+ Iterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ Iterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ Iterator find(const T_ &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ bool empty() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ unsigned size() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ unsigned count(const T_ &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ typedef libwrapiter::OutputIterator<Set<T_, C_>, T_> Inserter;
+ Inserter inserter();
+
+ void insert(const T_ &);
+ };
+}
+
+#endif
diff --git a/paludis/util/tr1_functional.hh b/paludis/util/tr1_functional.hh
index 73805cc..79eb5ff 100644
--- a/paludis/util/tr1_functional.hh
+++ b/paludis/util/tr1_functional.hh
@@ -33,6 +33,7 @@ namespace paludis
using std::tr1::ref;
using std::tr1::cref;
using std::tr1::function;
+ using std::tr1::reference_wrapper;
namespace placeholders
{
@@ -65,6 +66,7 @@ namespace paludis
using boost::ref;
using boost::cref;
using boost::function;
+ using boost::reference_wrapper;
namespace placeholders
{
diff --git a/paludis/util/visitor-impl.hh b/paludis/util/visitor-impl.hh
index 3a4d7f0..86b0fe7 100644
--- a/paludis/util/visitor-impl.hh
+++ b/paludis/util/visitor-impl.hh
@@ -21,7 +21,8 @@
#define PALUDIS_GUARD_PALUDIS_UTIL_VISITOR_IMPL_HH 1
#include <paludis/util/visitor.hh>
-#include <paludis/util/collection_concrete.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/sequence-impl.hh>
#include <paludis/util/iterator.hh>
namespace paludis
@@ -170,7 +171,7 @@ namespace paludis
template <typename H_, typename T_>
TreeSequence<H_, T_>::TreeSequence(tr1::shared_ptr<T_> i) :
_item(i),
- _items(new typename SequentialCollection<tr1::shared_ptr<MutableAcceptInterface<H_> > >::Concrete)
+ _items(new Sequence<tr1::shared_ptr<MutableAcceptInterface<H_> > >)
{
}
@@ -242,7 +243,7 @@ namespace paludis
template <typename H_, typename T_>
ConstTreeSequence<H_, T_>::ConstTreeSequence(tr1::shared_ptr<T_> i) :
_item(i),
- _items(new typename SequentialCollection<tr1::shared_ptr<const ConstAcceptInterface<H_> > >::Concrete)
+ _items(new Sequence<tr1::shared_ptr<const ConstAcceptInterface<H_> > >)
{
}
diff --git a/paludis/util/visitor.hh b/paludis/util/visitor.hh
index 8dc54fa..cfbdf71 100644
--- a/paludis/util/visitor.hh
+++ b/paludis/util/visitor.hh
@@ -28,7 +28,7 @@
#include <paludis/util/attributes.hh>
#include <paludis/util/visitor-fwd.hh>
-#include <paludis/util/collection-fwd.hh>
+#include <paludis/util/sequence-fwd.hh>
#include <paludis/util/tr1_memory.hh>
#include <paludis/util/tr1_type_traits.hh>
#include <paludis/util/operators.hh>
@@ -286,7 +286,7 @@ namespace paludis
const TreeSequence & operator= (const TreeSequence &);
const tr1::shared_ptr<T_> _item;
- const tr1::shared_ptr<SequentialCollection<tr1::shared_ptr<MutableAcceptInterface<H_> > > > _items;
+ const tr1::shared_ptr<Sequence<tr1::shared_ptr<MutableAcceptInterface<H_> > > > _items;
protected:
///\name Visitor operations
@@ -352,7 +352,7 @@ namespace paludis
const ConstTreeSequence & operator= (const ConstTreeSequence &);
const tr1::shared_ptr<T_> _item;
- const tr1::shared_ptr<SequentialCollection<tr1::shared_ptr<const ConstAcceptInterface<H_> > > > _items;
+ const tr1::shared_ptr<Sequence<tr1::shared_ptr<const ConstAcceptInterface<H_> > > > _items;
protected:
///\name Visitor operations
diff --git a/paludis/version_requirements-fwd.hh b/paludis/version_requirements-fwd.hh
index 0f59765..7f46681 100644
--- a/paludis/version_requirements-fwd.hh
+++ b/paludis/version_requirements-fwd.hh
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_VERSION_REQUIREMENTS_FWD_HH
#define PALUDIS_GUARD_PALUDIS_VERSION_REQUIREMENTS_FWD_HH 1
-#include <paludis/util/collection-fwd.hh>
+#include <paludis/util/sequence-fwd.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/tr1_memory.hh>
#include <paludis/version_spec-fwd.hh>
@@ -37,7 +37,7 @@ namespace paludis
* \see PackageDepSpec
* \ingroup grpversions
*/
- typedef SequentialCollection<VersionRequirement> VersionRequirements;
+ typedef Sequence<VersionRequirement> VersionRequirements;
/**
* Convenience function: make VersionRequirements with an equals match on a
diff --git a/paludis/version_requirements.cc b/paludis/version_requirements.cc
index 68f7e20..117178a 100644
--- a/paludis/version_requirements.cc
+++ b/paludis/version_requirements.cc
@@ -19,7 +19,8 @@
#include "version_requirements.hh"
#include <paludis/util/stringify.hh>
-#include <paludis/util/collection_concrete.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/sequence-impl.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
@@ -27,10 +28,12 @@ using namespace paludis;
#include <paludis/version_requirements-sr.cc>
+template class Sequence<VersionRequirement>;
+
tr1::shared_ptr<VersionRequirements>
paludis::make_equal_to_version_requirements(const VersionSpec & v)
{
- tr1::shared_ptr<VersionRequirements> result(new VersionRequirements::Concrete);
+ tr1::shared_ptr<VersionRequirements> result(new VersionRequirements);
result->push_back(VersionRequirement(vo_equal, v));
return result;
}
diff --git a/paludis/version_requirements.hh b/paludis/version_requirements.hh
index 96e2bcd..412e3bf 100644
--- a/paludis/version_requirements.hh
+++ b/paludis/version_requirements.hh
@@ -20,7 +20,6 @@
#ifndef PALUDIS_GUARD_PALUDIS_VERSION_REQUIREMENTS_HH
#define PALUDIS_GUARD_PALUDIS_VERSION_REQUIREMENTS_HH 1
-#include <paludis/util/collection.hh>
#include <paludis/util/sr.hh>
#include <paludis/version_requirements-fwd.hh>
#include <paludis/version_operator.hh>
diff --git a/paludis/version_spec.hh b/paludis/version_spec.hh
index 4ca9b89..470e8c6 100644
--- a/paludis/version_spec.hh
+++ b/paludis/version_spec.hh
@@ -23,7 +23,6 @@
#include <paludis/version_spec-fwd.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/collection.hh>
#include <paludis/util/operators.hh>
#include <iosfwd>
diff --git a/src/clients/adjutrix/display_default_system_resolution.cc b/src/clients/adjutrix/display_default_system_resolution.cc
index 5d0b9de..6f4a293 100644
--- a/src/clients/adjutrix/display_default_system_resolution.cc
+++ b/src/clients/adjutrix/display_default_system_resolution.cc
@@ -26,6 +26,7 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/is_file_with_extension.hh>
+#include <paludis/util/set.hh>
#include <paludis/util/strip.hh>
#include <paludis/dep_list/dep_list.hh>
#include <paludis/dep_list/exceptions.hh>
diff --git a/src/clients/adjutrix/downgrade_check.cc b/src/clients/adjutrix/downgrade_check.cc
index 62b286a..a55f498 100644
--- a/src/clients/adjutrix/downgrade_check.cc
+++ b/src/clients/adjutrix/downgrade_check.cc
@@ -23,6 +23,7 @@
#include <paludis/package_database.hh>
#include <paludis/util/sr.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/sequence.hh>
#include <fstream>
#include <iostream>
#include <vector>
diff --git a/src/clients/adjutrix/find_dropped_keywords.cc b/src/clients/adjutrix/find_dropped_keywords.cc
index b5c8737..2536dd6 100644
--- a/src/clients/adjutrix/find_dropped_keywords.cc
+++ b/src/clients/adjutrix/find_dropped_keywords.cc
@@ -22,6 +22,8 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/iterator.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/set.hh>
#include <paludis/version_spec.hh>
#include <paludis/repository.hh>
#include <paludis/package_database.hh>
@@ -178,8 +180,8 @@ void do_find_dropped_keywords(const Environment & env)
write_repository_header(keyword, r->name());
- tr1::shared_ptr<const CategoryNamePartCollection> cat_names(r->category_names());
- for (CategoryNamePartCollection::Iterator c(cat_names->begin()), c_end(cat_names->end()) ;
+ tr1::shared_ptr<const CategoryNamePartSet> cat_names(r->category_names());
+ for (CategoryNamePartSet::Iterator c(cat_names->begin()), c_end(cat_names->end()) ;
c != c_end ; ++c)
{
if (CommandLine::get_instance()->a_category.specified())
@@ -189,8 +191,8 @@ void do_find_dropped_keywords(const Environment & env)
stringify(*c)))
continue;
- tr1::shared_ptr<const QualifiedPackageNameCollection> pkg_names(r->package_names(*c));
- for (QualifiedPackageNameCollection::Iterator p(pkg_names->begin()), p_end(pkg_names->end()) ;
+ tr1::shared_ptr<const QualifiedPackageNameSet> pkg_names(r->package_names(*c));
+ for (QualifiedPackageNameSet::Iterator p(pkg_names->begin()), p_end(pkg_names->end()) ;
p != p_end ; ++p)
{
if (CommandLine::get_instance()->a_package.specified())
diff --git a/src/clients/adjutrix/find_reverse_deps.cc b/src/clients/adjutrix/find_reverse_deps.cc
index 49a6d44..d83e423 100644
--- a/src/clients/adjutrix/find_reverse_deps.cc
+++ b/src/clients/adjutrix/find_reverse_deps.cc
@@ -21,10 +21,11 @@
#include "command_line.hh"
#include <output/colour.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/save.hh>
#include <paludis/util/log.hh>
#include <paludis/util/visitor-impl.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/query.hh>
#include <paludis/dep_spec.hh>
#include <paludis/package_database.hh>
@@ -132,7 +133,7 @@ namespace
{
tr1::shared_ptr<const PackageIDSequence> dep_entries(_db->query(
query::Matches(a), qo_order_by_version));
- tr1::shared_ptr<PackageIDSequence> matches(new PackageIDSequence::Concrete);
+ tr1::shared_ptr<PackageIDSequence> matches(new PackageIDSequence);
bool header_written = false;
@@ -270,8 +271,8 @@ int do_find_reverse_deps(NoConfigEnvironment & env)
write_repository_header(stringify(*spec), stringify(r->name()));
- tr1::shared_ptr<const CategoryNamePartCollection> cat_names(r->category_names());
- for (CategoryNamePartCollection::Iterator c(cat_names->begin()), c_end(cat_names->end()) ;
+ tr1::shared_ptr<const CategoryNamePartSet> cat_names(r->category_names());
+ for (CategoryNamePartSet::Iterator c(cat_names->begin()), c_end(cat_names->end()) ;
c != c_end ; ++c)
{
cerr << xterm_title("Checking " + stringify(*c) + " - adjutrix");
@@ -283,8 +284,8 @@ int do_find_reverse_deps(NoConfigEnvironment & env)
stringify(*c)))
continue;
- tr1::shared_ptr<const QualifiedPackageNameCollection> pkg_names(r->package_names(*c));
- for (QualifiedPackageNameCollection::Iterator p(pkg_names->begin()), p_end(pkg_names->end()) ;
+ tr1::shared_ptr<const QualifiedPackageNameSet> pkg_names(r->package_names(*c));
+ for (QualifiedPackageNameSet::Iterator p(pkg_names->begin()), p_end(pkg_names->end()) ;
p != p_end ; ++p)
{
if (CommandLine::get_instance()->a_package.specified())
diff --git a/src/clients/adjutrix/find_stable_candidates.cc b/src/clients/adjutrix/find_stable_candidates.cc
index 43409c6..eed3ad8 100644
--- a/src/clients/adjutrix/find_stable_candidates.cc
+++ b/src/clients/adjutrix/find_stable_candidates.cc
@@ -22,6 +22,8 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/iterator.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/set.hh>
#include <paludis/version_spec.hh>
#include <paludis/repository.hh>
#include <paludis/package_database.hh>
@@ -181,8 +183,8 @@ void do_find_stable_candidates(const Environment & env)
write_repository_header(keyword, r->name());
- tr1::shared_ptr<const CategoryNamePartCollection> cat_names(r->category_names());
- for (CategoryNamePartCollection::Iterator c(cat_names->begin()), c_end(cat_names->end()) ;
+ tr1::shared_ptr<const CategoryNamePartSet> cat_names(r->category_names());
+ for (CategoryNamePartSet::Iterator c(cat_names->begin()), c_end(cat_names->end()) ;
c != c_end ; ++c)
{
if (CommandLine::get_instance()->a_category.specified())
@@ -192,8 +194,8 @@ void do_find_stable_candidates(const Environment & env)
stringify(*c)))
continue;
- tr1::shared_ptr<const QualifiedPackageNameCollection> pkg_names(r->package_names(*c));
- for (QualifiedPackageNameCollection::Iterator p(pkg_names->begin()), p_end(pkg_names->end()) ;
+ tr1::shared_ptr<const QualifiedPackageNameSet> pkg_names(r->package_names(*c));
+ for (QualifiedPackageNameSet::Iterator p(pkg_names->begin()), p_end(pkg_names->end()) ;
p != p_end ; ++p)
{
if (CommandLine::get_instance()->a_package.specified())
diff --git a/src/clients/adjutrix/find_unused_packages.cc b/src/clients/adjutrix/find_unused_packages.cc
index 06d367a..8157bfa 100644
--- a/src/clients/adjutrix/find_unused_packages.cc
+++ b/src/clients/adjutrix/find_unused_packages.cc
@@ -23,6 +23,8 @@
#include <paludis/tasks/find_unused_packages_task.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/iterator.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/package_database.hh>
#include <set>
@@ -55,8 +57,8 @@ void do_find_unused_packages(const Environment & env)
cout << "Searching for unused packages in repository " << stringify(r->name()) << endl;
- tr1::shared_ptr<const CategoryNamePartCollection> categories(r->category_names());
- for (CategoryNamePartCollection::Iterator c(categories->begin()), c_end(categories->end()) ;
+ tr1::shared_ptr<const CategoryNamePartSet> categories(r->category_names());
+ for (CategoryNamePartSet::Iterator c(categories->begin()), c_end(categories->end()) ;
c != c_end ; ++c)
{
Context cat_context("When searching for unused packages in category '" + stringify(*c) + "':");
@@ -69,9 +71,9 @@ void do_find_unused_packages(const Environment & env)
continue;
cout << " In category " << stringify(*c) << ":" << endl;
- tr1::shared_ptr<const QualifiedPackageNameCollection> packages(r->package_names(*c));
+ tr1::shared_ptr<const QualifiedPackageNameSet> packages(r->package_names(*c));
- for (QualifiedPackageNameCollection::Iterator p(packages->begin()), p_end(packages->end()) ;
+ for (QualifiedPackageNameSet::Iterator p(packages->begin()), p_end(packages->end()) ;
p != p_end ; ++p)
{
Context pkg_context("When searching for unused packages with package name '" + stringify(*p) + "':");
diff --git a/src/clients/adjutrix/keywords_graph.cc b/src/clients/adjutrix/keywords_graph.cc
index aa63b1d..27265bc 100644
--- a/src/clients/adjutrix/keywords_graph.cc
+++ b/src/clients/adjutrix/keywords_graph.cc
@@ -24,6 +24,8 @@
#include <paludis/tasks/find_unused_packages_task.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/set.hh>
#include <paludis/query.hh>
#include <paludis/repository.hh>
#include <paludis/package_database.hh>
@@ -84,7 +86,7 @@ namespace
if (! repo.use_interface)
throw InternalError(PALUDIS_HERE, "Repository has no use_interface");
- tr1::shared_ptr<const UseFlagNameCollection> arch_flags(repo.use_interface->arch_flags());
+ tr1::shared_ptr<const UseFlagNameSet> arch_flags(repo.use_interface->arch_flags());
if (arch_flags->empty())
return;
@@ -108,7 +110,7 @@ namespace
for (unsigned h = 0 ; h < tallest_arch_name ; ++h)
{
cout << std::left << std::setw(version_specs_columns_width) << " " << "| ";
- for (UseFlagNameCollection::Iterator a(arch_flags->begin()), a_end(arch_flags->end()) ;
+ for (UseFlagNameSet::Iterator a(arch_flags->begin()), a_end(arch_flags->end()) ;
a != a_end ; ++a)
{
if ((tallest_arch_name - h) > a->data().length())
@@ -148,9 +150,9 @@ namespace
cout << std::left << std::setw(version_specs_columns_width) << p->canonical_form(idcf_version) << "| ";
- tr1::shared_ptr<const KeywordNameCollection> keywords(p->keywords_key()->value());
+ tr1::shared_ptr<const KeywordNameSet> keywords(p->keywords_key()->value());
- for (UseFlagNameCollection::Iterator a(arch_flags->begin()), a_end(arch_flags->end()) ;
+ for (UseFlagNameSet::Iterator a(arch_flags->begin()), a_end(arch_flags->end()) ;
a != a_end ; ++a)
{
if (keywords->end() != keywords->find(KeywordName(stringify(*a))))
@@ -192,8 +194,8 @@ void do_keywords_graph(const Environment & env)
if (r->name() == RepositoryName("virtuals"))
continue;
- tr1::shared_ptr<const CategoryNamePartCollection> cat_names(r->category_names());
- for (CategoryNamePartCollection::Iterator c(cat_names->begin()), c_end(cat_names->end()) ;
+ tr1::shared_ptr<const CategoryNamePartSet> cat_names(r->category_names());
+ for (CategoryNamePartSet::Iterator c(cat_names->begin()), c_end(cat_names->end()) ;
c != c_end ; ++c)
{
if (CommandLine::get_instance()->a_category.specified())
@@ -203,8 +205,8 @@ void do_keywords_graph(const Environment & env)
stringify(*c)))
continue;
- tr1::shared_ptr<const QualifiedPackageNameCollection> pkg_names(r->package_names(*c));
- for (QualifiedPackageNameCollection::Iterator p(pkg_names->begin()), p_end(pkg_names->end()) ;
+ tr1::shared_ptr<const QualifiedPackageNameSet> pkg_names(r->package_names(*c));
+ for (QualifiedPackageNameSet::Iterator p(pkg_names->begin()), p_end(pkg_names->end()) ;
p != p_end ; ++p)
{
if (CommandLine::get_instance()->a_package.specified())
diff --git a/src/clients/adjutrix/what_needs_keywording.cc b/src/clients/adjutrix/what_needs_keywording.cc
index 5d25d75..bbf9303 100644
--- a/src/clients/adjutrix/what_needs_keywording.cc
+++ b/src/clients/adjutrix/what_needs_keywording.cc
@@ -22,6 +22,8 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/strip.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/dep_list/exceptions.hh>
#include <paludis/dep_list/dep_list.hh>
@@ -103,8 +105,8 @@ int do_what_needs_keywording(NoConfigEnvironment & env)
if (p->package_id->keywords_key())
{
- tr1::shared_ptr<const KeywordNameCollection> keywords(p->package_id->keywords_key()->value());
- for (KeywordNameCollection::Iterator k(keywords->begin()), k_end(keywords->end()) ;
+ tr1::shared_ptr<const KeywordNameSet> keywords(p->package_id->keywords_key()->value());
+ for (KeywordNameSet::Iterator k(keywords->begin()), k_end(keywords->end()) ;
k != k_end ; ++k)
if (*k == KeywordName("-*")
|| *k == target_keyword
@@ -138,4 +140,3 @@ int do_what_needs_keywording(NoConfigEnvironment & env)
return return_code;
}
-
diff --git a/src/clients/contrarius/install.cc b/src/clients/contrarius/install.cc
index 2f5ea62..04b038d 100644
--- a/src/clients/contrarius/install.cc
+++ b/src/clients/contrarius/install.cc
@@ -34,6 +34,7 @@
#include <paludis/util/fd_output_stream.hh>
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/environment.hh>
#include <paludis/dep_list/exceptions.hh>
#include <paludis/query.hh>
@@ -343,7 +344,7 @@ do_install(tr1::shared_ptr<Environment> env, std::string spec_str)
{
if ((*pp)->keywords_key())
{
- tr1::shared_ptr<const KeywordNameCollection> keywords((*pp)->keywords_key()->value());
+ tr1::shared_ptr<const KeywordNameSet> keywords((*pp)->keywords_key()->value());
cerr << " ( " << colour(cl_masked, join(keywords->begin(),
keywords->end(), " ")) << " )";
}
diff --git a/src/clients/contrarius/stage.cc b/src/clients/contrarius/stage.cc
index b8b02a2..8a0db12 100644
--- a/src/clients/contrarius/stage.cc
+++ b/src/clients/contrarius/stage.cc
@@ -19,6 +19,7 @@
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/config_file.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/package_database.hh>
diff --git a/src/clients/contrarius/target_config.cc b/src/clients/contrarius/target_config.cc
index 5dd75bc..e382a3f 100644
--- a/src/clients/contrarius/target_config.cc
+++ b/src/clients/contrarius/target_config.cc
@@ -21,6 +21,7 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/options.hh>
#include <paludis/config_file.hh>
#include <list>
#include <string>
diff --git a/src/clients/paludis/applets.cc b/src/clients/paludis/applets.cc
index 9544c70..cd07d2b 100644
--- a/src/clients/paludis/applets.cc
+++ b/src/clients/paludis/applets.cc
@@ -24,7 +24,6 @@
#include <iostream>
#include <paludis/paludis.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
@@ -81,8 +80,7 @@ int do_best_version(tr1::shared_ptr<Environment> env)
"' resolves to '" << **entries->last() << "', which is a virtual for '"
<< *(*entries->last())->virtual_for_key()->value() << "'. This will break with "
"new style virtuals.";
- tr1::shared_ptr<PackageIDSequence> new_entries(
- new PackageIDSequence::Concrete);
+ tr1::shared_ptr<PackageIDSequence> new_entries(new PackageIDSequence);
new_entries->push_back((*entries->last())->virtual_for_key()->value());
entries = new_entries;
}
@@ -183,8 +181,8 @@ int do_list_sync_protocols(tr1::shared_ptr<Environment> env)
{
std::map<std::string, std::string> syncers;
- tr1::shared_ptr<const FSEntryCollection> sd(env->syncers_dirs());
- for (FSEntryCollection::Iterator d(sd->begin()),
+ tr1::shared_ptr<const FSEntrySequence> sd(env->syncers_dirs());
+ for (FSEntrySequence::Iterator d(sd->begin()),
d_end(sd->end()) ; d != d_end ; ++d)
{
FSEntry dir(*d);
diff --git a/src/clients/paludis/install.cc b/src/clients/paludis/install.cc
index 24f79dd..6b97195 100644
--- a/src/clients/paludis/install.cc
+++ b/src/clients/paludis/install.cc
@@ -41,9 +41,10 @@
#include <paludis/tasks/exceptions.hh>
#include <paludis/util/fd_output_stream.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/set.hh>
#include <paludis/util/system.hh>
#include <paludis/dep_list/exceptions.hh>
@@ -172,7 +173,7 @@ namespace
public:
OurInstallTask(tr1::shared_ptr<Environment> env, const DepListOptions & options,
- tr1::shared_ptr<const DestinationsCollection> destinations) :
+ tr1::shared_ptr<const DestinationsSet> destinations) :
ConsoleInstallTask(env.get(), options, destinations),
_env(env)
{
@@ -504,12 +505,12 @@ do_install(tr1::shared_ptr<Environment> env)
(CommandLine::get_instance()->a_show_reasons.argument() == "full"))
options.dependency_tags = true;
- tr1::shared_ptr<const DestinationsCollection> destinations;
+ tr1::shared_ptr<const DestinationsSet> destinations;
if (CommandLine::get_instance()->a_destinations.specified())
{
Context local_context("When building destinations collection:");
- tr1::shared_ptr<DestinationsCollection> d(new DestinationsCollection::Concrete);
+ tr1::shared_ptr<DestinationsSet> d(new DestinationsSet);
for (args::StringSetArg::Iterator i(CommandLine::get_instance()->a_destinations.begin_args()),
i_end(CommandLine::get_instance()->a_destinations.end_args()) ;
i != i_end ; ++i)
diff --git a/src/clients/paludis/list.cc b/src/clients/paludis/list.cc
index a25c09a..942caee 100644
--- a/src/clients/paludis/list.cc
+++ b/src/clients/paludis/list.cc
@@ -25,6 +25,7 @@
#include <paludis/repository_info.hh>
#include <paludis/util/log.hh>
#include <paludis/util/visitor.hh>
+#include <paludis/util/set.hh>
#include <src/output/colour.hh>
#include <paludis/util/tr1_memory.hh>
@@ -106,8 +107,8 @@ do_list_categories(tr1::shared_ptr<Environment> env)
r->format()))
continue;
- tr1::shared_ptr<const CategoryNamePartCollection> cat_names(r->category_names());
- for (CategoryNamePartCollection::Iterator c(cat_names->begin()), c_end(cat_names->end()) ;
+ tr1::shared_ptr<const CategoryNamePartSet> cat_names(r->category_names());
+ for (CategoryNamePartSet::Iterator c(cat_names->begin()), c_end(cat_names->end()) ;
c != c_end ; ++c)
cats[*c].push_back(r->name());
}
@@ -159,8 +160,8 @@ do_list_packages(tr1::shared_ptr<Environment> env)
r->format()))
continue;
- tr1::shared_ptr<const CategoryNamePartCollection> cat_names(r->category_names());
- for (CategoryNamePartCollection::Iterator c(cat_names->begin()), c_end(cat_names->end()) ;
+ tr1::shared_ptr<const CategoryNamePartSet> cat_names(r->category_names());
+ for (CategoryNamePartSet::Iterator c(cat_names->begin()), c_end(cat_names->end()) ;
c != c_end ; ++c)
{
if (CommandLine::get_instance()->a_category.specified())
@@ -170,8 +171,8 @@ do_list_packages(tr1::shared_ptr<Environment> env)
stringify(*c)))
continue;
- tr1::shared_ptr<const QualifiedPackageNameCollection> pkg_names(r->package_names(*c));
- for (QualifiedPackageNameCollection::Iterator p(pkg_names->begin()), p_end(pkg_names->end()) ;
+ tr1::shared_ptr<const QualifiedPackageNameSet> pkg_names(r->package_names(*c));
+ for (QualifiedPackageNameSet::Iterator p(pkg_names->begin()), p_end(pkg_names->end()) ;
p != p_end ; ++p)
pkgs[*p].push_back(r->name());
}
@@ -227,16 +228,16 @@ do_list_sets(tr1::shared_ptr<Environment> env)
r->format()))
continue;
- tr1::shared_ptr<const SetNameCollection> set_names(r->sets_interface->sets_list());
- for (SetNameCollection::Iterator s(set_names->begin()), s_end(set_names->end()) ;
+ tr1::shared_ptr<const SetNameSet> set_names(r->sets_interface->sets_list());
+ for (SetNameSet::Iterator s(set_names->begin()), s_end(set_names->end()) ;
s != s_end ; ++s)
sets[*s].push_back(stringify(r->name()));
}
if (! CommandLine::get_instance()->a_repository.specified())
{
- tr1::shared_ptr<const SetNameCollection> set_names(env->set_names());
- for (SetNameCollection::Iterator s(set_names->begin()), s_end(set_names->end()) ;
+ tr1::shared_ptr<const SetNameSet> set_names(env->set_names());
+ for (SetNameSet::Iterator s(set_names->begin()), s_end(set_names->end()) ;
s != s_end ; ++s)
sets[*s].push_back("environment");
}
diff --git a/src/clients/paludis/owner.cc b/src/clients/paludis/owner.cc
index 02e77e4..731918a 100644
--- a/src/clients/paludis/owner.cc
+++ b/src/clients/paludis/owner.cc
@@ -19,6 +19,7 @@
#include "owner.hh"
#include <paludis/util/visitor-impl.hh>
+#include <paludis/util/set.hh>
#include <src/output/colour.hh>
#include "command_line.hh"
#include <paludis/paludis.hh>
@@ -100,12 +101,12 @@ do_one_owner(
if (! (*r)->installed_interface)
continue;
- tr1::shared_ptr<const CategoryNamePartCollection> cats((*r)->category_names());
- for (CategoryNamePartCollection::Iterator c(cats->begin()),
+ tr1::shared_ptr<const CategoryNamePartSet> cats((*r)->category_names());
+ for (CategoryNamePartSet::Iterator c(cats->begin()),
c_end(cats->end()) ; c != c_end ; ++c)
{
- tr1::shared_ptr<const QualifiedPackageNameCollection> pkgs((*r)->package_names(*c));
- for (QualifiedPackageNameCollection::Iterator p(pkgs->begin()),
+ tr1::shared_ptr<const QualifiedPackageNameSet> pkgs((*r)->package_names(*c));
+ for (QualifiedPackageNameSet::Iterator p(pkgs->begin()),
p_end(pkgs->end()) ; p != p_end ; ++p)
{
tr1::shared_ptr<const PackageIDSequence> ids((*r)->package_ids(*p));
diff --git a/src/clients/paludis/query.cc b/src/clients/paludis/query.cc
index 33cbd9c..9cfe7c7 100644
--- a/src/clients/paludis/query.cc
+++ b/src/clients/paludis/query.cc
@@ -26,7 +26,6 @@
#include <iomanip>
#include <iostream>
#include <paludis/paludis.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/visitor-impl.hh>
#include <string>
diff --git a/src/clients/paludis/uninstall.cc b/src/clients/paludis/uninstall.cc
index cdff5f7..e59672e 100644
--- a/src/clients/paludis/uninstall.cc
+++ b/src/clients/paludis/uninstall.cc
@@ -22,6 +22,7 @@
#include <paludis/tasks/uninstall_task.hh>
#include <paludis/tasks/exceptions.hh>
+#include <paludis/util/set.hh>
#include <paludis/dep_list/uninstall_list.hh>
#include <paludis/package_database.hh>
@@ -95,7 +96,7 @@ namespace
else
max_count = std::numeric_limits<long>::max();
- for (SortedCollection<tr1::shared_ptr<DepTag> >::Iterator
+ for (Set<tr1::shared_ptr<DepTag> >::Iterator
tag(d.tags->begin()),
tag_end(d.tags->end()) ;
tag != tag_end ; ++tag)
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index da3ef7a..20df76e 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -23,11 +23,11 @@
#include "licence.hh"
#include <paludis/util/log.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/sr.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/join.hh>
+#include <paludis/util/set-impl.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/tr1_functional.hh>
@@ -77,11 +77,11 @@ UseDescriptionComparator::operator() (const UseDescription & lhs, const UseDescr
ConsoleInstallTask::ConsoleInstallTask(Environment * const env,
const DepListOptions & options,
- tr1::shared_ptr<const DestinationsCollection> d) :
+ tr1::shared_ptr<const DestinationsSet> d) :
InstallTask(env, options, d),
- _all_tags(new SortedCollection<DepTagEntry>::Concrete),
- _all_use_descriptions(new SortedCollection<UseDescription, UseDescriptionComparator>::Concrete),
- _all_expand_prefixes(new UseFlagNameCollection::Concrete)
+ _all_tags(new Set<DepTagEntry>),
+ _all_use_descriptions(new Set<UseDescription, UseDescriptionComparator>),
+ _all_expand_prefixes(new UseFlagNameSet)
{
std::fill_n(_counts, static_cast<int>(last_count), 0);
}
@@ -172,7 +172,7 @@ ConsoleInstallTask::on_display_merge_list_post()
display_merge_list_post_tags();
display_merge_list_post_use_descriptions("");
- for (UseFlagNameCollection::Iterator f(_all_expand_prefixes->begin()),
+ for (UseFlagNameSet::Iterator f(_all_expand_prefixes->begin()),
f_end(_all_expand_prefixes->end()) ; f != f_end ; ++f)
display_merge_list_post_use_descriptions(stringify(*f));
}
@@ -471,7 +471,7 @@ ConsoleInstallTask::display_merge_list_post_tags()
return;
std::set<std::string> tag_categories;
- for (SortedCollection<DepTagEntry>::Iterator a(all_tags()->begin()),
+ for (Set<DepTagEntry>::Iterator a(all_tags()->begin()),
a_end(all_tags()->end()) ; a != a_end ; ++a)
tag_categories.insert(a->tag->category());
@@ -489,7 +489,7 @@ ConsoleInstallTask::display_merge_list_post_tags()
display_tag_summary_tag_title(*c);
display_tag_summary_tag_pre_text(*c);
- for (SortedCollection<DepTagEntry>::Iterator t(all_tags()->begin()),
+ for (Set<DepTagEntry>::Iterator t(all_tags()->begin()),
t_end(all_tags()->end()) ; t != t_end ; ++t)
{
if (t->tag->category() != *cat)
@@ -512,9 +512,9 @@ ConsoleInstallTask::display_merge_list_post_use_descriptions(const std::string &
bool started(false);
UseFlagName old_flag("OFTEN_NOT_BEEN_ON_BOATS");
- tr1::shared_ptr<SortedCollection<UseDescription, UseDescriptionComparator> > group(
- new SortedCollection<UseDescription, UseDescriptionComparator>::Concrete);
- for (SortedCollection<UseDescription, UseDescriptionComparator>::Iterator i(all_use_descriptions()->begin()),
+ tr1::shared_ptr<Set<UseDescription, UseDescriptionComparator> > group(
+ new Set<UseDescription, UseDescriptionComparator>);
+ for (Set<UseDescription, UseDescriptionComparator>::Iterator i(all_use_descriptions()->begin()),
i_end(all_use_descriptions()->end()) ; i != i_end ; ++i)
{
switch (i->state)
@@ -538,7 +538,7 @@ ConsoleInstallTask::display_merge_list_post_use_descriptions(const std::string &
if (prefix.empty())
{
bool prefixed(false);
- for (UseFlagNameCollection::Iterator f(_all_expand_prefixes->begin()),
+ for (UseFlagNameSet::Iterator f(_all_expand_prefixes->begin()),
f_end(_all_expand_prefixes->end()) ; f != f_end && ! prefixed ; ++f)
if (0 == stringify(i->flag).compare(0, stringify(*f).length(), stringify(*f)))
prefixed = true;
@@ -563,7 +563,7 @@ ConsoleInstallTask::display_merge_list_post_use_descriptions(const std::string &
if (! group->empty())
display_use_summary_flag(prefix, group->begin(), group->end());
old_flag = i->flag;
- group.reset(new SortedCollection<UseDescription, UseDescriptionComparator>::Concrete);
+ group.reset(new Set<UseDescription, UseDescriptionComparator>);
}
group->insert(*i);
@@ -587,8 +587,8 @@ ConsoleInstallTask::display_use_summary_start(const std::string & prefix)
void
ConsoleInstallTask::display_use_summary_flag(const std::string & prefix,
- SortedCollection<UseDescription, UseDescriptionComparator>::Iterator i,
- SortedCollection<UseDescription, UseDescriptionComparator>::Iterator i_end)
+ Set<UseDescription, UseDescriptionComparator>::Iterator i,
+ Set<UseDescription, UseDescriptionComparator>::Iterator i_end)
{
if (next(i) == i_end)
{
@@ -601,7 +601,7 @@ ConsoleInstallTask::display_use_summary_flag(const std::string & prefix,
else
{
bool all_same(true);
- for (SortedCollection<UseDescription, UseDescriptionComparator>::Iterator j(next(i)) ; all_same && j != i_end ; ++j)
+ for (Set<UseDescription, UseDescriptionComparator>::Iterator j(next(i)) ; all_same && j != i_end ; ++j)
if (j->description != i->description)
all_same = false;
@@ -842,7 +842,7 @@ ConsoleInstallTask::display_merge_list_entry_status_and_update_counts(const DepL
output_no_endl(render_as_update_mode(", "));
std::string destination_str;
- tr1::shared_ptr<const DestinationsCollection> default_destinations(environment()->default_destinations());
+ tr1::shared_ptr<const DestinationsSet> default_destinations(environment()->default_destinations());
if (default_destinations->end() == default_destinations->find(d.destination))
destination_str = " ::" + stringify(d.destination->name());
@@ -914,10 +914,10 @@ ConsoleInstallTask::display_merge_list_entry_status_and_update_counts(const DepL
}
void
-ConsoleInstallTask::_add_descriptions(tr1::shared_ptr<const UseFlagNameCollection> c,
+ConsoleInstallTask::_add_descriptions(tr1::shared_ptr<const UseFlagNameSet> c,
const tr1::shared_ptr<const PackageID> & p, UseDescriptionState s)
{
- for (UseFlagNameCollection::Iterator f(c->begin()), f_end(c->end()) ;
+ for (UseFlagNameSet::Iterator f(c->begin()), f_end(c->end()) ;
f != f_end ; ++f)
{
std::string d;
@@ -946,7 +946,7 @@ ConsoleInstallTask::display_merge_list_entry_use(const DepListEntry & d,
output_no_endl(" ");
tr1::shared_ptr<UseFlagPrettyPrinter> printer(make_use_flag_pretty_printer());
tr1::shared_ptr<const PackageID> old_id;
- tr1::shared_ptr<const IUseFlagCollection> old;
+ tr1::shared_ptr<const IUseFlagSet> old;
if (! existing_slot_repo->empty())
old_id = *existing_slot_repo->last();
@@ -962,8 +962,7 @@ ConsoleInstallTask::display_merge_list_entry_use(const DepListEntry & d,
_add_descriptions(printer->new_flags(), d.package_id, uds_new);
_add_descriptions(printer->changed_flags(), d.package_id, uds_changed);
_add_descriptions(printer->unchanged_flags(), d.package_id, uds_unchanged);
- _all_expand_prefixes->insert(printer->expand_prefixes()->begin(),
- printer->expand_prefixes()->end());
+ std::copy(printer->expand_prefixes()->begin(), printer->expand_prefixes()->end(), _all_expand_prefixes->inserter());
}
void
@@ -974,7 +973,7 @@ ConsoleInstallTask::display_merge_list_entry_tags(const DepListEntry & d, const
std::string tag_titles;
- for (SortedCollection<DepTagEntry>::Iterator
+ for (Set<DepTagEntry>::Iterator
tag(d.tags->begin()),
tag_end(d.tags->end()) ;
tag != tag_end ; ++tag)
@@ -1017,7 +1016,7 @@ ConsoleInstallTask::display_merge_list_entry_tags(const DepListEntry & d, const
std::set<std::string> dependents, unsatisfied_dependents;
unsigned c(0), max_c(want_full_install_reasons() ? std::numeric_limits<long>::max() : 3);
- for (SortedCollection<DepTagEntry>::Iterator
+ for (Set<DepTagEntry>::Iterator
tag(d.tags->begin()),
tag_end(d.tags->end()) ;
tag != tag_end ; ++tag)
@@ -1167,7 +1166,7 @@ ConsoleInstallTask::display_merge_list_entry_mask_reasons(const DepListEntry & e
{
if (e.package_id->keywords_key())
{
- tr1::shared_ptr<const KeywordNameCollection> keywords(e.package_id->keywords_key()->value());
+ tr1::shared_ptr<const KeywordNameSet> keywords(e.package_id->keywords_key()->value());
output_no_endl(" ( " + render_as_masked(join(keywords->begin(), keywords->end(), " ")) + " )");
}
}
diff --git a/src/output/console_install_task.hh b/src/output/console_install_task.hh
index 3efde75..f6d108e 100644
--- a/src/output/console_install_task.hh
+++ b/src/output/console_install_task.hh
@@ -21,6 +21,7 @@
#define PALUDIS_GUARD_SRC_CONSOLE_INSTALL_TASK_HH 1
#include <paludis/tasks/install_task.hh>
+#include <paludis/util/set.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <src/output/use_flag_pretty_printer.hh>
#include <src/output/console_task.hh>
@@ -115,16 +116,16 @@ namespace paludis
private:
int _counts[last_count];
- tr1::shared_ptr<SortedCollection<DepTagEntry> > _all_tags;
- tr1::shared_ptr<SortedCollection<UseDescription, UseDescriptionComparator> > _all_use_descriptions;
- tr1::shared_ptr<UseFlagNameCollection> _all_expand_prefixes;
+ tr1::shared_ptr<Set<DepTagEntry> > _all_tags;
+ tr1::shared_ptr<Set<UseDescription, UseDescriptionComparator> > _all_use_descriptions;
+ tr1::shared_ptr<UseFlagNameSet> _all_expand_prefixes;
- void _add_descriptions(tr1::shared_ptr<const UseFlagNameCollection>,
+ void _add_descriptions(tr1::shared_ptr<const UseFlagNameSet>,
const tr1::shared_ptr<const PackageID> &, UseDescriptionState);
protected:
ConsoleInstallTask(Environment * const env, const DepListOptions & options,
- tr1::shared_ptr<const DestinationsCollection>);
+ tr1::shared_ptr<const DestinationsSet>);
public:
virtual void on_build_deplist_pre();
@@ -209,8 +210,8 @@ namespace paludis
virtual void display_merge_list_post_use_descriptions(const std::string &);
virtual void display_use_summary_start(const std::string &);
virtual void display_use_summary_flag(const std::string &,
- SortedCollection<UseDescription, UseDescriptionComparator>::Iterator,
- SortedCollection<UseDescription, UseDescriptionComparator>::Iterator);
+ Set<UseDescription, UseDescriptionComparator>::Iterator,
+ Set<UseDescription, UseDescriptionComparator>::Iterator);
virtual void display_use_summary_end();
///\}
@@ -230,12 +231,12 @@ namespace paludis
_counts[count_] = value;
}
- tr1::shared_ptr<SortedCollection<DepTagEntry> > all_tags()
+ tr1::shared_ptr<Set<DepTagEntry> > all_tags()
{
return _all_tags;
}
- tr1::shared_ptr<SortedCollection<UseDescription, UseDescriptionComparator> > all_use_descriptions()
+ tr1::shared_ptr<Set<UseDescription, UseDescriptionComparator> > all_use_descriptions()
{
return _all_use_descriptions;
}
diff --git a/src/output/console_query_task.cc b/src/output/console_query_task.cc
index 9b66c0f..21e6953 100644
--- a/src/output/console_query_task.cc
+++ b/src/output/console_query_task.cc
@@ -21,10 +21,10 @@
#include "licence.hh"
#include "use_flag_pretty_printer.hh"
#include <paludis/util/visitor-impl.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/set.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <paludis/query.hh>
@@ -107,14 +107,14 @@ ConsoleQueryTask::display_versions_by_repository(const PackageDepSpec &,
const tr1::shared_ptr<const PackageID> & display_entry) const
{
/* find all repository names. */
- RepositoryNameCollection::Concrete repo_names;
+ RepositoryNameSequence repo_names;
PackageIDSequence::Iterator e(entries->begin()), e_end(entries->end());
for ( ; e != e_end ; ++e)
if (repo_names.end() == std::find(repo_names.begin(), repo_names.end(), (*e)->repository()->name()))
repo_names.push_back((*e)->repository()->name());
/* display versions, by repository. */
- RepositoryNameCollection::Iterator r(repo_names.begin()), r_end(repo_names.end());
+ RepositoryNameSequence::Iterator r(repo_names.begin()), r_end(repo_names.end());
for ( ; r != r_end ; ++r)
{
output_left_column(stringify(*r) + ":");
@@ -215,26 +215,26 @@ namespace
{
}
- void visit(const MetadataCollectionKey<IUseFlagCollection> & k)
+ void visit(const MetadataSetKey<IUseFlagSet> & k)
{
if (k.type() == type)
task->display_metadata_iuse(k.human_name(), k.raw_name(), join(k.value()->begin(), k.value()->end(), " "),
id, k.value());
}
- void visit(const MetadataCollectionKey<InheritedCollection> & k)
+ void visit(const MetadataSetKey<InheritedSet> & k)
{
if (k.type() == type)
task->display_metadata_key(k.human_name(), k.raw_name(), join(k.value()->begin(), k.value()->end(), " "));
}
- void visit(const MetadataCollectionKey<UseFlagNameCollection> & k)
+ void visit(const MetadataSetKey<UseFlagNameSet> & k)
{
if (k.type() == type)
task->display_metadata_key(k.human_name(), k.raw_name(), join(k.value()->begin(), k.value()->end(), " "));
}
- void visit(const MetadataCollectionKey<KeywordNameCollection> & k)
+ void visit(const MetadataSetKey<KeywordNameSet> & k)
{
if (k.type() == type)
task->display_metadata_key(k.human_name(), k.raw_name(), join(k.value()->begin(), k.value()->end(), " "));
@@ -500,7 +500,7 @@ ConsoleQueryTask::display_metadata_time(const std::string & k, const std::string
void
ConsoleQueryTask::display_metadata_iuse(const std::string & k, const std::string & kk,
const std::string & v, const tr1::shared_ptr<const PackageID> & id,
- const tr1::shared_ptr<const IUseFlagCollection> & e) const
+ const tr1::shared_ptr<const IUseFlagSet> & e) const
{
if (v.empty())
return;
diff --git a/src/output/console_query_task.hh b/src/output/console_query_task.hh
index d729e51..8ab3377 100644
--- a/src/output/console_query_task.hh
+++ b/src/output/console_query_task.hh
@@ -64,7 +64,7 @@ namespace paludis
virtual void display_metadata_time(const std::string &, const std::string &, time_t) const;
virtual void display_metadata_iuse(const std::string &, const std::string &, const std::string &,
const tr1::shared_ptr<const PackageID> & id,
- const tr1::shared_ptr<const IUseFlagCollection> &) const;
+ const tr1::shared_ptr<const IUseFlagSet> &) const;
virtual bool want_deps() const = 0;
virtual bool want_raw() const = 0;
diff --git a/src/output/use_flag_pretty_printer.cc b/src/output/use_flag_pretty_printer.cc
index 79c3117..5cedfbf 100644
--- a/src/output/use_flag_pretty_printer.cc
+++ b/src/output/use_flag_pretty_printer.cc
@@ -21,9 +21,9 @@
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
#include <paludis/package_database.hh>
-#include <paludis/util/collection_concrete.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/set.hh>
#include <paludis/metadata_key.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
@@ -36,10 +36,10 @@ using namespace paludis;
UseFlagPrettyPrinter::UseFlagPrettyPrinter(const Environment * const e) :
_env(e),
_need_space(false),
- _new_flags(new UseFlagNameCollection::Concrete),
- _changed_flags(new UseFlagNameCollection::Concrete),
- _unchanged_flags(new UseFlagNameCollection::Concrete),
- _expand_prefixes(new UseFlagNameCollection::Concrete)
+ _new_flags(new UseFlagNameSet),
+ _changed_flags(new UseFlagNameSet),
+ _unchanged_flags(new UseFlagNameSet),
+ _expand_prefixes(new UseFlagNameSet)
{
}
@@ -49,9 +49,9 @@ UseFlagPrettyPrinter::~UseFlagPrettyPrinter()
std::string::size_type
UseFlagPrettyPrinter::use_expand_delim_pos(const UseFlagName & u,
- const tr1::shared_ptr<const UseFlagNameCollection> c) const
+ const tr1::shared_ptr<const UseFlagNameSet> c) const
{
- for (UseFlagNameCollection::Iterator i(c->begin()), i_end(c->end()) ; i != i_end ; ++i)
+ for (UseFlagNameSet::Iterator i(c->begin()), i_end(c->end()) ; i != i_end ; ++i)
if (0 == u.data().compare(0, i->data().length(), i->data(), 0, i->data().length()))
return i->data().length();
return std::string::npos;
@@ -60,9 +60,9 @@ UseFlagPrettyPrinter::use_expand_delim_pos(const UseFlagName & u,
void
UseFlagPrettyPrinter::print_package_flags(
const tr1::shared_ptr<const PackageID> & pkg,
- const tr1::shared_ptr<const IUseFlagCollection> & iuse_c,
+ const tr1::shared_ptr<const IUseFlagSet> & iuse_c,
const tr1::shared_ptr<const PackageID> & old_pkg,
- const tr1::shared_ptr<const IUseFlagCollection> & old_iuse_c)
+ const tr1::shared_ptr<const IUseFlagSet> & old_iuse_c)
{
std::set<UseFlagName> iuse, old_iuse;
@@ -260,25 +260,25 @@ UseFlagPrettyPrinter::environment() const
return _env;
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
UseFlagPrettyPrinter::new_flags() const
{
return _new_flags;
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
UseFlagPrettyPrinter::changed_flags() const
{
return _changed_flags;
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
UseFlagPrettyPrinter::unchanged_flags() const
{
return _unchanged_flags;
}
-tr1::shared_ptr<const UseFlagNameCollection>
+tr1::shared_ptr<const UseFlagNameSet>
UseFlagPrettyPrinter::expand_prefixes() const
{
return _expand_prefixes;
diff --git a/src/output/use_flag_pretty_printer.hh b/src/output/use_flag_pretty_printer.hh
index 1ec5ca8..8f8c5f1 100644
--- a/src/output/use_flag_pretty_printer.hh
+++ b/src/output/use_flag_pretty_printer.hh
@@ -35,14 +35,14 @@ namespace paludis
const Environment * const _env;
bool _need_space;
- tr1::shared_ptr<UseFlagNameCollection> _new_flags;
- tr1::shared_ptr<UseFlagNameCollection> _changed_flags;
- tr1::shared_ptr<UseFlagNameCollection> _unchanged_flags;
- tr1::shared_ptr<UseFlagNameCollection> _expand_prefixes;
+ tr1::shared_ptr<UseFlagNameSet> _new_flags;
+ tr1::shared_ptr<UseFlagNameSet> _changed_flags;
+ tr1::shared_ptr<UseFlagNameSet> _unchanged_flags;
+ tr1::shared_ptr<UseFlagNameSet> _expand_prefixes;
protected:
std::string::size_type use_expand_delim_pos(const UseFlagName & u,
- const tr1::shared_ptr<const UseFlagNameCollection> c) const;
+ const tr1::shared_ptr<const UseFlagNameSet> c) const;
public:
UseFlagPrettyPrinter(const Environment * const);
@@ -50,9 +50,9 @@ namespace paludis
virtual void print_package_flags(
const tr1::shared_ptr<const PackageID> &,
- const tr1::shared_ptr<const IUseFlagCollection> &,
+ const tr1::shared_ptr<const IUseFlagSet> &,
const tr1::shared_ptr<const PackageID> & w = tr1::shared_ptr<const PackageID>(),
- const tr1::shared_ptr<const IUseFlagCollection> & x = tr1::shared_ptr<const IUseFlagCollection>());
+ const tr1::shared_ptr<const IUseFlagSet> & x = tr1::shared_ptr<const IUseFlagSet>());
virtual void output_flag(const std::string &);
virtual void output_flag_changed_mark();
@@ -69,10 +69,10 @@ namespace paludis
const Environment * environment() const;
bool need_space() const;
- tr1::shared_ptr<const UseFlagNameCollection> new_flags() const;
- tr1::shared_ptr<const UseFlagNameCollection> changed_flags() const;
- tr1::shared_ptr<const UseFlagNameCollection> unchanged_flags() const;
- tr1::shared_ptr<const UseFlagNameCollection> expand_prefixes() const;
+ tr1::shared_ptr<const UseFlagNameSet> new_flags() const;
+ tr1::shared_ptr<const UseFlagNameSet> changed_flags() const;
+ tr1::shared_ptr<const UseFlagNameSet> unchanged_flags() const;
+ tr1::shared_ptr<const UseFlagNameSet> expand_prefixes() const;
};
}