aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-27 22:10:48 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-28 00:54:36 +0000
commit1945bc4f10d16e53392a945fd39f87e435256a45 (patch)
tree25fdaa07a2b30b0a3387ba9f9938b30785c54083
parent2adc701cea7587b027bffd94ac6fb069e7722342 (diff)
downloadpaludis-1945bc4f10d16e53392a945fd39f87e435256a45.tar.gz
paludis-1945bc4f10d16e53392a945fd39f87e435256a45.tar.xz
Don't use virtuals for wrapped forward iterators
-rw-r--r--paludis/action.cc4
-rw-r--r--paludis/args/args_group.cc13
-rw-r--r--paludis/args/args_group.hh4
-rw-r--r--paludis/args/args_handler.cc84
-rw-r--r--paludis/args/args_handler.hh24
-rw-r--r--paludis/args/args_option.cc48
-rw-r--r--paludis/args/args_option.hh22
-rw-r--r--paludis/args/args_section.cc7
-rw-r--r--paludis/args/args_section.hh3
-rw-r--r--paludis/args/args_visitor.cc8
-rw-r--r--paludis/args/args_visitor.hh11
-rw-r--r--paludis/args/dep_list_args_group.hh3
-rw-r--r--paludis/args/install_args_group.cc1
-rw-r--r--paludis/args/install_args_group.hh3
-rw-r--r--paludis/args/man.hh2
-rw-r--r--paludis/choice.cc22
-rw-r--r--paludis/choice.hh5
-rw-r--r--paludis/contents.cc10
-rw-r--r--paludis/contents.hh4
-rw-r--r--paludis/dep_label.cc15
-rw-r--r--paludis/dep_label.hh5
-rw-r--r--paludis/dep_list.cc38
-rw-r--r--paludis/dep_list.hh5
-rw-r--r--paludis/dep_spec.cc17
-rw-r--r--paludis/dep_spec.hh8
-rw-r--r--paludis/dep_spec_flattener.cc34
-rw-r--r--paludis/dep_spec_flattener.hh13
-rw-r--r--paludis/environment.cc7
-rw-r--r--paludis/environment_implementation.cc3
-rw-r--r--paludis/environments/no_config/no_config_environment.cc1
-rw-r--r--paludis/environments/paludis/paludis_config.cc12
-rw-r--r--paludis/find_unused_packages_task.cc2
-rw-r--r--paludis/fuzzy_finder.cc22
-rw-r--r--paludis/fuzzy_finder.hh8
-rw-r--r--paludis/hook.cc16
-rw-r--r--paludis/hook.hh8
-rw-r--r--paludis/install_task.cc14
-rw-r--r--paludis/install_task.hh6
-rw-r--r--paludis/match_package.cc3
-rw-r--r--paludis/metadata_key_holder.cc10
-rw-r--r--paludis/metadata_key_holder.hh10
-rw-r--r--paludis/ndbam.cc6
-rw-r--r--paludis/output_manager_factory.cc12
-rw-r--r--paludis/output_manager_factory.hh3
-rw-r--r--paludis/package_database.cc21
-rw-r--r--paludis/package_database.hh9
-rw-r--r--paludis/package_id.cc47
-rw-r--r--paludis/package_id.hh7
-rw-r--r--paludis/range_rewriter_TEST.cc1
-rw-r--r--paludis/repositories/accounts/accounts_dep_key.cc10
-rw-r--r--paludis/repositories/accounts/accounts_id.cc1
-rw-r--r--paludis/repositories/cran/dep_spec_pretty_printer.cc1
-rw-r--r--paludis/repositories/e/aa_visitor.cc12
-rw-r--r--paludis/repositories/e/check_fetched_files_visitor.cc2
-rw-r--r--paludis/repositories/e/dep_spec_pretty_printer.cc1
-rw-r--r--paludis/repositories/e/dependencies_rewriter.cc1
-rw-r--r--paludis/repositories/e/e_choices_key.cc8
-rw-r--r--paludis/repositories/e/e_key.cc2
-rw-r--r--paludis/repositories/e/e_repository.cc1
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc3
-rw-r--r--paludis/repositories/e/e_repository_mask_file.cc15
-rw-r--r--paludis/repositories/e/e_repository_mask_file.hh6
-rw-r--r--paludis/repositories/e/e_repository_news.cc34
-rw-r--r--paludis/repositories/e/e_repository_sets.cc2
-rw-r--r--paludis/repositories/e/eapi_phase.cc23
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc1
-rw-r--r--paludis/repositories/e/ebuild_id.cc2
-rw-r--r--paludis/repositories/e/exndbam_repository.cc2
-rw-r--r--paludis/repositories/e/fetch_visitor.cc1
-rw-r--r--paludis/repositories/e/fix_locked_dependencies.cc1
-rw-r--r--paludis/repositories/e/glsa.cc38
-rw-r--r--paludis/repositories/e/layout.cc6
-rw-r--r--paludis/repositories/e/manifest2_reader.cc15
-rw-r--r--paludis/repositories/e/myoptions_requirements_verifier.cc1
-rw-r--r--paludis/repositories/e/pipe_command_handler.cc2
-rw-r--r--paludis/repositories/e/pretend_fetch_visitor.cc1
-rw-r--r--paludis/repositories/e/profile.cc7
-rw-r--r--paludis/repositories/e/profile_file.cc21
-rw-r--r--paludis/repositories/e/source_uri_finder.cc18
-rw-r--r--paludis/repositories/e/vdb_repository.cc21
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc3
-rw-r--r--paludis/repositories/fake/dep_parser_TEST.cc1
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc2
-rw-r--r--paludis/repositories/fake/fake_package_id.cc1
-rw-r--r--paludis/repositories/gems/gem_specifications.cc15
-rw-r--r--paludis/repositories/gems/yaml.cc21
-rw-r--r--paludis/repositories/gems/yaml.hh8
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_file.cc12
-rw-r--r--paludis/repositories/unpackaged/dep_printer.cc1
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc2
-rw-r--r--paludis/repositories/unpackaged/installed_repository_TEST.cc1
-rw-r--r--paludis/repositories/unwritten/unwritten_repository_file.cc19
-rw-r--r--paludis/repository_factory.cc12
-rw-r--r--paludis/repository_factory.hh3
-rw-r--r--paludis/resolver/constraint.cc9
-rw-r--r--paludis/resolver/constraint.hh2
-rw-r--r--paludis/resolver/decider.cc3
-rw-r--r--paludis/resolver/destination.cc1
-rw-r--r--paludis/resolver/resolutions.cc8
-rw-r--r--paludis/resolver/resolutions.hh4
-rw-r--r--paludis/resolver/resolvent.cc2
-rw-r--r--paludis/resolver/resolver.cc2
-rw-r--r--paludis/resolver/resolver_test.cc8
-rw-r--r--paludis/resolver/sanitised_dependencies.cc12
-rw-r--r--paludis/selection.cc3
-rw-r--r--paludis/serialise.cc9
-rw-r--r--paludis/set_file_TEST.cc2
-rw-r--r--paludis/show_suggest_visitor.cc1
-rw-r--r--paludis/spec_tree-fwd.hh3
-rw-r--r--paludis/spec_tree.cc12
-rw-r--r--paludis/spec_tree.hh27
-rw-r--r--paludis/sync_task.cc10
-rw-r--r--paludis/uninstall_list.cc18
-rw-r--r--paludis/uninstall_list.hh6
-rw-r--r--paludis/uninstall_task.cc13
-rw-r--r--paludis/user_dep_spec.cc1
-rw-r--r--paludis/util/config_file.cc26
-rw-r--r--paludis/util/config_file.hh6
-rw-r--r--paludis/util/fs_entry.cc17
-rw-r--r--paludis/util/graph-impl.hh8
-rw-r--r--paludis/util/map-fwd.hh5
-rw-r--r--paludis/util/map-impl.hh8
-rw-r--r--paludis/util/map.hh13
-rw-r--r--paludis/util/sequence-fwd.hh8
-rw-r--r--paludis/util/sequence-impl.hh12
-rw-r--r--paludis/util/sequence.cc2
-rw-r--r--paludis/util/sequence.hh4
-rw-r--r--paludis/util/set-fwd.hh5
-rw-r--r--paludis/util/set-impl.hh8
-rw-r--r--paludis/util/set.hh9
-rw-r--r--paludis/util/system.cc15
-rw-r--r--paludis/util/wrapped_forward_iterator-fwd.hh7
-rw-r--r--paludis/util/wrapped_forward_iterator-impl.hh143
-rw-r--r--paludis/util/wrapped_forward_iterator.hh7
-rw-r--r--paludis/util/wrapped_forward_iterator_TEST.cc11
-rw-r--r--paludis/version_spec.cc6
-rw-r--r--python/dep_spec.cc22
-rw-r--r--ruby/dep_spec.cc1
-rw-r--r--ruby/paludis_ruby.cc11
-rw-r--r--src/clients/adjutrix/find_insecure_packages.cc1
-rw-r--r--src/clients/adjutrix/find_reverse_deps.cc1
-rw-r--r--src/clients/adjutrix/what_needs_keywording.cc2
-rw-r--r--src/clients/cave/cmd_display_resolution.cc1
-rw-r--r--src/clients/cave/cmd_print_id_executables.cc2
-rw-r--r--src/clients/cave/cmd_resolve.cc2
-rw-r--r--src/clients/cave/cmd_resolve_dump.cc3
-rw-r--r--src/clients/cave/command_factory.cc6
-rw-r--r--src/clients/inquisitio/key_extractor.cc1
-rw-r--r--src/clients/instruo/instruo.cc1
-rw-r--r--src/clients/paludis/info.cc2
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc37
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/configuration.cc10
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/configuration.hh9
-rw-r--r--src/clients/reconcilio/littlelf/elf.cc6
-rw-r--r--src/clients/reconcilio/littlelf/elf.hh5
-rw-r--r--src/clients/reconcilio/littlelf/elf_dynamic_section.cc7
-rw-r--r--src/clients/reconcilio/littlelf/elf_dynamic_section.hh5
-rw-r--r--src/clients/reconcilio/littlelf/elf_relocation_section.cc6
-rw-r--r--src/clients/reconcilio/littlelf/elf_relocation_section.hh5
-rw-r--r--src/clients/reconcilio/littlelf/elf_symbol_section.cc7
-rw-r--r--src/clients/reconcilio/littlelf/elf_symbol_section.hh5
-rw-r--r--src/output/console_install_task.cc3
-rw-r--r--src/output/console_query_task.cc8
163 files changed, 1275 insertions, 371 deletions
diff --git a/paludis/action.cc b/paludis/action.cc
index 03658db..c130391 100644
--- a/paludis/action.cc
+++ b/paludis/action.cc
@@ -21,8 +21,11 @@
#include <paludis/repository.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
+
#include <paludis/util/sequence-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_output_iterator-impl.hh>
+
#include <ostream>
using namespace paludis;
@@ -292,4 +295,5 @@ template class PrivateImplementationPattern<ConfigAction>;
template class Sequence<FetchActionFailure>;
template class WrappedForwardIterator<Sequence<FetchActionFailure>::ConstIteratorTag, const FetchActionFailure>;
+template class WrappedOutputIterator<Sequence<FetchActionFailure>::InserterTag, FetchActionFailure>;
diff --git a/paludis/args/args_group.cc b/paludis/args/args_group.cc
index 12faa3f..0efd6c4 100644
--- a/paludis/args/args_group.cc
+++ b/paludis/args/args_group.cc
@@ -17,7 +17,8 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "args.hh"
+#include <paludis/args/args_group.hh>
+#include <paludis/args/args_section.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <list>
@@ -25,8 +26,6 @@
using namespace paludis;
using namespace paludis::args;
-template class WrappedForwardIterator<ArgsGroup::ConstIteratorTag, ArgsOption * const>;
-
namespace paludis
{
/**
@@ -39,6 +38,12 @@ namespace paludis
{
std::list<ArgsOption *> args_options;
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<ArgsGroup::ConstIteratorTag>
+ {
+ typedef std::list<ArgsOption *>::const_iterator UnderlyingIterator;
+ };
}
ArgsGroup::ArgsGroup(ArgsSection * s, const std::string & our_name,
@@ -80,3 +85,5 @@ ArgsGroup::end() const
return ConstIterator(_imp->args_options.end());
}
+template class WrappedForwardIterator<ArgsGroup::ConstIteratorTag, ArgsOption * const>;
+
diff --git a/paludis/args/args_group.hh b/paludis/args/args_group.hh
index 706c59f..7087f8d 100644
--- a/paludis/args/args_group.hh
+++ b/paludis/args/args_group.hh
@@ -117,6 +117,10 @@ namespace paludis
}
};
}
+
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+ extern template class WrappedForwardIterator<args::ArgsGroup::ConstIteratorTag, args::ArgsOption * const>;
+#endif
}
#endif
diff --git a/paludis/args/args_handler.cc b/paludis/args/args_handler.cc
index 8f6794a..758fbf0 100644
--- a/paludis/args/args_handler.cc
+++ b/paludis/args/args_handler.cc
@@ -17,16 +17,21 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "args.hh"
-#include "args_dumper.hh"
+#include <paludis/args/args_handler.hh>
+#include <paludis/args/args_dumper.hh>
+#include <paludis/args/args_visitor.hh>
+#include <paludis/args/bad_argument.hh>
#include <paludis/util/system.hh>
#include <paludis/util/join.hh>
+#include <paludis/util/accept_visitor.hh>
+
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/wrapped_output_iterator-impl.hh>
#include <paludis/util/create_iterator-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/accept_visitor.hh>
+#include <paludis/util/sequence-impl.hh>
+
#include <tr1/memory>
#include <algorithm>
#include <sstream>
@@ -36,16 +41,6 @@
using namespace paludis;
using namespace paludis::args;
-template class WrappedForwardIterator<ArgsHandler::ParametersConstIteratorTag, const std::string>;
-template class WrappedForwardIterator<ArgsHandler::UsageLineConstIteratorTag, const std::string>;
-template class WrappedForwardIterator<ArgsHandler::EnvironmentLineConstIteratorTag,
- const std::pair<std::string, std::string> >;
-template class WrappedForwardIterator<ArgsHandler::ExamplesConstIteratorTag,
- const std::pair<std::string, std::string> >;
-template class WrappedForwardIterator<ArgsHandler::ArgsSectionsConstIteratorTag, const ArgsSection>;
-template class WrappedForwardIterator<ArgsHandler::NotesIteratorTag, const std::string>;
-template class WrappedForwardIterator<ArgsHandler::DescriptionLineConstIterator, const std::string>;
-
namespace paludis
{
/**
@@ -69,6 +64,54 @@ namespace paludis
std::tr1::shared_ptr<ArgsSection> main_options_section;
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<ArgsHandler::ArgsSectionsConstIteratorTag>
+ {
+ typedef IndirectIterator<std::list<ArgsSection *>::const_iterator> UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<ArgsHandler::ParametersConstIteratorTag>
+ {
+ typedef std::list<std::string>::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<ArgsHandler::NotesIteratorTag>
+ {
+ typedef std::list<std::string>::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<ArgsHandler::DescriptionLineConstIteratorTag>
+ {
+ typedef std::list<std::string>::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<ArgsHandler::ExamplesConstIteratorTag>
+ {
+ typedef std::list<std::pair<std::string, std::string> >::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<ArgsHandler::EnvironmentLineConstIteratorTag>
+ {
+ typedef std::list<std::pair<std::string, std::string> >::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<ArgsHandler::UsageLineConstIteratorTag>
+ {
+ typedef std::list<std::string>::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<ArgsHandler::ArgsIteratorTag>
+ {
+ typedef std::list<std::string>::iterator UnderlyingIterator;
+ };
}
ArgsHandler::ArgsHandler() :
@@ -137,7 +180,7 @@ ArgsHandler::run(
args.insert(args.end(), argseq->begin(), argseq->end());
- ArgsVisitor::ArgsIterator argit(args.begin()), arge(args.end());
+ ArgsIterator argit(args.begin()), arge(args.end());
ArgsVisitor visitor(&argit, arge, env_prefix);
for ( ; argit != arge; ++argit )
@@ -190,7 +233,7 @@ ArgsHandler::run(
}
}
- _imp->parameters.insert(_imp->parameters.end(), argit, ArgsVisitor::ArgsIterator(args.end()));
+ _imp->parameters.insert(_imp->parameters.end(), argit, ArgsIterator(args.end()));
if (! env_prefix.empty())
setenv((env_prefix + "_PARAMS").c_str(), join(_imp->parameters.begin(),
@@ -365,3 +408,14 @@ ArgsHandler::add_description_line(const std::string & e)
_imp->descriptions.push_back(e);
}
+template class WrappedForwardIterator<ArgsHandler::ParametersConstIteratorTag, const std::string>;
+template class WrappedForwardIterator<ArgsHandler::UsageLineConstIteratorTag, const std::string>;
+template class WrappedForwardIterator<ArgsHandler::EnvironmentLineConstIteratorTag,
+ const std::pair<std::string, std::string> >;
+template class WrappedForwardIterator<ArgsHandler::ExamplesConstIteratorTag,
+ const std::pair<std::string, std::string> >;
+template class WrappedForwardIterator<ArgsHandler::ArgsSectionsConstIteratorTag, const ArgsSection>;
+template class WrappedForwardIterator<ArgsHandler::NotesIteratorTag, const std::string>;
+template class WrappedForwardIterator<ArgsHandler::DescriptionLineConstIteratorTag, const std::string>;
+template class WrappedForwardIterator<args::ArgsHandler::ArgsIteratorTag, std::string>;
+
diff --git a/paludis/args/args_handler.hh b/paludis/args/args_handler.hh
index 8af12c7..b247206 100644
--- a/paludis/args/args_handler.hh
+++ b/paludis/args/args_handler.hh
@@ -44,6 +44,7 @@ namespace paludis
{
namespace args
{
+ class ArgsOption;
#include <paludis/args/args_handler-se.hh>
@@ -182,7 +183,7 @@ namespace paludis
///\{
struct EnvironmentLineConstIteratorTag;
- typedef WrappedForwardIterator<EnvironmentLineConstIteratorTag,
+ typedef WrappedForwardIterator<EnvironmentLineConstIteratorTag,
const std::pair<std::string, std::string> > EnvironmentLineConstIterator;
EnvironmentLineConstIterator begin_environment_lines() const;
@@ -245,6 +246,13 @@ namespace paludis
///\}
+ ///\name For use by ArgsVisitor
+ ///\{
+
+ struct ArgsIteratorTag;
+ typedef WrappedForwardIterator<ArgsIteratorTag, std::string> ArgsIterator;
+
+ ///\}
/**
* Parse command line arguments. The third argument is used to
@@ -283,6 +291,20 @@ namespace paludis
*/
std::ostream & operator<< (std::ostream &, const ArgsHandler &) PALUDIS_VISIBLE;
}
+
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+ extern template class WrappedForwardIterator<args::ArgsHandler::ParametersConstIteratorTag, const std::string>;
+ extern template class WrappedForwardIterator<args::ArgsHandler::UsageLineConstIteratorTag, const std::string>;
+ extern template class WrappedForwardIterator<args::ArgsHandler::EnvironmentLineConstIteratorTag,
+ const std::pair<std::string, std::string> >;
+ extern template class WrappedForwardIterator<args::ArgsHandler::ExamplesConstIteratorTag,
+ const std::pair<std::string, std::string> >;
+ extern template class WrappedForwardIterator<args::ArgsHandler::ArgsSectionsConstIteratorTag, const args::ArgsSection>;
+ extern template class WrappedForwardIterator<args::ArgsHandler::DescriptionLineConstIteratorTag, const std::string>;
+ extern template class WrappedForwardIterator<args::ArgsHandler::NotesIteratorTag, const std::string>;
+ extern template class WrappedForwardIterator<args::ArgsHandler::ArgsIteratorTag, std::string>;
+
+#endif
}
#endif
diff --git a/paludis/args/args_option.cc b/paludis/args/args_option.cc
index ce67ef6..af1f142 100644
--- a/paludis/args/args_option.cc
+++ b/paludis/args/args_option.cc
@@ -17,9 +17,12 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "args.hh"
-#include "args_error.hh"
-#include "escape.hh"
+#include <paludis/args/args_option.hh>
+#include <paludis/args/args_error.hh>
+#include <paludis/args/args_group.hh>
+#include <paludis/args/args_section.hh>
+#include <paludis/args/args_handler.hh>
+#include <paludis/args/escape.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
@@ -32,13 +35,6 @@
using namespace paludis;
using namespace paludis::args;
-template class WrappedForwardIterator<StringSetArg::ConstIteratorTag, const std::string>;
-template class WrappedForwardIterator<StringSetArg::AllowedArgConstIteratorTag,
- const std::pair<std::string, std::string> >;
-template class WrappedForwardIterator<EnumArg::AllowedArgConstIteratorTag,
- const AllowedEnumArg>;
-template class WrappedForwardIterator<StringSequenceArg::ConstIteratorTag, const std::string>;
-
namespace
{
struct ArgIs
@@ -156,6 +152,18 @@ namespace paludis
{
std::vector<std::pair<std::string, std::string> > options;
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<StringSetArg::ConstIteratorTag>
+ {
+ typedef std::set<std::string>::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<StringSetArg::AllowedArgConstIteratorTag>
+ {
+ typedef std::vector<std::pair<std::string, std::string> >::const_iterator UnderlyingIterator;
+ };
}
StringSetArg::StringSetArg(ArgsGroup * const g, const std::string & our_long_name,
@@ -225,6 +233,12 @@ namespace paludis
{
std::list<std::string> args;
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<StringSequenceArg::ConstIteratorTag>
+ {
+ typedef std::list<std::string>::const_iterator UnderlyingIterator;
+ };
}
StringSequenceArg::StringSequenceArg(ArgsGroup * const g, const std::string & our_long_name,
@@ -295,6 +309,12 @@ namespace paludis
{
std::vector<AllowedEnumArg> options;
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<EnumArg::AllowedArgConstIteratorTag>
+ {
+ typedef std::vector<AllowedEnumArg>::const_iterator UnderlyingIterator;
+ };
}
StringSetArg::StringSetArgOptions::StringSetArgOptions(const std::string & opt, const std::string & desc) :
@@ -497,3 +517,11 @@ SwitchArg::can_be_negated() const
return _can_be_negated;
}
+template class WrappedForwardIterator<StringSetArg::ConstIteratorTag, const std::string>;
+template class WrappedForwardIterator<StringSetArg::AllowedArgConstIteratorTag,
+ const std::pair<std::string, std::string> >;
+template class WrappedForwardIterator<EnumArg::AllowedArgConstIteratorTag,
+ const AllowedEnumArg>;
+template class WrappedForwardIterator<StringSequenceArg::ConstIteratorTag, const std::string>;
+
+
diff --git a/paludis/args/args_option.hh b/paludis/args/args_option.hh
index 1dfdb88..e56c540 100644
--- a/paludis/args/args_option.hh
+++ b/paludis/args/args_option.hh
@@ -21,11 +21,11 @@
#ifndef PALUDIS_GUARD_ARGS_ARGS_OPTION_HH
#define PALUDIS_GUARD_ARGS_ARGS_OPTION_HH 1
-#include <paludis/args/args_visitor.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/type_list.hh>
#include <paludis/util/named_value.hh>
+#include <paludis/util/simple_visitor.hh>
/** \file
* Declarations for ArgsOption.
@@ -49,6 +49,13 @@ namespace paludis
namespace args
{
class ArgsGroup;
+ class StringArg;
+ class AliasArg;
+ class SwitchArg;
+ class IntegerArg;
+ class EnumArg;
+ class StringSetArg;
+ class StringSequenceArg;
/**
* Base class for a command line option.
@@ -319,7 +326,7 @@ namespace paludis
///\{
struct AllowedArgConstIteratorTag;
- typedef WrappedForwardIterator<AllowedArgConstIteratorTag,
+ typedef WrappedForwardIterator<AllowedArgConstIteratorTag,
const std::pair<std::string, std::string> > AllowedArgConstIterator;
AllowedArgConstIterator begin_allowed_args() const;
@@ -593,6 +600,15 @@ namespace paludis
virtual const std::string forwardable_string() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
+
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+ extern template class WrappedForwardIterator<args::StringSetArg::ConstIteratorTag, const std::string>;
+ extern template class WrappedForwardIterator<args::StringSetArg::AllowedArgConstIteratorTag,
+ const std::pair<std::string, std::string> >;
+ extern template class WrappedForwardIterator<args::StringSequenceArg::ConstIteratorTag, const std::string>;
+ extern template class WrappedForwardIterator<args::EnumArg::AllowedArgConstIteratorTag,
+ const args::AllowedEnumArg>;
+#endif
}
#endif
diff --git a/paludis/args/args_section.cc b/paludis/args/args_section.cc
index 4aba9ee..51d28ba 100644
--- a/paludis/args/args_section.cc
+++ b/paludis/args/args_section.cc
@@ -42,6 +42,12 @@ namespace paludis
{
}
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<ArgsSection::GroupsConstIteratorTag>
+ {
+ typedef IndirectIterator<std::list<ArgsGroup *>::const_iterator> UnderlyingIterator;
+ };
}
ArgsSection::ArgsSection(ArgsHandler * const h, const std::string & s) :
@@ -85,4 +91,5 @@ ArgsSection::name() const
}
template class PrivateImplementationPattern<ArgsSection>;
+template class WrappedForwardIterator<args::ArgsSection::GroupsConstIteratorTag, const args::ArgsGroup>;
diff --git a/paludis/args/args_section.hh b/paludis/args/args_section.hh
index 12215e9..24ad067 100644
--- a/paludis/args/args_section.hh
+++ b/paludis/args/args_section.hh
@@ -22,7 +22,7 @@
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <string>
namespace paludis
@@ -59,6 +59,7 @@ namespace paludis
#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
extern template class PrivateImplementationPattern<args::ArgsSection>;
+ extern template class WrappedForwardIterator<args::ArgsSection::GroupsConstIteratorTag, const args::ArgsGroup>;
#endif
}
diff --git a/paludis/args/args_visitor.cc b/paludis/args/args_visitor.cc
index 607750f..9c4fbb7 100644
--- a/paludis/args/args_visitor.cc
+++ b/paludis/args/args_visitor.cc
@@ -1,6 +1,6 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -16,8 +16,10 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include "args_visitor.hh"
#include "args_option.hh"
#include "args_error.hh"
+#include "args_handler.hh"
#include "bad_argument.hh"
#include <paludis/util/destringify.hh>
@@ -32,9 +34,7 @@
using namespace paludis;
using namespace paludis::args;
-template class WrappedForwardIterator<ArgsVisitor::ArgsIteratorTag, std::string>;
-
-ArgsVisitor::ArgsVisitor(ArgsIterator * ai, ArgsIterator ae,
+ArgsVisitor::ArgsVisitor(ArgsHandler::ArgsIterator * ai, ArgsHandler::ArgsIterator ae,
const std::string & env_prefix) :
_args_index(ai),
_args_end(ae),
diff --git a/paludis/args/args_visitor.hh b/paludis/args/args_visitor.hh
index 75ae661..18bbcc5 100644
--- a/paludis/args/args_visitor.hh
+++ b/paludis/args/args_visitor.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
* Copyright (c) 2006 Stephen Bennett
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -24,6 +24,7 @@
#include <paludis/util/simple_visitor.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/attributes.hh>
+#include <paludis/args/args_handler.hh>
#include <string>
/** \file
@@ -56,12 +57,8 @@ namespace paludis
*/
class PALUDIS_VISIBLE ArgsVisitor
{
- public:
- struct ArgsIteratorTag;
- typedef WrappedForwardIterator<ArgsIteratorTag, std::string> ArgsIterator;
-
private:
- ArgsIterator * _args_index, _args_end;
+ ArgsHandler::ArgsIterator * _args_index, _args_end;
std::string _env_prefix;
const std::string & get_param(const ArgsOption &);
@@ -74,7 +71,7 @@ namespace paludis
/**
* Constructor
*/
- ArgsVisitor(ArgsIterator *, ArgsIterator,
+ ArgsVisitor(ArgsHandler::ArgsIterator *, ArgsHandler::ArgsIterator,
const std::string & env_prefix = "");
/// Visit a StringArg.
diff --git a/paludis/args/dep_list_args_group.hh b/paludis/args/dep_list_args_group.hh
index fbf4daf..b1644e2 100644
--- a/paludis/args/dep_list_args_group.hh
+++ b/paludis/args/dep_list_args_group.hh
@@ -21,8 +21,9 @@
#ifndef PALUDIS_GUARD_SRC_COMMON_ARGS_DEP_LIST_ARGS_HH
#define PALUDIS_GUARD_SRC_COMMON_ARGS_DEP_LIST_ARGS_HH 1
-#include <paludis/args/args.hh>
+#include <paludis/args/args_option.hh>
#include <paludis/args/deps_option_arg.hh>
+#include <paludis/args/args_group.hh>
#include <paludis/dep_list.hh>
#include <paludis/install_task.hh>
diff --git a/paludis/args/install_args_group.cc b/paludis/args/install_args_group.cc
index c14653e..afb8533 100644
--- a/paludis/args/install_args_group.cc
+++ b/paludis/args/install_args_group.cc
@@ -23,6 +23,7 @@
#include <paludis/environment-fwd.hh>
#include <paludis/args/do_help.hh>
#include <paludis/util/iterator_funcs.hh>
+#include <paludis/util/set-impl.hh>
using namespace paludis;
using namespace paludis::args;
diff --git a/paludis/args/install_args_group.hh b/paludis/args/install_args_group.hh
index 280114c..4f392f8 100644
--- a/paludis/args/install_args_group.hh
+++ b/paludis/args/install_args_group.hh
@@ -23,7 +23,8 @@
#include <paludis/util/set.hh>
-#include <paludis/args/args.hh>
+#include <paludis/args/args_option.hh>
+#include <paludis/args/args_group.hh>
#include <paludis/dep_list-fwd.hh>
#include <paludis/install_task.hh>
diff --git a/paludis/args/man.hh b/paludis/args/man.hh
index a454814..236a332 100644
--- a/paludis/args/man.hh
+++ b/paludis/args/man.hh
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_ARGS_MAN_HH
#define PALUDIS_GUARD_PALUDIS_ARGS_MAN_HH 1
-#include <paludis/args/args.hh>
+#include <paludis/args/args_handler.hh>
#include <iosfwd>
namespace paludis
diff --git a/paludis/choice.cc b/paludis/choice.cc
index 84f57ef..25a92b5 100644
--- a/paludis/choice.cc
+++ b/paludis/choice.cc
@@ -29,6 +29,24 @@
using namespace paludis;
+typedef std::list<std::tr1::shared_ptr<const Choice> > ChoicesList;
+typedef std::list<std::tr1::shared_ptr<const ChoiceValue> > ChoiceList;
+
+namespace paludis
+{
+ template <>
+ struct WrappedForwardIteratorTraits<Choices::ConstIteratorTag>
+ {
+ typedef ChoicesList::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<Choice::ConstIteratorTag>
+ {
+ typedef ChoiceList::const_iterator UnderlyingIterator;
+ };
+}
+
ChoicePrefixNameError::ChoicePrefixNameError(const std::string & n) throw () :
NameError(n, "choice prefix name")
{
@@ -133,7 +151,7 @@ namespace paludis
template <>
struct Implementation<Choices>
{
- std::list<std::tr1::shared_ptr<const Choice> > choices;
+ ChoicesList choices;
};
}
@@ -203,7 +221,7 @@ namespace paludis
template <>
struct Implementation<Choice>
{
- std::list<std::tr1::shared_ptr<const ChoiceValue> > values;
+ ChoiceList values;
const ChoiceParams params;
Implementation(const ChoiceParams & p) :
diff --git a/paludis/choice.hh b/paludis/choice.hh
index 4faf3eb..878776d 100644
--- a/paludis/choice.hh
+++ b/paludis/choice.hh
@@ -22,7 +22,7 @@
#include <paludis/choice-fwd.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/named_value.hh>
@@ -388,6 +388,9 @@ namespace paludis
#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
extern template class PrivateImplementationPattern<Choices>;
extern template class PrivateImplementationPattern<Choice>;
+
+ extern template class WrappedForwardIterator<Choices::ConstIteratorTag, const std::tr1::shared_ptr<const Choice> >;
+ extern template class WrappedForwardIterator<Choice::ConstIteratorTag, const std::tr1::shared_ptr<const ChoiceValue> >;
#endif
}
diff --git a/paludis/contents.cc b/paludis/contents.cc
index 2301adf..9fc3bd4 100644
--- a/paludis/contents.cc
+++ b/paludis/contents.cc
@@ -25,6 +25,8 @@
using namespace paludis;
+typedef std::list<std::tr1::shared_ptr<const ContentsEntry> > Entries;
+
namespace paludis
{
template <>
@@ -113,7 +115,13 @@ namespace paludis
template<>
struct Implementation<Contents>
{
- std::list<std::tr1::shared_ptr<const ContentsEntry> > c;
+ Entries c;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<Contents::ConstIteratorTag>
+ {
+ typedef Entries::const_iterator UnderlyingIterator;
};
}
diff --git a/paludis/contents.hh b/paludis/contents.hh
index a3a6946..672098e 100644
--- a/paludis/contents.hh
+++ b/paludis/contents.hh
@@ -25,7 +25,7 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/type_list.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/metadata_key_holder.hh>
#include <tr1/memory>
@@ -235,6 +235,8 @@ namespace paludis
extern template class PrivateImplementationPattern<Contents>;
extern template class PrivateImplementationPattern<ContentsEntry>;
extern template class PrivateImplementationPattern<ContentsSymEntry>;
+
+ extern template class WrappedForwardIterator<Contents::ConstIteratorTag, const std::tr1::shared_ptr<const ContentsEntry> >;
#endif
}
diff --git a/paludis/dep_label.cc b/paludis/dep_label.cc
index 7aace3c..3dec920 100644
--- a/paludis/dep_label.cc
+++ b/paludis/dep_label.cc
@@ -19,16 +19,18 @@
#include <paludis/dep_label.hh>
#include <paludis/dep_spec.hh>
+#include <paludis/util/stringify.hh>
+
#include <paludis/util/sequence-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/stringify.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_output_iterator-impl.hh>
+
#include <ostream>
#include <algorithm>
using namespace paludis;
-template class Sequence<std::tr1::shared_ptr<const DependenciesLabel> >;
-
std::ostream &
paludis::operator<< (std::ostream & s, const URILabel & l)
{
@@ -116,3 +118,10 @@ template class ConcreteDependenciesLabel<DependenciesSuggestionLabelTag>;
template class ConcreteDependenciesLabel<DependenciesRecommendationLabelTag>;
template class ConcreteDependenciesLabel<DependenciesTestLabelTag>;
+template class Sequence<std::tr1::shared_ptr<const DependenciesLabel> >;
+template class WrappedForwardIterator<Sequence<std::tr1::shared_ptr<const DependenciesLabel> >::ConstIteratorTag,
+ const std::tr1::shared_ptr<const DependenciesLabel> >;
+template class WrappedOutputIterator<Sequence<std::tr1::shared_ptr<const DependenciesLabel> >::InserterTag,
+ std::tr1::shared_ptr<const DependenciesLabel> >;
+
+
diff --git a/paludis/dep_label.hh b/paludis/dep_label.hh
index a3886a6..432ce53 100644
--- a/paludis/dep_label.hh
+++ b/paludis/dep_label.hh
@@ -27,6 +27,8 @@
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/type_list.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <tr1/functional>
/** \file
@@ -177,6 +179,9 @@ namespace paludis
extern template class ConcreteDependenciesLabel<DependenciesSuggestionLabelTag>;
extern template class ConcreteDependenciesLabel<DependenciesRecommendationLabelTag>;
extern template class ConcreteDependenciesLabel<DependenciesTestLabelTag>;
+
+ extern template class WrappedForwardIterator<Sequence<std::tr1::shared_ptr<const DependenciesLabel> >::ConstIteratorTag,
+ const std::tr1::shared_ptr<const DependenciesLabel> >;
#endif
}
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index 8bbd9d4..f29a7b7 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -49,16 +49,18 @@
#include <paludis/util/save.hh>
#include <paludis/util/member_iterator.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/sequence-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/simple_visitor_cast.hh>
-#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
+#include <paludis/util/sequence-impl.hh>
+#include <paludis/util/set-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
+
#include <algorithm>
#include <functional>
#include <vector>
@@ -71,14 +73,6 @@ using namespace paludis;
typedef std::list<std::tr1::shared_ptr<DependenciesLabelSequence> > LabelsStack;
-template class Sequence<std::tr1::function<bool (const PackageID &, const Mask &)> >;
-template class WrappedForwardIterator<DepListOverrideMasksFunctions::ConstIterator,
- const std::tr1::function<bool (const PackageID &, const Mask &)> >;
-template class WrappedForwardIterator<DepList::IteratorTag, DepListEntry>;
-template class WrappedForwardIterator<DepList::ConstIteratorTag, const DepListEntry>;
-
-template class PrivateImplementationPattern<DepList>;
-
DepListOptions::DepListOptions() :
blocks(dl_blocks_accumulate),
circular(dl_circular_error),
@@ -148,6 +142,20 @@ namespace paludis
labels.push_front(make_shared_ptr(new DependenciesLabelSequence));
}
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<DepList::IteratorTag>
+ {
+ typedef MergeList::iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<DepList::ConstIteratorTag>
+ {
+ typedef MergeList::const_iterator UnderlyingIterator;
+
+ typedef DepList::Iterator EquivalentNonConstIterator;
+ };
}
namespace
@@ -1739,3 +1747,11 @@ paludis::is_viable_any_child(const DependencySpecTree::BasicNode & i)
return true;
}
+template class Sequence<std::tr1::function<bool (const PackageID &, const Mask &)> >;
+template class WrappedForwardIterator<DepList::IteratorTag, DepListEntry>;
+template class WrappedForwardIterator<DepList::ConstIteratorTag, const DepListEntry>;
+
+template WrappedForwardIterator<DepList::ConstIteratorTag, const DepListEntry>::WrappedForwardIterator(const DepList::Iterator &);
+
+template class PrivateImplementationPattern<DepList>;
+
diff --git a/paludis/dep_list.hh b/paludis/dep_list.hh
index 0f32759..50f2183 100644
--- a/paludis/dep_list.hh
+++ b/paludis/dep_list.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -309,6 +309,9 @@ namespace paludis
#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
extern template class PrivateImplementationPattern<DepList>;
+ extern template class WrappedForwardIterator<DepList::IteratorTag, DepListEntry>;
+ extern template class WrappedForwardIterator<DepList::ConstIteratorTag, const DepListEntry>;
+ extern template WrappedForwardIterator<DepList::ConstIteratorTag, const DepListEntry>::WrappedForwardIterator(const DepList::Iterator &);
#endif
}
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 3190eb5..189969e 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -556,6 +556,18 @@ namespace paludis
{
std::list<std::tr1::shared_ptr<const T_> > items;
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<DependenciesLabelsDepSpec::ConstIteratorTag>
+ {
+ typedef std::list<std::tr1::shared_ptr<const DependenciesLabel> >::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<URILabelsDepSpec::ConstIteratorTag>
+ {
+ typedef std::list<std::tr1::shared_ptr<const URILabel> >::const_iterator UnderlyingIterator;
+ };
}
template <typename T_>
@@ -1296,3 +1308,8 @@ template class CloneUsingThis<DepSpec, PackageDepSpec>;
template class PrivateImplementationPattern<URILabelsDepSpec>;
template class PrivateImplementationPattern<DependenciesLabelsDepSpec>;
+template class WrappedForwardIterator<DependenciesLabelsDepSpec::ConstIteratorTag,
+ const std::tr1::shared_ptr<const DependenciesLabel> >;
+template class WrappedForwardIterator<URILabelsDepSpec::ConstIteratorTag,
+ const std::tr1::shared_ptr<const URILabel> >;
+
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index f3fca15..071b706 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -24,7 +24,7 @@
#include <paludis/util/clone.hh>
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/named_value.hh>
@@ -994,6 +994,12 @@ namespace paludis
extern template class PrivateImplementationPattern<DependenciesLabelsDepSpec>;
extern template class PrivateImplementationPattern<URILabelsDepSpec>;
extern template class PrivateImplementationPattern<PlainTextLabelDepSpec>;
+
+ extern template class WrappedForwardIterator<DependenciesLabelsDepSpec::ConstIteratorTag,
+ const std::tr1::shared_ptr<const DependenciesLabel> >;
+ extern template class WrappedForwardIterator<URILabelsDepSpec::ConstIteratorTag,
+ const std::tr1::shared_ptr<const URILabel> >;
+
#endif
}
diff --git a/paludis/dep_spec_flattener.cc b/paludis/dep_spec_flattener.cc
index d5a5c21..c212896 100644
--- a/paludis/dep_spec_flattener.cc
+++ b/paludis/dep_spec_flattener.cc
@@ -25,6 +25,7 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/repository.hh>
#include <list>
#include <algorithm>
@@ -50,6 +51,30 @@ namespace paludis
{
}
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<DepSpecFlattener<ProvideSpecTree, PackageDepSpec>::ConstIteratorTag>
+ {
+ typedef std::list<std::tr1::shared_ptr<const PackageDepSpec> >::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec>::ConstIteratorTag>
+ {
+ typedef std::list<std::tr1::shared_ptr<const PlainTextDepSpec> >::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<DepSpecFlattener<SetSpecTree, PackageDepSpec>::ConstIteratorTag>
+ {
+ typedef std::list<std::tr1::shared_ptr<const PackageDepSpec> >::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<DepSpecFlattener<SimpleURISpecTree, SimpleURIDepSpec>::ConstIteratorTag>
+ {
+ typedef std::list<std::tr1::shared_ptr<const SimpleURIDepSpec> >::const_iterator UnderlyingIterator;
+ };
}
template <typename Heirarchy_, typename Item_>
@@ -251,3 +276,12 @@ template class DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec>;
template class DepSpecFlattener<SetSpecTree, PackageDepSpec>;
template class DepSpecFlattener<SimpleURISpecTree, SimpleURIDepSpec>;
+template class WrappedForwardIterator<DepSpecFlattener<ProvideSpecTree, PackageDepSpec>::ConstIteratorTag,
+ const std::tr1::shared_ptr<const PackageDepSpec> >;
+template class WrappedForwardIterator<DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec>::ConstIteratorTag,
+ const std::tr1::shared_ptr<const PlainTextDepSpec> >;
+template class WrappedForwardIterator<DepSpecFlattener<SetSpecTree, PackageDepSpec>::ConstIteratorTag,
+ const std::tr1::shared_ptr<const PackageDepSpec> >;
+template class WrappedForwardIterator<DepSpecFlattener<SimpleURISpecTree, SimpleURIDepSpec>::ConstIteratorTag,
+ const std::tr1::shared_ptr<const SimpleURIDepSpec> >;
+
diff --git a/paludis/dep_spec_flattener.hh b/paludis/dep_spec_flattener.hh
index 0996f07..1bc0890 100644
--- a/paludis/dep_spec_flattener.hh
+++ b/paludis/dep_spec_flattener.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -28,7 +28,7 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/no_type.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <tr1/memory>
/** \file
@@ -118,6 +118,15 @@ namespace paludis
extern template class DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec>;
extern template class DepSpecFlattener<SetSpecTree, PackageDepSpec>;
extern template class DepSpecFlattener<SimpleURISpecTree, SimpleURIDepSpec>;
+
+ extern template class WrappedForwardIterator<DepSpecFlattener<ProvideSpecTree, PackageDepSpec>::ConstIteratorTag,
+ const std::tr1::shared_ptr<const PackageDepSpec> >;
+ extern template class WrappedForwardIterator<DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec>::ConstIteratorTag,
+ const std::tr1::shared_ptr<const PlainTextDepSpec> >;
+ extern template class WrappedForwardIterator<DepSpecFlattener<SetSpecTree, PackageDepSpec>::ConstIteratorTag,
+ const std::tr1::shared_ptr<const PackageDepSpec> >;
+ extern template class WrappedForwardIterator<DepSpecFlattener<SimpleURISpecTree, SimpleURIDepSpec>::ConstIteratorTag,
+ const std::tr1::shared_ptr<const SimpleURIDepSpec> >;
#endif
}
diff --git a/paludis/environment.cc b/paludis/environment.cc
index 9046b47..534c799 100644
--- a/paludis/environment.cc
+++ b/paludis/environment.cc
@@ -23,13 +23,14 @@
#include <paludis/util/sequence-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/wrapped_output_iterator-impl.hh>
+#include <paludis/util/set-impl.hh>
using namespace paludis;
-template class WrappedForwardIterator<Sequence<std::string>::ConstIteratorTag, const std::string>;
-template class WrappedOutputIterator<Sequence<std::string>::InserterTag, std::string>;
-
Environment::~Environment()
{
}
+template class Set<UnprefixedChoiceName>;
+template class WrappedForwardIterator<Set<UnprefixedChoiceName>::ConstIteratorTag, const UnprefixedChoiceName>;
+template class WrappedOutputIterator<Set<UnprefixedChoiceName>::InserterTag, UnprefixedChoiceName>;
diff --git a/paludis/environment_implementation.cc b/paludis/environment_implementation.cc
index a49fb84..2393736 100644
--- a/paludis/environment_implementation.cc
+++ b/paludis/environment_implementation.cc
@@ -30,6 +30,9 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/member_iterator-impl.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
+#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/hook.hh>
#include <paludis/distribution.hh>
#include <paludis/selection.hh>
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index 2777832..a54273d 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -35,6 +35,7 @@
#include <paludis/util/graph-impl.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/member_iterator-impl.hh>
+#include <paludis/util/sequence-impl.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/distribution.hh>
#include <paludis/package_database.hh>
diff --git a/paludis/environments/paludis/paludis_config.cc b/paludis/environments/paludis/paludis_config.cc
index cdae60e..c325dee 100644
--- a/paludis/environments/paludis/paludis_config.cc
+++ b/paludis/environments/paludis/paludis_config.cc
@@ -77,7 +77,7 @@
using namespace paludis;
using namespace paludis::paludis_environment;
-template class WrappedForwardIterator<PaludisConfig::RepositoryConstIteratorTag, const std::tr1::function<std::string (const std::string &)> >;
+typedef std::list<std::tr1::function<std::string (const std::string &)> > Repos;
namespace
{
@@ -174,7 +174,7 @@ namespace paludis
mutable std::string distribution;
std::tr1::shared_ptr<FSEntrySequence> bashrc_files;
- std::list<std::tr1::function<std::string (const std::string &)> > repos;
+ Repos repos;
std::tr1::shared_ptr<KeywordsConf> keywords_conf;
std::tr1::shared_ptr<UseConf> use_conf;
@@ -327,6 +327,12 @@ namespace paludis
has_environment_conf = true;
}
+
+ template <>
+ struct WrappedForwardIteratorTraits<PaludisConfig::RepositoryConstIteratorTag>
+ {
+ typedef Repos::const_iterator UnderlyingIterator;
+ };
}
PaludisConfigError::PaludisConfigError(const std::string & msg) throw () :
@@ -1062,3 +1068,5 @@ PaludisConfig::distribution() const
return _imp->distribution;
}
+template class WrappedForwardIterator<PaludisConfig::RepositoryConstIteratorTag, const std::tr1::function<std::string (const std::string &)> >;
+
diff --git a/paludis/find_unused_packages_task.cc b/paludis/find_unused_packages_task.cc
index be0178a..c316d8d 100644
--- a/paludis/find_unused_packages_task.cc
+++ b/paludis/find_unused_packages_task.cc
@@ -27,7 +27,7 @@
#include <paludis/filter.hh>
#include <paludis/generator.hh>
#include <paludis/filtered_generator.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/set.hh>
diff --git a/paludis/fuzzy_finder.cc b/paludis/fuzzy_finder.cc
index f7d7306..a282d6e 100644
--- a/paludis/fuzzy_finder.cc
+++ b/paludis/fuzzy_finder.cc
@@ -34,8 +34,8 @@
#include <paludis/filter_handler.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/selection.hh>
-#include <paludis/util/set.hh>
-#include <paludis/util/sequence.hh>
+#include <paludis/util/set-impl.hh>
+#include <paludis/util/sequence-impl.hh>
#include <list>
#include <algorithm>
#include <set>
@@ -44,9 +44,6 @@
using namespace paludis;
-template class WrappedForwardIterator<FuzzyCandidatesFinder::CandidatesConstIteratorTag, const QualifiedPackageName>;
-template class WrappedForwardIterator<FuzzyRepositoriesFinder::RepositoriesConstIteratorTag, const RepositoryName>;
-
namespace
{
bool char_0_cost(char c)
@@ -126,6 +123,12 @@ namespace paludis
{
std::list<QualifiedPackageName> candidates;
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<FuzzyCandidatesFinder::CandidatesConstIteratorTag>
+ {
+ typedef std::list<QualifiedPackageName>::const_iterator UnderlyingIterator;
+ };
}
FuzzyCandidatesFinder::FuzzyCandidatesFinder(const Environment & e, const std::string & name, const Filter & filter) :
@@ -181,6 +184,12 @@ namespace paludis
{
std::list<RepositoryName> candidates;
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<FuzzyRepositoriesFinder::RepositoriesConstIteratorTag>
+ {
+ typedef std::list<RepositoryName>::const_iterator UnderlyingIterator;
+ };
}
FuzzyRepositoriesFinder::FuzzyRepositoriesFinder(const Environment & e, const std::string & name) :
@@ -222,3 +231,6 @@ FuzzyRepositoriesFinder::end() const
return RepositoriesConstIterator(_imp->candidates.end());
}
+template class WrappedForwardIterator<FuzzyCandidatesFinder::CandidatesConstIteratorTag, const QualifiedPackageName>;
+template class WrappedForwardIterator<FuzzyRepositoriesFinder::RepositoriesConstIteratorTag, const RepositoryName>;
+
diff --git a/paludis/fuzzy_finder.hh b/paludis/fuzzy_finder.hh
index ca008b8..80cc650 100644
--- a/paludis/fuzzy_finder.hh
+++ b/paludis/fuzzy_finder.hh
@@ -22,7 +22,7 @@
#include <paludis/environment-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/name.hh>
#include <paludis/filter-fwd.hh>
#include <string>
@@ -94,6 +94,12 @@ namespace paludis
///\}
};
+
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+ extern template class WrappedForwardIterator<FuzzyCandidatesFinder::CandidatesConstIteratorTag, const QualifiedPackageName>;
+ extern template class WrappedForwardIterator<FuzzyRepositoriesFinder::RepositoriesConstIteratorTag, const RepositoryName>;
+#endif
+
}
#endif
diff --git a/paludis/hook.cc b/paludis/hook.cc
index bf78b6f..60d6724 100644
--- a/paludis/hook.cc
+++ b/paludis/hook.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
* Copyright (c) 2007 Piotr Jaroszyński
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -29,13 +29,11 @@
using namespace paludis;
-template class WrappedForwardIterator<Hook::ConstIteratorTag, const std::pair<const std::string, std::string> >;
-
#include <paludis/hook-se.cc>
namespace paludis
{
- template<>
+ template <>
struct Implementation<Hook>
{
std::string name;
@@ -51,11 +49,17 @@ namespace paludis
}
};
- template<>
+ template <>
struct Implementation<Hook::AllowedOutputValues>
{
std::set<std::string> allowed_values;
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<Hook::ConstIteratorTag>
+ {
+ typedef std::map<std::string, std::string>::const_iterator UnderlyingIterator;
+ };
}
Hook::AllowedOutputValues::AllowedOutputValues() :
@@ -153,3 +157,5 @@ Hook::name() const
return _imp->name;
}
+template class WrappedForwardIterator<Hook::ConstIteratorTag, const std::pair<const std::string, std::string> >;
+
diff --git a/paludis/hook.hh b/paludis/hook.hh
index e0ef755..3a2aac6 100644
--- a/paludis/hook.hh
+++ b/paludis/hook.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
* Copyright (c) 2007 Piotr Jaroszyński
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -26,7 +26,7 @@
#include <paludis/util/attributes.hh>
#include <paludis/util/graph-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/sequence-fwd.hh>
#include <paludis/util/named_value.hh>
#include <tr1/memory>
@@ -149,6 +149,10 @@ namespace paludis
AllowedOutputValues operator() (const std::string & v) const
PALUDIS_ATTRIBUTE((warn_unused_result));
};
+
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+ extern template class WrappedForwardIterator<Hook::ConstIteratorTag, const std::pair<const std::string, std::string> >;
+#endif
}
extern "C" paludis::HookResult PALUDIS_VISIBLE paludis_hook_run(
diff --git a/paludis/install_task.cc b/paludis/install_task.cc
index 0235d54..1d9749c 100644
--- a/paludis/install_task.cc
+++ b/paludis/install_task.cc
@@ -37,7 +37,7 @@
#include <paludis/filtered_generator.hh>
#include <paludis/package_dep_spec_properties.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/set.hh>
+#include <paludis/util/set-impl.hh>
#include <paludis/util/log.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
@@ -46,7 +46,7 @@
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/sequence.hh>
+#include <paludis/util/sequence-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/handled_information.hh>
@@ -64,8 +64,6 @@
using namespace paludis;
-template class WrappedForwardIterator<InstallTask::TargetsConstIteratorTag, const std::string>;
-
#include <paludis/install_task-se.cc>
namespace
@@ -176,6 +174,12 @@ namespace paludis
{
}
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<InstallTask::TargetsConstIteratorTag>
+ {
+ typedef std::list<std::string>::const_iterator UnderlyingIterator;
+ };
}
InstallTask::InstallTask(Environment * const env, const DepListOptions & options,
@@ -1930,3 +1934,5 @@ InstallTask::make_fetch_action_options(const DepListEntry &, OutputManagerFromEn
);
}
+template class WrappedForwardIterator<InstallTask::TargetsConstIteratorTag, const std::string>;
+
diff --git a/paludis/install_task.hh b/paludis/install_task.hh
index 088aeeb..f0d0287 100644
--- a/paludis/install_task.hh
+++ b/paludis/install_task.hh
@@ -22,7 +22,7 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/dep_list.hh>
#include <paludis/dep_list_exceptions.hh>
#include <paludis/tasks_exceptions.hh>
@@ -278,6 +278,10 @@ namespace paludis
*/
std::string serialised_format() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
+
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+ extern template class WrappedForwardIterator<InstallTask::TargetsConstIteratorTag, const std::string>;
+#endif
}
#endif
diff --git a/paludis/match_package.cc b/paludis/match_package.cc
index d6b7537..b15983b 100644
--- a/paludis/match_package.cc
+++ b/paludis/match_package.cc
@@ -34,6 +34,9 @@
#include <paludis/action.hh>
#include <paludis/repository.hh>
#include <paludis/metadata_key.hh>
+
+#include <paludis/util/indirect_iterator-impl.hh>
+
#include <tr1/functional>
#include <algorithm>
#include <istream>
diff --git a/paludis/metadata_key_holder.cc b/paludis/metadata_key_holder.cc
index fd72c40..f58f19a 100644
--- a/paludis/metadata_key_holder.cc
+++ b/paludis/metadata_key_holder.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -37,6 +37,12 @@ namespace paludis
{
mutable std::list<std::tr1::shared_ptr<const MetadataKey> > keys;
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<MetadataKeyHolder::MetadataConstIteratorTag>
+ {
+ typedef std::list<std::tr1::shared_ptr<const MetadataKey> >::const_iterator UnderlyingIterator;
+ };
}
MetadataKeyHolder::MetadataKeyHolder() :
@@ -98,3 +104,5 @@ MetadataKeyHolder::clear_metadata_keys() const
_imp->keys.clear();
}
+template class WrappedForwardIterator<MetadataKeyHolder::MetadataConstIteratorTag, const std::tr1::shared_ptr<const MetadataKey> >;
+
diff --git a/paludis/metadata_key_holder.hh b/paludis/metadata_key_holder.hh
index a3e6172..44c75b7 100644
--- a/paludis/metadata_key_holder.hh
+++ b/paludis/metadata_key_holder.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -22,7 +22,7 @@
#include <paludis/metadata_key_holder-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/metadata_key-fwd.hh>
#include <tr1/memory>
@@ -65,7 +65,7 @@ namespace paludis
///\{
struct MetadataConstIteratorTag;
- typedef WrappedForwardIterator<MetadataConstIteratorTag, std::tr1::shared_ptr<const MetadataKey> > MetadataConstIterator;
+ typedef WrappedForwardIterator<MetadataConstIteratorTag, const std::tr1::shared_ptr<const MetadataKey> > MetadataConstIterator;
MetadataConstIterator begin_metadata() const PALUDIS_ATTRIBUTE((warn_unused_result));
MetadataConstIterator end_metadata() const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -73,6 +73,10 @@ namespace paludis
///\}
};
+
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+ extern template class WrappedForwardIterator<MetadataKeyHolder::MetadataConstIteratorTag, const std::tr1::shared_ptr<const MetadataKey> >;
+#endif
}
#endif
diff --git a/paludis/ndbam.cc b/paludis/ndbam.cc
index 4a97b49..c8b88cc 100644
--- a/paludis/ndbam.cc
+++ b/paludis/ndbam.cc
@@ -44,8 +44,6 @@
using namespace paludis;
-template class Sequence<std::tr1::shared_ptr<NDBAMEntry> >;
-
namespace
{
struct CategoryContents;
@@ -673,3 +671,7 @@ NDBAM::index(const QualifiedPackageName & q, const std::string & d) const
pc_index_sym.symlink("../../../data/" + d);
}
+template class Sequence<std::tr1::shared_ptr<NDBAMEntry> >;
+template class WrappedForwardIterator<Sequence<std::tr1::shared_ptr<NDBAMEntry> >::ConstIteratorTag, const std::tr1::shared_ptr<NDBAMEntry> >;
+
+
diff --git a/paludis/output_manager_factory.cc b/paludis/output_manager_factory.cc
index 66b0df0..0013e1e 100644
--- a/paludis/output_manager_factory.cc
+++ b/paludis/output_manager_factory.cc
@@ -25,7 +25,7 @@
#include <paludis/util/join.hh>
#include <paludis/util/named_value.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/set.hh>
+#include <paludis/util/set-impl.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/system.hh>
#include <paludis/util/dir_iterator.hh>
@@ -81,6 +81,12 @@ namespace paludis
Keys keys;
std::list<void *> dl_opened;
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<OutputManagerFactory::ConstIteratorTag>
+ {
+ typedef FirstIteratorTypes<Keys::const_iterator>::Type UnderlyingIterator;
+ };
}
OutputManagerFactory::OutputManagerFactory() :
@@ -112,13 +118,13 @@ OutputManagerFactory::create(
OutputManagerFactory::ConstIterator
OutputManagerFactory::begin_keys() const
{
- return first_iterator(_imp->keys.begin());
+ return ConstIterator(first_iterator(_imp->keys.begin()));
}
OutputManagerFactory::ConstIterator
OutputManagerFactory::end_keys() const
{
- return first_iterator(_imp->keys.end());
+ return ConstIterator(first_iterator(_imp->keys.end()));
}
void
diff --git a/paludis/output_manager_factory.hh b/paludis/output_manager_factory.hh
index be627d9..dbbde29 100644
--- a/paludis/output_manager_factory.hh
+++ b/paludis/output_manager_factory.hh
@@ -24,7 +24,7 @@
#include <paludis/util/attributes.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/instantiation_policy.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/map-fwd.hh>
#include <paludis/output_manager-fwd.hh>
#include <paludis/util/set-fwd.hh>
@@ -104,6 +104,7 @@ namespace paludis
#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
extern template class PrivateImplementationPattern<OutputManagerFactory>;
extern template class InstantiationPolicy<OutputManagerFactory, instantiation_method::SingletonTag>;
+ extern template class WrappedForwardIterator<OutputManagerFactory::ConstIteratorTag, const std::string>;
#endif
}
diff --git a/paludis/package_database.cc b/paludis/package_database.cc
index 68ef2ef..84d4f0d 100644
--- a/paludis/package_database.cc
+++ b/paludis/package_database.cc
@@ -33,7 +33,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/member_iterator-impl.hh>
-#include <paludis/util/set.hh>
+#include <paludis/util/set-impl.hh>
#include <paludis/util/map.hh>
#include <paludis/util/map-impl.hh>
#include <paludis/util/sequence.hh>
@@ -48,8 +48,20 @@
using namespace paludis;
-template class WrappedForwardIterator<AmbiguousPackageNameError::OptionsConstIteratorTag, const std::string>;
-template class WrappedForwardIterator<PackageDatabase::RepositoryConstIteratorTag, const std::tr1::shared_ptr<Repository> >;
+namespace paludis
+{
+ template <>
+ struct WrappedForwardIteratorTraits<AmbiguousPackageNameError::OptionsConstIteratorTag>
+ {
+ typedef std::list<std::string>::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<PackageDatabase::RepositoryConstIteratorTag>
+ {
+ typedef std::list<std::tr1::shared_ptr<Repository> >::const_iterator UnderlyingIterator;
+ };
+}
PackageDatabaseError::PackageDatabaseError(const std::string & our_message) throw () :
Exception(our_message)
@@ -398,3 +410,6 @@ PackageDatabase::all_filter()
return result;
}
+template class WrappedForwardIterator<AmbiguousPackageNameError::OptionsConstIteratorTag, const std::string>;
+template class WrappedForwardIterator<PackageDatabase::RepositoryConstIteratorTag, const std::tr1::shared_ptr<Repository> >;
+
diff --git a/paludis/package_database.hh b/paludis/package_database.hh
index 9b98f9a..719c0b0 100644
--- a/paludis/package_database.hh
+++ b/paludis/package_database.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -31,7 +31,7 @@
#include <paludis/util/join.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/version_spec.hh>
#include <paludis/contents.hh>
@@ -304,6 +304,11 @@ namespace paludis
///\}
};
+
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+ extern template class WrappedForwardIterator<PackageDatabase::RepositoryConstIteratorTag, const std::tr1::shared_ptr<Repository> >;
+ extern template class WrappedForwardIterator<AmbiguousPackageNameError::OptionsConstIteratorTag, const std::string>;
+#endif
}
#endif
diff --git a/paludis/package_id.cc b/paludis/package_id.cc
index 9ebf696..1d5e5ed 100644
--- a/paludis/package_id.cc
+++ b/paludis/package_id.cc
@@ -42,24 +42,6 @@ using namespace paludis;
#include <paludis/package_id-se.cc>
-template class Sequence<std::tr1::shared_ptr<const PackageID> >;
-template class WrappedForwardIterator<Sequence<std::tr1::shared_ptr<const PackageID> >::ConstIteratorTag,
- const std::tr1::shared_ptr<const PackageID> >;
-template class WrappedForwardIterator<Sequence<std::tr1::shared_ptr<const PackageID> >::ReverseConstIteratorTag,
- const std::tr1::shared_ptr<const PackageID> >;
-template class WrappedOutputIterator<Sequence<std::tr1::shared_ptr<const PackageID> >::InserterTag,
- std::tr1::shared_ptr<const PackageID> >;
-
-template class Set<std::tr1::shared_ptr<const PackageID>, PackageIDSetComparator>;
-template class WrappedForwardIterator<Set<std::tr1::shared_ptr<const PackageID>, PackageIDSetComparator>::ConstIteratorTag,
- const std::tr1::shared_ptr<const PackageID> >;
-template class WrappedOutputIterator<Set<std::tr1::shared_ptr<const PackageID>, PackageIDSetComparator>::InserterTag,
- std::tr1::shared_ptr<const PackageID> >;
-
-template class WrappedForwardIterator<PackageID::MetadataConstIteratorTag, const std::tr1::shared_ptr<const MetadataKey> >;
-template class WrappedForwardIterator<PackageID::MasksConstIteratorTag, const std::tr1::shared_ptr<const Mask> >;
-template class WrappedForwardIterator<PackageID::OverriddenMasksConstIteratorTag, const std::tr1::shared_ptr<const OverriddenMask> >;
-
namespace paludis
{
template <>
@@ -68,6 +50,18 @@ namespace paludis
mutable std::list<std::tr1::shared_ptr<const Mask> > masks;
mutable std::list<std::tr1::shared_ptr<const OverriddenMask> > overridden_masks;
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<PackageID::MasksConstIteratorTag>
+ {
+ typedef std::list<std::tr1::shared_ptr<const Mask> >::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<PackageID::OverriddenMasksConstIteratorTag>
+ {
+ typedef std::list<std::tr1::shared_ptr<const OverriddenMask> >::const_iterator UnderlyingIterator;
+ };
}
PackageID::PackageID() :
@@ -249,3 +243,20 @@ PackageID::can_drop_in_memory_cache() const
{
}
+template class Sequence<std::tr1::shared_ptr<const PackageID> >;
+template class WrappedForwardIterator<Sequence<std::tr1::shared_ptr<const PackageID> >::ConstIteratorTag,
+ const std::tr1::shared_ptr<const PackageID> >;
+template class WrappedForwardIterator<Sequence<std::tr1::shared_ptr<const PackageID> >::ReverseConstIteratorTag,
+ const std::tr1::shared_ptr<const PackageID> >;
+template class WrappedOutputIterator<Sequence<std::tr1::shared_ptr<const PackageID> >::InserterTag,
+ std::tr1::shared_ptr<const PackageID> >;
+
+template class Set<std::tr1::shared_ptr<const PackageID>, PackageIDSetComparator>;
+template class WrappedForwardIterator<Set<std::tr1::shared_ptr<const PackageID>, PackageIDSetComparator>::ConstIteratorTag,
+ const std::tr1::shared_ptr<const PackageID> >;
+template class WrappedOutputIterator<Set<std::tr1::shared_ptr<const PackageID>, PackageIDSetComparator>::InserterTag,
+ std::tr1::shared_ptr<const PackageID> >;
+
+template class WrappedForwardIterator<PackageID::MasksConstIteratorTag, const std::tr1::shared_ptr<const Mask> >;
+template class WrappedForwardIterator<PackageID::OverriddenMasksConstIteratorTag, const std::tr1::shared_ptr<const OverriddenMask> >;
+
diff --git a/paludis/package_id.hh b/paludis/package_id.hh
index cefda92..e22aada 100644
--- a/paludis/package_id.hh
+++ b/paludis/package_id.hh
@@ -25,7 +25,7 @@
#include <paludis/util/attributes.hh>
#include <paludis/util/operators.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/action-fwd.hh>
@@ -487,6 +487,11 @@ namespace paludis
bool operator() (const std::tr1::shared_ptr<const PackageID> &,
const std::tr1::shared_ptr<const PackageID> &) const;
};
+
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+ extern template class WrappedForwardIterator<PackageID::MasksConstIteratorTag, const std::tr1::shared_ptr<const Mask> >;
+ extern template class WrappedForwardIterator<PackageID::OverriddenMasksConstIteratorTag, const std::tr1::shared_ptr<const OverriddenMask> >;
+#endif
}
#endif
diff --git a/paludis/range_rewriter_TEST.cc b/paludis/range_rewriter_TEST.cc
index 7dd49ce..ecc0788 100644
--- a/paludis/range_rewriter_TEST.cc
+++ b/paludis/range_rewriter_TEST.cc
@@ -21,6 +21,7 @@
#include <paludis/dep_spec.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/environments/test/test_environment.hh>
#include <test/test_runner.hh>
diff --git a/paludis/repositories/accounts/accounts_dep_key.cc b/paludis/repositories/accounts/accounts_dep_key.cc
index faeba26..eb13734 100644
--- a/paludis/repositories/accounts/accounts_dep_key.cc
+++ b/paludis/repositories/accounts/accounts_dep_key.cc
@@ -18,7 +18,7 @@
*/
#include <paludis/repositories/accounts/accounts_dep_key.hh>
-#include <paludis/util/set.hh>
+#include <paludis/util/set-impl.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/return_literal_function.hh>
#include <paludis/selection.hh>
@@ -28,7 +28,9 @@
#include <paludis/dep_spec.hh>
#include <paludis/formatter.hh>
#include <paludis/environment.hh>
+#include <paludis/util/private_implementation_pattern-impl.hh>
#include <sstream>
+#include <list>
using namespace paludis;
using namespace paludis::accounts_repository;
@@ -39,13 +41,13 @@ namespace paludis
struct Implementation<AccountsDepKey>
{
const Environment * const env;
- const std::tr1::shared_ptr<Sequence<std::tr1::shared_ptr<PackageDepSpec> > > specs;
+ const std::tr1::shared_ptr<std::list<std::tr1::shared_ptr<PackageDepSpec> > > specs;
const std::tr1::shared_ptr<DependencySpecTree> tree;
const std::tr1::shared_ptr<DependenciesLabelSequence> initial_labels;
Implementation(const Environment * const e, const std::tr1::shared_ptr<const Set<std::string> > & s) :
env(e),
- specs(new Sequence<std::tr1::shared_ptr<PackageDepSpec> >),
+ specs(new std::list<std::tr1::shared_ptr<PackageDepSpec> >),
tree(new DependencySpecTree(make_shared_ptr(new AllDepSpec))),
initial_labels(new DependenciesLabelSequence)
{
@@ -115,7 +117,7 @@ AccountsDepKey::pretty_print_flat(const DependencySpecTree::ItemFormatter & f) c
{
std::stringstream s;
- for (Sequence<std::tr1::shared_ptr<PackageDepSpec> >::ConstIterator i(_imp->specs->begin()),
+ for (std::list<std::tr1::shared_ptr<PackageDepSpec> >::const_iterator i(_imp->specs->begin()),
i_end(_imp->specs->end()) ; i != i_end ; ++i)
{
if (! s.str().empty())
diff --git a/paludis/repositories/accounts/accounts_id.cc b/paludis/repositories/accounts/accounts_id.cc
index ab8e48b..60fe4f8 100644
--- a/paludis/repositories/accounts/accounts_id.cc
+++ b/paludis/repositories/accounts/accounts_id.cc
@@ -30,6 +30,7 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/output_manager.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
diff --git a/paludis/repositories/cran/dep_spec_pretty_printer.cc b/paludis/repositories/cran/dep_spec_pretty_printer.cc
index 0c78bb7..3a941f1 100644
--- a/paludis/repositories/cran/dep_spec_pretty_printer.cc
+++ b/paludis/repositories/cran/dep_spec_pretty_printer.cc
@@ -19,6 +19,7 @@
#include <paludis/repositories/cran/dep_spec_pretty_printer.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/options.hh>
diff --git a/paludis/repositories/e/aa_visitor.cc b/paludis/repositories/e/aa_visitor.cc
index 05417e2..3d34be5 100644
--- a/paludis/repositories/e/aa_visitor.cc
+++ b/paludis/repositories/e/aa_visitor.cc
@@ -20,8 +20,8 @@
#include <paludis/dep_spec.hh>
#include <paludis/repositories/e/aa_visitor.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/indirect_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
#include <list>
#include <algorithm>
@@ -42,6 +42,12 @@ namespace paludis
{
std::list<std::string> aa;
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<AAVisitor::ConstIteratorTag>
+ {
+ typedef std::list<std::string>::const_iterator UnderlyingIterator;
+ };
}
AAVisitor::AAVisitor() :
@@ -83,3 +89,5 @@ AAVisitor::end() const
return ConstIterator(_imp->aa.end());
}
+template class WrappedForwardIterator<AAVisitor::ConstIteratorTag, const std::string>;
+
diff --git a/paludis/repositories/e/check_fetched_files_visitor.cc b/paludis/repositories/e/check_fetched_files_visitor.cc
index 11a2897..c133752 100644
--- a/paludis/repositories/e/check_fetched_files_visitor.cc
+++ b/paludis/repositories/e/check_fetched_files_visitor.cc
@@ -43,7 +43,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/indirect_iterator.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/output_manager.hh>
diff --git a/paludis/repositories/e/dep_spec_pretty_printer.cc b/paludis/repositories/e/dep_spec_pretty_printer.cc
index 76ff0e4..01d26dc 100644
--- a/paludis/repositories/e/dep_spec_pretty_printer.cc
+++ b/paludis/repositories/e/dep_spec_pretty_printer.cc
@@ -28,6 +28,7 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/set.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/environment.hh>
#include <paludis/selection.hh>
#include <paludis/generator.hh>
diff --git a/paludis/repositories/e/dependencies_rewriter.cc b/paludis/repositories/e/dependencies_rewriter.cc
index 32165a7..a48f24e 100644
--- a/paludis/repositories/e/dependencies_rewriter.cc
+++ b/paludis/repositories/e/dependencies_rewriter.cc
@@ -27,6 +27,7 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/sequence.hh>
#include <paludis/metadata_key.hh>
#include <list>
diff --git a/paludis/repositories/e/e_choices_key.cc b/paludis/repositories/e/e_choices_key.cc
index 154448d..d5cc7eb 100644
--- a/paludis/repositories/e/e_choices_key.cc
+++ b/paludis/repositories/e/e_choices_key.cc
@@ -35,9 +35,11 @@
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/tribool.hh>
#include <paludis/util/member_iterator-impl.hh>
-#include <paludis/util/map.hh>
-#include <paludis/util/sequence.hh>
+#include <paludis/util/map-impl.hh>
+#include <paludis/util/sequence-impl.hh>
+#include <paludis/util/set-impl.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/environment.hh>
#include <paludis/stringify_formatter-impl.hh>
@@ -594,3 +596,5 @@ EChoicesKey::type() const
return _imp->type;
}
+template class Map<ChoiceNameWithPrefix, std::string>;
+
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 3a5b6e6..258c333 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -41,6 +41,8 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/destringify.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/contents.hh>
#include <paludis/repository.hh>
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 731c4f7..8d8672d 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -71,6 +71,7 @@
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/hashes.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/instantiation_policy-impl.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/iterator_funcs.hh>
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 411cb63..6575efe 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -45,6 +45,9 @@
#include <paludis/selection.hh>
#include <paludis/repository_factory.hh>
#include <paludis/choice.hh>
+
+#include <paludis/util/indirect_iterator-impl.hh>
+
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <tr1/functional>
diff --git a/paludis/repositories/e/e_repository_mask_file.cc b/paludis/repositories/e/e_repository_mask_file.cc
index 9e443f9..ede6c9e 100644
--- a/paludis/repositories/e/e_repository_mask_file.cc
+++ b/paludis/repositories/e/e_repository_mask_file.cc
@@ -26,6 +26,7 @@
#include <paludis/util/config_file.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/sequence-impl.hh>
#include <paludis/mask.hh>
#include <list>
@@ -33,15 +34,20 @@
using namespace paludis;
using namespace paludis::erepository;
-template class WrappedForwardIterator<MaskFile::ConstIteratorTag,
- const std::pair<const std::string, std::tr1::shared_ptr<const RepositoryMaskInfo> > >;
+typedef std::list<std::pair<const std::string, std::tr1::shared_ptr<const RepositoryMaskInfo> > > MaskFileLines;
namespace paludis
{
template <>
struct Implementation<MaskFile>
{
- std::list<std::pair<const std::string, std::tr1::shared_ptr<const RepositoryMaskInfo> > > lines;
+ MaskFileLines lines;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<MaskFile::ConstIteratorTag>
+ {
+ typedef MaskFileLines::const_iterator UnderlyingIterator;
};
}
@@ -99,3 +105,6 @@ MaskFile::~MaskFile()
{
}
+template class WrappedForwardIterator<MaskFile::ConstIteratorTag,
+ const std::pair<const std::string, std::tr1::shared_ptr<const RepositoryMaskInfo> > >;
+
diff --git a/paludis/repositories/e/e_repository_mask_file.hh b/paludis/repositories/e/e_repository_mask_file.hh
index 4d8f9a2..106405f 100644
--- a/paludis/repositories/e/e_repository_mask_file.hh
+++ b/paludis/repositories/e/e_repository_mask_file.hh
@@ -24,6 +24,7 @@
#include <paludis/util/attributes.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/config_file.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/mask-fwd.hh>
namespace paludis
@@ -61,6 +62,11 @@ namespace paludis
///\}
};
}
+
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+ extern template class WrappedForwardIterator<erepository::MaskFile::ConstIteratorTag,
+ const std::pair<const std::string, std::tr1::shared_ptr<const RepositoryMaskInfo> > >;
+#endif
}
#endif
diff --git a/paludis/repositories/e/e_repository_news.cc b/paludis/repositories/e/e_repository_news.cc
index 9bee2d3..df81dc9 100644
--- a/paludis/repositories/e/e_repository_news.cc
+++ b/paludis/repositories/e/e_repository_news.cc
@@ -29,7 +29,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/util/sequence-impl.hh>
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/safe_ofstream.hh>
@@ -50,9 +50,7 @@
using namespace paludis;
using namespace paludis::erepository;
-template class WrappedForwardIterator<NewsFile::DisplayIfInstalledConstIteratorTag, const std::string>;
-template class WrappedForwardIterator<NewsFile::DisplayIfKeywordConstIteratorTag, const std::string>;
-template class WrappedForwardIterator<NewsFile::DisplayIfProfileConstIteratorTag, const std::string>;
+typedef std::list<std::string> DisplayIfList;
namespace paludis
{
@@ -87,6 +85,24 @@ namespace paludis
{
}
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<NewsFile::DisplayIfInstalledConstIteratorTag>
+ {
+ typedef DisplayIfList::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<NewsFile::DisplayIfKeywordConstIteratorTag>
+ {
+ typedef DisplayIfList::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<NewsFile::DisplayIfProfileConstIteratorTag>
+ {
+ typedef DisplayIfList::const_iterator UnderlyingIterator;
+ };
}
ERepositoryNews::ERepositoryNews(const Environment * const e, const ERepository * const p,
@@ -244,9 +260,9 @@ namespace paludis
template<>
struct Implementation<NewsFile>
{
- std::list<std::string> display_if_installed;
- std::list<std::string> display_if_keyword;
- std::list<std::string> display_if_profile;
+ DisplayIfList display_if_installed;
+ DisplayIfList display_if_keyword;
+ DisplayIfList display_if_profile;
};
}
@@ -378,3 +394,7 @@ NewsError::NewsError(const FSEntry & f, const std::string & m) throw () :
{
}
+template class WrappedForwardIterator<NewsFile::DisplayIfInstalledConstIteratorTag, const std::string>;
+template class WrappedForwardIterator<NewsFile::DisplayIfKeywordConstIteratorTag, const std::string>;
+template class WrappedForwardIterator<NewsFile::DisplayIfProfileConstIteratorTag, const std::string>;
+
diff --git a/paludis/repositories/e/e_repository_sets.cc b/paludis/repositories/e/e_repository_sets.cc
index 9f90ff4..ecb65c5 100644
--- a/paludis/repositories/e/e_repository_sets.cc
+++ b/paludis/repositories/e/e_repository_sets.cc
@@ -36,7 +36,7 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/tokeniser.hh>
diff --git a/paludis/repositories/e/eapi_phase.cc b/paludis/repositories/e/eapi_phase.cc
index 2de0e77..370e77e 100644
--- a/paludis/repositories/e/eapi_phase.cc
+++ b/paludis/repositories/e/eapi_phase.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -32,8 +32,7 @@
using namespace paludis;
using namespace paludis::erepository;
-template class WrappedForwardIterator<EAPIPhase::ConstIteratorTag, const std::string>;
-template class WrappedForwardIterator<EAPIPhases::ConstIteratorTag, const EAPIPhase>;
+typedef std::list<std::tr1::shared_ptr<const EAPIPhase> > EAPIPhasesList;
namespace paludis
{
@@ -47,7 +46,19 @@ namespace paludis
template <>
struct Implementation<EAPIPhases>
{
- std::list<std::tr1::shared_ptr<const EAPIPhase> > phases;
+ EAPIPhasesList phases;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<EAPIPhases::ConstIteratorTag>
+ {
+ typedef IndirectIterator<EAPIPhasesList::const_iterator> UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<EAPIPhase::ConstIteratorTag>
+ {
+ typedef std::list<std::string>::const_iterator UnderlyingIterator;
};
}
@@ -128,3 +139,7 @@ EAPIPhases::end_phases() const
return ConstIterator(indirect_iterator(_imp->phases.end()));
}
+template class WrappedForwardIterator<EAPIPhase::ConstIteratorTag, const std::string>;
+template class WrappedForwardIterator<EAPIPhases::ConstIteratorTag, const EAPIPhase>;
+
+
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index 4621261..647a061 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -32,6 +32,7 @@
#include <paludis/repositories/e/dependencies_rewriter.hh>
#include <paludis/stringify_formatter.hh>
#include <paludis/repositories/e/eapi.hh>
+#include <paludis/util/private_implementation_pattern-impl.hh>
#include <tr1/functional>
#include <set>
#include <map>
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 8793aee..2c466ec 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -51,7 +51,9 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/tribool.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/return_literal_function.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <set>
#include <iterator>
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index f1d9213..1a05308 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -29,7 +29,7 @@
#include <paludis/util/log.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/cookie.hh>
#include <paludis/util/set.hh>
#include <paludis/util/dir_iterator.hh>
diff --git a/paludis/repositories/e/fetch_visitor.cc b/paludis/repositories/e/fetch_visitor.cc
index 55aff11..bc44d6b 100644
--- a/paludis/repositories/e/fetch_visitor.cc
+++ b/paludis/repositories/e/fetch_visitor.cc
@@ -35,6 +35,7 @@
#include <paludis/util/join.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/output_manager.hh>
#include <list>
diff --git a/paludis/repositories/e/fix_locked_dependencies.cc b/paludis/repositories/e/fix_locked_dependencies.cc
index 9a4c820..1a1f5ec 100644
--- a/paludis/repositories/e/fix_locked_dependencies.cc
+++ b/paludis/repositories/e/fix_locked_dependencies.cc
@@ -25,6 +25,7 @@
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/dep_spec.hh>
#include <paludis/environment.hh>
#include <paludis/package_database.hh>
diff --git a/paludis/repositories/e/glsa.cc b/paludis/repositories/e/glsa.cc
index b99833c..c181761 100644
--- a/paludis/repositories/e/glsa.cc
+++ b/paludis/repositories/e/glsa.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -32,9 +32,9 @@
using namespace paludis;
-template class WrappedForwardIterator<GLSAPackage::ArchsConstIteratorTag, const std::string>;
-template class WrappedForwardIterator<GLSAPackage::RangesConstIteratorTag, const erepository::GLSARange>;
-template class WrappedForwardIterator<GLSA::PackagesConstIteratorTag, const GLSAPackage>;
+typedef std::list<std::string> Archs;
+typedef std::list<erepository::GLSARange> Ranges;
+typedef std::list<std::tr1::shared_ptr<const GLSAPackage> > Packages;
namespace paludis
{
@@ -42,9 +42,9 @@ namespace paludis
struct Implementation<GLSAPackage>
{
QualifiedPackageName name;
- std::list<std::string> archs;
- std::list<erepository::GLSARange> unaffected;
- std::list<erepository::GLSARange> vulnerable;
+ Archs archs;
+ Ranges unaffected;
+ Ranges vulnerable;
Implementation(const QualifiedPackageName & n) :
name(n)
@@ -57,7 +57,25 @@ namespace paludis
{
std::string id;
std::string title;
- std::list<std::tr1::shared_ptr<const GLSAPackage> > packages;
+ Packages packages;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<GLSAPackage::ArchsConstIteratorTag>
+ {
+ typedef Archs::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<GLSAPackage::RangesConstIteratorTag>
+ {
+ typedef Ranges::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<GLSA::PackagesConstIteratorTag>
+ {
+ typedef IndirectIterator<Packages::const_iterator> UnderlyingIterator;
};
}
@@ -201,3 +219,7 @@ GLSAError::GLSAError(const std::string & msg, const std::string & filename) thro
{
}
+template class WrappedForwardIterator<GLSAPackage::ArchsConstIteratorTag, const std::string>;
+template class WrappedForwardIterator<GLSAPackage::RangesConstIteratorTag, const erepository::GLSARange>;
+template class WrappedForwardIterator<GLSA::PackagesConstIteratorTag, const GLSAPackage>;
+
diff --git a/paludis/repositories/e/layout.cc b/paludis/repositories/e/layout.cc
index a38b4d7..db54981 100644
--- a/paludis/repositories/e/layout.cc
+++ b/paludis/repositories/e/layout.cc
@@ -24,14 +24,13 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/instantiation_policy-impl.hh>
#include <paludis/util/map-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
using namespace paludis;
using namespace paludis::erepository;
template class InstantiationPolicy<LayoutFactory, instantiation_method::SingletonTag>;
-template class Map<FSEntry, std::string>;
-
Layout::Layout(const std::tr1::shared_ptr<const FSEntrySequence> & l) :
_master_repositories_locations(l)
{
@@ -82,3 +81,6 @@ LayoutFactory::create(
throw ConfigurationError("Unrecognised layout '" + s + "'");
}
+template class Map<FSEntry, std::string>;
+template class WrappedForwardIterator<Map<FSEntry, std::string>::ConstIteratorTag, const std::pair<const FSEntry, std::string> >;
+
diff --git a/paludis/repositories/e/manifest2_reader.cc b/paludis/repositories/e/manifest2_reader.cc
index d791003..560b458 100644
--- a/paludis/repositories/e/manifest2_reader.cc
+++ b/paludis/repositories/e/manifest2_reader.cc
@@ -36,21 +36,27 @@
using namespace paludis;
using namespace paludis::erepository;
-template class WrappedForwardIterator<Manifest2Reader::ConstIteratorTag, const Manifest2Entry>;
+typedef std::map<std::pair<std::string, std::string>, Manifest2Entry> Entries;
namespace paludis
{
- template<>
+ template <>
struct Implementation<Manifest2Reader>
{
FSEntry manifest;
- std::map<std::pair<std::string, std::string>, Manifest2Entry> entries;
+ Entries entries;
Implementation(const FSEntry & f) :
manifest(f)
{
}
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<Manifest2Reader::ConstIteratorTag>
+ {
+ typedef SecondIteratorTypes<Entries::const_iterator>::Type UnderlyingIterator;
+ };
}
Manifest2Error::Manifest2Error(const std::string & msg) throw () :
@@ -159,3 +165,6 @@ Manifest2Reader::find(const std::pair<const std::string, const std::string> & p)
{
return ConstIterator(second_iterator(_imp->entries.find(p)));
}
+
+template class WrappedForwardIterator<Manifest2Reader::ConstIteratorTag, const Manifest2Entry>;
+
diff --git a/paludis/repositories/e/myoptions_requirements_verifier.cc b/paludis/repositories/e/myoptions_requirements_verifier.cc
index 929212b..9b12f89 100644
--- a/paludis/repositories/e/myoptions_requirements_verifier.cc
+++ b/paludis/repositories/e/myoptions_requirements_verifier.cc
@@ -28,6 +28,7 @@
#include <paludis/util/log.hh>
#include <paludis/util/set.hh>
#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/choice.hh>
#include <paludis/metadata_key.hh>
#include <algorithm>
diff --git a/paludis/repositories/e/pipe_command_handler.cc b/paludis/repositories/e/pipe_command_handler.cc
index 4cc0a57..93e4a96 100644
--- a/paludis/repositories/e/pipe_command_handler.cc
+++ b/paludis/repositories/e/pipe_command_handler.cc
@@ -33,7 +33,7 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/indirect_iterator.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/output_manager.hh>
#include <paludis/package_id.hh>
diff --git a/paludis/repositories/e/pretend_fetch_visitor.cc b/paludis/repositories/e/pretend_fetch_visitor.cc
index cedd999..f330adc 100644
--- a/paludis/repositories/e/pretend_fetch_visitor.cc
+++ b/paludis/repositories/e/pretend_fetch_visitor.cc
@@ -30,6 +30,7 @@
#include <paludis/util/log.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <list>
#include <set>
diff --git a/paludis/repositories/e/profile.cc b/paludis/repositories/e/profile.cc
index 0971d43..f1c983c 100644
--- a/paludis/repositories/e/profile.cc
+++ b/paludis/repositories/e/profile.cc
@@ -18,11 +18,12 @@
*/
#include <paludis/repositories/e/profile.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/map-impl.hh>
#include <paludis/name.hh>
#include <paludis/dep_spec.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/map-impl.hh>
+
using namespace paludis;
using namespace paludis::erepository;
@@ -31,4 +32,6 @@ Profile::~Profile()
}
template class Map<QualifiedPackageName, PackageDepSpec>;
+template class WrappedForwardIterator<Map<QualifiedPackageName, PackageDepSpec>::ConstIteratorTag,
+ const std::pair<const QualifiedPackageName, PackageDepSpec> >;
diff --git a/paludis/repositories/e/profile_file.cc b/paludis/repositories/e/profile_file.cc
index ea7e41b..1d6c21f 100644
--- a/paludis/repositories/e/profile_file.cc
+++ b/paludis/repositories/e/profile_file.cc
@@ -96,6 +96,20 @@ namespace paludis
{
}
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<ProfileFile<LineConfigFile>::ConstIteratorTag>
+ {
+ typedef std::list<std::pair<std::tr1::shared_ptr<const EAPI>,
+ const std::tr1::remove_reference<LineConfigFile::ConstIterator::value_type>::type> >::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<ProfileFile<MaskFile>::ConstIteratorTag>
+ {
+ typedef std::list<std::pair<std::tr1::shared_ptr<const EAPI>,
+ const std::tr1::remove_reference<MaskFile::ConstIterator::value_type>::type> >::const_iterator UnderlyingIterator;
+ };
}
template <typename F_>
@@ -174,5 +188,12 @@ ProfileFile<F_>::end() const
}
template class ProfileFile<LineConfigFile>;
+template class WrappedForwardIterator<ProfileFile<LineConfigFile>::ConstIteratorTag, const std::pair<
+ std::tr1::shared_ptr<const EAPI>,
+ const std::tr1::remove_reference<LineConfigFile::ConstIterator::value_type>::type> >;
+
template class ProfileFile<MaskFile>;
+template class WrappedForwardIterator<ProfileFile<MaskFile>::ConstIteratorTag, const std::pair<
+ std::tr1::shared_ptr<const EAPI>,
+ const std::tr1::remove_reference<MaskFile::ConstIterator::value_type>::type> >;
diff --git a/paludis/repositories/e/source_uri_finder.cc b/paludis/repositories/e/source_uri_finder.cc
index a887b25..bcfa834 100644
--- a/paludis/repositories/e/source_uri_finder.cc
+++ b/paludis/repositories/e/source_uri_finder.cc
@@ -21,17 +21,21 @@
#include <paludis/util/log.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/strip.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/sequence.hh>
-#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/repository.hh>
#include <paludis/environment.hh>
#include <paludis/action.hh>
+
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/sequence-impl.hh>
+#include <paludis/util/private_implementation_pattern-impl.hh>
+
#include <list>
using namespace paludis;
using namespace paludis::erepository;
+typedef std::list<std::pair<std::string, std::string> > Items;
+
namespace paludis
{
template <>
@@ -44,7 +48,7 @@ namespace paludis
const std::string mirrors_name;
const GetMirrorsFunction get_mirrors_fn;
- std::list<std::pair<std::string, std::string> > items;
+ Items items;
Implementation(const Environment * const e, const Repository * const r, const std::string & u, const std::string & f,
const std::string & m, const GetMirrorsFunction & g) :
@@ -57,6 +61,12 @@ namespace paludis
{
}
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<SourceURIFinder::ConstIteratorTag>
+ {
+ typedef Items::const_iterator UnderlyingIterator;
+ };
}
SourceURIFinder::SourceURIFinder(const Environment * const e, const Repository * const repo,
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index f738e13..1b180b6 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -69,14 +69,18 @@
#include <paludis/util/strip.hh>
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/create_iterator-impl.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/simple_visitor_cast.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/safe_ofstream.hh>
+
+#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/create_iterator-impl.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
+
#include <tr1/unordered_map>
#include <tr1/functional>
#include <functional>
@@ -93,7 +97,7 @@ using namespace paludis::erepository;
typedef std::tr1::unordered_map<CategoryNamePart, std::tr1::shared_ptr<QualifiedPackageNameSet>, Hash<CategoryNamePart> > CategoryMap;
typedef std::tr1::unordered_map<QualifiedPackageName, std::tr1::shared_ptr<PackageIDSequence>, Hash<QualifiedPackageName> > IDMap;
-typedef std::map<std::pair<QualifiedPackageName, VersionSpec>, std::tr1::shared_ptr<const Sequence<QualifiedPackageName> > > ProvidesMap;
+typedef std::map<std::pair<QualifiedPackageName, VersionSpec>, std::tr1::shared_ptr<std::list<QualifiedPackageName> > > ProvidesMap;
namespace paludis
{
@@ -586,7 +590,7 @@ VDBRepository::provided_packages() const
continue;
}
- for (Sequence<QualifiedPackageName>::ConstIterator it2(it->second->begin()),
+ for (std::list<QualifiedPackageName>::const_iterator it2(it->second->begin()),
it2_end(it->second->end()); it2_end != it2; ++it2)
_imp->provides->push_back(make_named_values<RepositoryProvidesEntry>(
value_for<n::provided_by>(id),
@@ -659,8 +663,9 @@ VDBRepository::load_provided_using_cache() const
VersionSpec v(tokens.at(1), EAPIData::get_instance()->eapi_from_string(
_imp->params.eapi_when_unknown())->supported()->version_spec_options());
- std::tr1::shared_ptr<Sequence<QualifiedPackageName> > qpns(new Sequence<QualifiedPackageName>);
- std::copy(tokens.begin() + 2, tokens.end(), create_inserter<QualifiedPackageName>(qpns->back_inserter()));
+ std::tr1::shared_ptr<std::list<QualifiedPackageName> > qpns(new std::list<QualifiedPackageName>);
+ std::copy(tokens.begin() + 2, tokens.end(), create_inserter<QualifiedPackageName>(
+ std::back_inserter(*qpns)));
if (_imp->provides_map->end() != _imp->provides_map->find(std::make_pair(q, v)))
Log::get_instance()->message("e.vdb.provides_cache.duplicate", ll_warning, lc_context)
@@ -697,7 +702,7 @@ VDBRepository::provides_from_package_id(const PackageID & id) const
DepSpecFlattener<ProvideSpecTree, PackageDepSpec> f(_imp->params.environment());
provide->root()->accept(f);
- std::tr1::shared_ptr<Sequence<QualifiedPackageName> > qpns(new Sequence<QualifiedPackageName>);
+ std::tr1::shared_ptr<std::list<QualifiedPackageName> > qpns(new std::list<QualifiedPackageName>);
for (DepSpecFlattener<ProvideSpecTree, PackageDepSpec>::ConstIterator
p(f.begin()), p_end(f.end()) ; p != p_end ; ++p)
@@ -780,7 +785,7 @@ VDBRepository::write_provides_cache() const
it_end(_imp->provides_map->end()); it_end != it; ++it)
{
f << it->first.first << " " << it->first.second;
- for (Sequence<QualifiedPackageName>::ConstIterator it2(it->second->begin()),
+ for (std::list<QualifiedPackageName>::const_iterator it2(it->second->begin()),
it2_end(it->second->end()); it2_end != it2; ++it2)
f << " " << *it2;
f << std::endl;
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index 9626a42..76a494c 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -38,6 +38,9 @@
#include <paludis/stringify_formatter.hh>
#include <paludis/action.hh>
#include <paludis/choice.hh>
+
+#include <paludis/util/indirect_iterator-impl.hh>
+
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <tr1/functional>
diff --git a/paludis/repositories/fake/dep_parser_TEST.cc b/paludis/repositories/fake/dep_parser_TEST.cc
index 0842e38..1c79195 100644
--- a/paludis/repositories/fake/dep_parser_TEST.cc
+++ b/paludis/repositories/fake/dep_parser_TEST.cc
@@ -19,6 +19,7 @@
#include <paludis/repositories/fake/dep_parser.hh>
#include <paludis/environments/test/test_environment.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
#include <sstream>
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index afd58ca..1d2a3a6 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -32,6 +32,8 @@
#include <paludis/action.hh>
#include <paludis/literal_metadata_key.hh>
+#include <paludis/util/private_implementation_pattern-impl.hh>
+
using namespace paludis;
namespace paludis
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index 34e6f9a..c6be2bf 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -41,6 +41,7 @@
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/return_literal_function.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <map>
#include <list>
#include <sstream>
diff --git a/paludis/repositories/gems/gem_specifications.cc b/paludis/repositories/gems/gem_specifications.cc
index 5929f65..16ace71 100644
--- a/paludis/repositories/gems/gem_specifications.cc
+++ b/paludis/repositories/gems/gem_specifications.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -33,9 +33,6 @@
using namespace paludis;
using namespace paludis::gems;
-template class WrappedForwardIterator<GemSpecifications::ConstIteratorTag,
- const std::pair<const std::pair<QualifiedPackageName, VersionSpec>, std::tr1::shared_ptr<const GemSpecification> > >;
-
typedef std::tr1::unordered_map<std::pair<QualifiedPackageName, VersionSpec>, std::tr1::shared_ptr<const GemSpecification>,
Hash<std::pair<QualifiedPackageName, VersionSpec> > > Specs;
@@ -46,6 +43,12 @@ namespace paludis
{
Specs specs;
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<GemSpecifications::ConstIteratorTag>
+ {
+ typedef Specs::const_iterator UnderlyingIterator;
+ };
}
namespace
@@ -216,3 +219,7 @@ GemSpecifications::end() const
return ConstIterator(_imp->specs.end());
}
+template class WrappedForwardIterator<GemSpecifications::ConstIteratorTag,
+ const std::pair<const std::pair<QualifiedPackageName, VersionSpec>, std::tr1::shared_ptr<const GemSpecification> > >;
+
+
diff --git a/paludis/repositories/gems/yaml.cc b/paludis/repositories/gems/yaml.cc
index 2c6aba0..773f939 100644
--- a/paludis/repositories/gems/yaml.cc
+++ b/paludis/repositories/gems/yaml.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -32,9 +32,6 @@
using namespace paludis;
using namespace paludis::yaml;
-template class WrappedForwardIterator<MapNode::ConstIteratorTag, const std::pair<const Node *, const Node *> >;
-template class WrappedForwardIterator<SequenceNode::ConstIteratorTag, const Node * const>;
-
Node::~Node()
{
}
@@ -51,6 +48,18 @@ namespace paludis
{
}
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<MapNode::ConstIteratorTag>
+ {
+ typedef std::list<std::pair<const Node *, const Node *> >::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<SequenceNode::ConstIteratorTag>
+ {
+ typedef std::list<const Node *>::const_iterator UnderlyingIterator;
+ };
}
StringNode::StringNode(const std::string & t) :
@@ -390,3 +399,7 @@ ParseError::ParseError(const std::string & s) throw () :
template class InstantiationPolicy<NodeManager, instantiation_method::SingletonTag>;
+template class WrappedForwardIterator<MapNode::ConstIteratorTag, const std::pair<const Node *, const Node *> >;
+template class WrappedForwardIterator<SequenceNode::ConstIteratorTag, const Node * const>;
+
+
diff --git a/paludis/repositories/gems/yaml.hh b/paludis/repositories/gems/yaml.hh
index c2caf44..8ca1299 100644
--- a/paludis/repositories/gems/yaml.hh
+++ b/paludis/repositories/gems/yaml.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -233,6 +233,12 @@ namespace paludis
///\}
};
}
+
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+ extern template class WrappedForwardIterator<yaml::MapNode::ConstIteratorTag, const std::pair<const yaml::Node *, const yaml::Node *> >;
+ extern template class WrappedForwardIterator<yaml::SequenceNode::ConstIteratorTag, const yaml::Node * const>;
+#endif
+
}
#endif
diff --git a/paludis/repositories/unavailable/unavailable_repository_file.cc b/paludis/repositories/unavailable/unavailable_repository_file.cc
index 7fa5d0b..6f1290a 100644
--- a/paludis/repositories/unavailable/unavailable_repository_file.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_file.cc
@@ -19,7 +19,6 @@
#include <paludis/repositories/unavailable/unavailable_repository_file.hh>
#include <paludis/repositories/unavailable/unavailable_repository.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/log.hh>
@@ -30,18 +29,27 @@
#include <paludis/version_spec.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/user_dep_spec.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <list>
using namespace paludis;
using namespace paludis::unavailable_repository;
+typedef std::list<UnavailableRepositoryFileEntry> Entries;
+
namespace paludis
{
template <>
struct Implementation<UnavailableRepositoryFile>
{
std::string repo_name, homepage, description;
- std::list<UnavailableRepositoryFileEntry> entries;
+ Entries entries;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<UnavailableRepositoryFile::ConstIteratorTag>
+ {
+ typedef Entries::const_iterator UnderlyingIterator;
};
}
diff --git a/paludis/repositories/unpackaged/dep_printer.cc b/paludis/repositories/unpackaged/dep_printer.cc
index 04535ec..fbadefe 100644
--- a/paludis/repositories/unpackaged/dep_printer.cc
+++ b/paludis/repositories/unpackaged/dep_printer.cc
@@ -21,6 +21,7 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/environment.hh>
#include <paludis/selection.hh>
#include <paludis/generator.hh>
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index d660826..e0680a5 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -32,7 +32,7 @@
#include <paludis/util/cookie.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/indirect_iterator.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/safe_ofstream.hh>
#include <paludis/stringify_formatter.hh>
diff --git a/paludis/repositories/unpackaged/installed_repository_TEST.cc b/paludis/repositories/unpackaged/installed_repository_TEST.cc
index 8ac1eb9..1efb700 100644
--- a/paludis/repositories/unpackaged/installed_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/installed_repository_TEST.cc
@@ -34,6 +34,7 @@
#include <paludis/util/options.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/standard_output_manager.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <algorithm>
diff --git a/paludis/repositories/unwritten/unwritten_repository_file.cc b/paludis/repositories/unwritten/unwritten_repository_file.cc
index a5bda43..8633008 100644
--- a/paludis/repositories/unwritten/unwritten_repository_file.cc
+++ b/paludis/repositories/unwritten/unwritten_repository_file.cc
@@ -19,8 +19,6 @@
#include <paludis/repositories/unwritten/unwritten_repository_file.hh>
#include <paludis/repositories/unwritten/unwritten_repository.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/log.hh>
#include <paludis/util/simple_parser.hh>
@@ -29,6 +27,7 @@
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/join.hh>
#include <paludis/util/safe_ifstream.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/literal_metadata_key.hh>
@@ -36,17 +35,31 @@
#include <paludis/dep_spec.hh>
#include <paludis/formatter.hh>
#include <paludis/user_dep_spec.hh>
+#include <paludis/spec_tree.hh>
+
+#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
+
#include <list>
using namespace paludis;
using namespace paludis::unwritten_repository;
+typedef std::list<UnwrittenRepositoryFileEntry> Entries;
+
namespace paludis
{
template <>
struct Implementation<UnwrittenRepositoryFile>
{
- std::list<UnwrittenRepositoryFileEntry> entries;
+ Entries entries;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<UnwrittenRepositoryFile::ConstIteratorTag>
+ {
+ typedef Entries::const_iterator UnderlyingIterator;
};
}
diff --git a/paludis/repository_factory.cc b/paludis/repository_factory.cc
index dcd24ae..4a66e57 100644
--- a/paludis/repository_factory.cc
+++ b/paludis/repository_factory.cc
@@ -25,7 +25,7 @@
#include <paludis/util/join.hh>
#include <paludis/util/named_value.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/set.hh>
+#include <paludis/util/set-impl.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/system.hh>
#include <paludis/util/dir_iterator.hh>
@@ -92,6 +92,12 @@ namespace paludis
void register_repositories<NoType<0u> >(const NoType<0u> *, RepositoryFactory * const)
{
}
+
+ template <>
+ struct WrappedForwardIteratorTraits<RepositoryFactory::ConstIteratorTag>
+ {
+ typedef FirstIteratorTypes<Keys::const_iterator>::Type UnderlyingIterator;
+ };
}
namespace
@@ -174,13 +180,13 @@ RepositoryFactory::importance(
RepositoryFactory::ConstIterator
RepositoryFactory::begin_keys() const
{
- return first_iterator(_imp->keys.begin());
+ return ConstIterator(first_iterator(_imp->keys.begin()));
}
RepositoryFactory::ConstIterator
RepositoryFactory::end_keys() const
{
- return first_iterator(_imp->keys.end());
+ return ConstIterator(first_iterator(_imp->keys.end()));
}
void
diff --git a/paludis/repository_factory.hh b/paludis/repository_factory.hh
index a7a4e26..deda7f6 100644
--- a/paludis/repository_factory.hh
+++ b/paludis/repository_factory.hh
@@ -24,7 +24,7 @@
#include <paludis/util/attributes.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/instantiation_policy.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/no_type.hh>
#include <paludis/environment-fwd.hh>
@@ -159,6 +159,7 @@ namespace paludis
#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
extern template class PrivateImplementationPattern<RepositoryFactory>;
extern template class InstantiationPolicy<RepositoryFactory, instantiation_method::SingletonTag>;
+ extern template class WrappedForwardIterator<RepositoryFactory::ConstIteratorTag, const std::string>;
#endif
}
diff --git a/paludis/resolver/constraint.cc b/paludis/resolver/constraint.cc
index ed99cd9..79124f4 100644
--- a/paludis/resolver/constraint.cc
+++ b/paludis/resolver/constraint.cc
@@ -51,6 +51,12 @@ namespace paludis
{
}
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<Constraints::ConstIteratorTag>
+ {
+ typedef Sequence<std::tr1::shared_ptr<const Constraint> >::ConstIterator UnderlyingIterator;
+ };
}
Constraints::Constraints() :
@@ -189,3 +195,6 @@ Constraint::deserialise(Deserialisation & d)
template class PrivateImplementationPattern<Constraints>;
template class WrappedForwardIterator<Constraints::ConstIteratorTag, const std::tr1::shared_ptr<const Constraint> >;
+template class Sequence<std::tr1::shared_ptr<const Constraint> >;
+template class WrappedForwardIterator<ConstraintSequence::ConstIteratorTag, const std::tr1::shared_ptr<const Constraint> >;
+
diff --git a/paludis/resolver/constraint.hh b/paludis/resolver/constraint.hh
index fa5d44a..c2ffd63 100644
--- a/paludis/resolver/constraint.hh
+++ b/paludis/resolver/constraint.hh
@@ -89,6 +89,8 @@ namespace paludis
#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
extern template class PrivateImplementationPattern<resolver::Constraints>;
+ extern template class WrappedForwardIterator<resolver::Constraints::ConstIteratorTag,
+ const std::tr1::shared_ptr<const resolver::Constraint> >;
#endif
}
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index 778f335..d232db9 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -50,6 +50,9 @@
#include <paludis/version_requirements.hh>
#include <paludis/slot_requirement.hh>
#include <paludis/choice.hh>
+
+#include <paludis/util/private_implementation_pattern-impl.hh>
+
#include <map>
#include <set>
diff --git a/paludis/resolver/destination.cc b/paludis/resolver/destination.cc
index db958b2..90b6eae 100644
--- a/paludis/resolver/destination.cc
+++ b/paludis/resolver/destination.cc
@@ -23,6 +23,7 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/sequence-impl.hh>
#include <paludis/serialise-impl.hh>
using namespace paludis;
diff --git a/paludis/resolver/resolutions.cc b/paludis/resolver/resolutions.cc
index 37cb765..dfa99a1 100644
--- a/paludis/resolver/resolutions.cc
+++ b/paludis/resolver/resolutions.cc
@@ -36,6 +36,12 @@ namespace paludis
{
Sequence<std::tr1::shared_ptr<Resolution> > resolutions;
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<Resolutions::ConstIteratorTag>
+ {
+ typedef Sequence<std::tr1::shared_ptr<Resolution> >::ConstIterator UnderlyingIterator;
+ };
}
Resolutions::Resolutions() :
@@ -91,5 +97,5 @@ Resolutions::deserialise(Deserialisation & d)
}
template class PrivateImplementationPattern<Resolutions>;
-template class WrappedForwardIterator<Resolutions::ConstIteratorTag, const std::tr1::shared_ptr<const Resolution> >;
+template class WrappedForwardIterator<Resolutions::ConstIteratorTag, const std::tr1::shared_ptr<Resolution> >;
diff --git a/paludis/resolver/resolutions.hh b/paludis/resolver/resolutions.hh
index ca8c602..37f5f91 100644
--- a/paludis/resolver/resolutions.hh
+++ b/paludis/resolver/resolutions.hh
@@ -24,7 +24,7 @@
#include <paludis/resolver/resolution-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/named_value.hh>
#include <tr1/memory>
@@ -66,6 +66,8 @@ namespace paludis
#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
extern template class PrivateImplementationPattern<resolver::Resolutions>;
+ extern template class WrappedForwardIterator<resolver::Resolutions::ConstIteratorTag,
+ const std::tr1::shared_ptr<resolver::Resolution> >;
#endif
}
diff --git a/paludis/resolver/resolvent.cc b/paludis/resolver/resolvent.cc
index 480a011..166ffe6 100644
--- a/paludis/resolver/resolvent.cc
+++ b/paludis/resolver/resolvent.cc
@@ -262,5 +262,5 @@ SlotNameOrNull::hash() const
}
template class Sequence<Resolvent>;
-template class WrappedForwardIterator<Resolvents::ConstIteratorTag, Resolvent>;
+template class WrappedForwardIterator<Resolvents::ConstIteratorTag, const Resolvent>;
diff --git a/paludis/resolver/resolver.cc b/paludis/resolver/resolver.cc
index cf318d7..94a1c4f 100644
--- a/paludis/resolver/resolver.cc
+++ b/paludis/resolver/resolver.cc
@@ -38,6 +38,8 @@
#include <paludis/notifier_callback.hh>
#include <paludis/dep_spec_flattener.hh>
+#include <paludis/util/private_implementation_pattern-impl.hh>
+
using namespace paludis;
using namespace paludis::resolver;
diff --git a/paludis/resolver/resolver_test.cc b/paludis/resolver/resolver_test.cc
index 2f3a45b..de03107 100644
--- a/paludis/resolver/resolver_test.cc
+++ b/paludis/resolver/resolver_test.cc
@@ -32,10 +32,8 @@
#include <paludis/resolver/jobs.hh>
#include <paludis/resolver/job_id.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/make_named_values.hh>
@@ -47,6 +45,12 @@
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/generator.hh>
+
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/map-impl.hh>
+#include <paludis/util/sequence-impl.hh>
+
#include <algorithm>
#include "config.h"
diff --git a/paludis/resolver/sanitised_dependencies.cc b/paludis/resolver/sanitised_dependencies.cc
index cb1375f..46878d5 100644
--- a/paludis/resolver/sanitised_dependencies.cc
+++ b/paludis/resolver/sanitised_dependencies.cc
@@ -29,6 +29,9 @@
#include <paludis/util/join.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/make_shared_copy.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/wrapped_output_iterator-impl.hh>
+#include <paludis/util/sequence-impl.hh>
#include <paludis/spec_tree.hh>
#include <paludis/slot_requirement.hh>
#include <paludis/metadata_key.hh>
@@ -409,6 +412,12 @@ namespace paludis
{
std::list<SanitisedDependency> sanitised_dependencies;
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<SanitisedDependencies::ConstIteratorTag>
+ {
+ typedef std::list<SanitisedDependency>::const_iterator UnderlyingIterator;
+ };
}
SanitisedDependencies::SanitisedDependencies() :
@@ -575,5 +584,8 @@ SanitisedDependency::deserialise(Deserialisation & d, const std::tr1::shared_ptr
);
}
+template class Sequence<PackageOrBlockDepSpec>;
+template class WrappedForwardIterator<Sequence<PackageOrBlockDepSpec>::ConstIteratorTag, const PackageOrBlockDepSpec>;
+
template class WrappedForwardIterator<SanitisedDependencies::ConstIteratorTag, const SanitisedDependency>;
diff --git a/paludis/selection.cc b/paludis/selection.cc
index 7d57078..b953915 100644
--- a/paludis/selection.cc
+++ b/paludis/selection.cc
@@ -21,10 +21,9 @@
#include <paludis/selection_handler.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/sequence-impl.hh>
-#include <paludis/util/set.hh>
+#include <paludis/util/set-impl.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
-#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/iterator_funcs.hh>
diff --git a/paludis/serialise.cc b/paludis/serialise.cc
index a976ccd..ec731cb 100644
--- a/paludis/serialise.cc
+++ b/paludis/serialise.cc
@@ -22,7 +22,7 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/simple_parser.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/sequence.hh>
+#include <paludis/util/sequence-impl.hh>
#include <paludis/util/join.hh>
#include <paludis/util/member_iterator-impl.hh>
#include <paludis/package_id.hh>
@@ -165,6 +165,12 @@ namespace paludis
{
}
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<Deserialisation::ConstIteratorTag>
+ {
+ typedef std::list<std::tr1::shared_ptr<Deserialisation> >::const_iterator UnderlyingIterator;
+ };
}
Deserialiser::Deserialiser(const Environment * const e, const std::string & s) :
@@ -358,4 +364,5 @@ DeserialisatorHandler<std::tr1::shared_ptr<const PackageID> >::handle(Deserialis
template class PrivateImplementationPattern<Deserialiser>;
template class PrivateImplementationPattern<Deserialisation>;
template class PrivateImplementationPattern<Deserialisator>;
+template class WrappedForwardIterator<Deserialisation::ConstIteratorTag, const std::tr1::shared_ptr<Deserialisation> >;
diff --git a/paludis/set_file_TEST.cc b/paludis/set_file_TEST.cc
index dbc703f..07607de 100644
--- a/paludis/set_file_TEST.cc
+++ b/paludis/set_file_TEST.cc
@@ -27,6 +27,8 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/safe_ifstream.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
+
using namespace test;
using namespace paludis;
diff --git a/paludis/show_suggest_visitor.cc b/paludis/show_suggest_visitor.cc
index 8261b88..4ac8fd8 100644
--- a/paludis/show_suggest_visitor.cc
+++ b/paludis/show_suggest_visitor.cc
@@ -32,6 +32,7 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/join.hh>
#include <tr1/functional>
#include <set>
diff --git a/paludis/spec_tree-fwd.hh b/paludis/spec_tree-fwd.hh
index ca87c21..90549ec 100644
--- a/paludis/spec_tree-fwd.hh
+++ b/paludis/spec_tree-fwd.hh
@@ -45,6 +45,9 @@ namespace paludis
template <typename Tree_>
class BasicInnerNode;
+ template <typename Tree_>
+ struct BasicInnerNodeConstIteratorTag;
+
template <typename Tree_, typename NodeList_>
struct MakeVisitableTypeListEntry;
diff --git a/paludis/spec_tree.cc b/paludis/spec_tree.cc
index c7f06c9..a1ca7cd 100644
--- a/paludis/spec_tree.cc
+++ b/paludis/spec_tree.cc
@@ -18,9 +18,10 @@
*/
#include <paludis/spec_tree.hh>
+#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
using namespace paludis;
using namespace paludis::spec_tree_internals;
@@ -165,6 +166,15 @@ InnerNode<Tree_, Item_>::operator InnerNode<OtherTree_, Item_> () const
return copier.result;
}
+namespace paludis
+{
+ template <typename T_>
+ struct WrappedForwardIteratorTraits<BasicInnerNodeConstIteratorTag<T_> >
+ {
+ typedef typename Sequence<std::tr1::shared_ptr<const BasicNode<T_> > >::ConstIterator UnderlyingIterator;
+ };
+}
+
template class SpecTree<MakeTypeList<
SpecTreeLeafNodeType<PlainTextDepSpec>,
SpecTreeLeafNodeType<PlainTextLabelDepSpec>,
diff --git a/paludis/spec_tree.hh b/paludis/spec_tree.hh
index c29921e..a83b0ce 100644
--- a/paludis/spec_tree.hh
+++ b/paludis/spec_tree.hh
@@ -21,14 +21,13 @@
#define PALUDIS_GUARD_PALUDIS_SPEC_TREE_HH 1
#include <paludis/spec_tree-fwd.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/select.hh>
#include <paludis/util/simple_visitor.hh>
#include <paludis/util/sequence-fwd.hh>
-#include <paludis/util/sequence-impl.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/util/accept_visitor.hh>
-#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <algorithm>
@@ -73,7 +72,7 @@ namespace paludis
public:
BasicInnerNode();
- struct ConstIteratorTag;
+ typedef BasicInnerNodeConstIteratorTag<Tree_> ConstIteratorTag;
typedef WrappedForwardIterator<ConstIteratorTag,
const std::tr1::shared_ptr<const BasicNode<Tree_> > > ConstIterator;
@@ -207,6 +206,26 @@ namespace paludis
private:
const std::tr1::shared_ptr<typename InnerNodeType<RootNode_>::Type> _root;
};
+
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+ extern template class WrappedForwardIterator<spec_tree_internals::BasicInnerNode<GenericSpecTree>::ConstIteratorTag,
+ const std::tr1::shared_ptr<const spec_tree_internals::BasicNode<GenericSpecTree> > >;
+ extern template class WrappedForwardIterator<spec_tree_internals::BasicInnerNode<DependencySpecTree>::ConstIteratorTag,
+ const std::tr1::shared_ptr<const spec_tree_internals::BasicNode<DependencySpecTree> > >;
+ extern template class WrappedForwardIterator<spec_tree_internals::BasicInnerNode<SetSpecTree>::ConstIteratorTag,
+ const std::tr1::shared_ptr<const spec_tree_internals::BasicNode<SetSpecTree> > >;
+ extern template class WrappedForwardIterator<spec_tree_internals::BasicInnerNode<PlainTextSpecTree>::ConstIteratorTag,
+ const std::tr1::shared_ptr<const spec_tree_internals::BasicNode<PlainTextSpecTree> > >;
+ extern template class WrappedForwardIterator<spec_tree_internals::BasicInnerNode<ProvideSpecTree>::ConstIteratorTag,
+ const std::tr1::shared_ptr<const spec_tree_internals::BasicNode<ProvideSpecTree> > >;
+ extern template class WrappedForwardIterator<spec_tree_internals::BasicInnerNode<SimpleURISpecTree>::ConstIteratorTag,
+ const std::tr1::shared_ptr<const spec_tree_internals::BasicNode<SimpleURISpecTree> > >;
+ extern template class WrappedForwardIterator<spec_tree_internals::BasicInnerNode<FetchableURISpecTree>::ConstIteratorTag,
+ const std::tr1::shared_ptr<const spec_tree_internals::BasicNode<FetchableURISpecTree> > >;
+ extern template class WrappedForwardIterator<spec_tree_internals::BasicInnerNode<LicenseSpecTree>::ConstIteratorTag,
+ const std::tr1::shared_ptr<const spec_tree_internals::BasicNode<LicenseSpecTree> > >;
+#endif
+
}
#endif
diff --git a/paludis/sync_task.cc b/paludis/sync_task.cc
index 366412c..3fcc8a9 100644
--- a/paludis/sync_task.cc
+++ b/paludis/sync_task.cc
@@ -35,8 +35,6 @@
using namespace paludis;
-template class WrappedForwardIterator<SyncTask::TargetsConstIteratorTag, const RepositoryName>;
-
namespace paludis
{
template<>
@@ -52,6 +50,12 @@ namespace paludis
{
}
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<SyncTask::TargetsConstIteratorTag>
+ {
+ typedef std::list<RepositoryName>::const_iterator UnderlyingIterator;
+ };
}
SyncTask::SyncTask(Environment * const env, const bool p) :
@@ -215,3 +219,5 @@ SyncTask::end_targets() const
return TargetsConstIterator(_imp->targets.end());
}
+template class WrappedForwardIterator<SyncTask::TargetsConstIteratorTag, const RepositoryName>;
+
diff --git a/paludis/uninstall_list.cc b/paludis/uninstall_list.cc
index 14c94d0..16c4bee 100644
--- a/paludis/uninstall_list.cc
+++ b/paludis/uninstall_list.cc
@@ -31,7 +31,7 @@
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/wrapped_output_iterator-impl.hh>
#include <paludis/util/hashes.hh>
-#include <paludis/util/sequence.hh>
+#include <paludis/util/sequence-impl.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
@@ -60,11 +60,6 @@ typedef std::tr1::unordered_map<
std::tr1::shared_ptr<const DepListEntryTags>,
Hash<std::tr1::shared_ptr<const PackageID> > > DepCollectorCache;
-template class Set<std::tr1::shared_ptr<DepTag> >;
-template class WrappedForwardIterator<Set<std::tr1::shared_ptr<DepTag> >::ConstIteratorTag, const std::tr1::shared_ptr<DepTag> >;
-template class WrappedOutputIterator<Set<std::tr1::shared_ptr<DepTag> >::InserterTag, std::tr1::shared_ptr<DepTag> >;
-template class WrappedForwardIterator<UninstallList::UninstallListTag, const UninstallListEntry>;
-
namespace paludis
{
template<>
@@ -83,6 +78,12 @@ namespace paludis
{
}
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<UninstallList::UninstallListTag>
+ {
+ typedef std::list<UninstallListEntry>::const_iterator UnderlyingIterator;
+ };
}
namespace
@@ -588,3 +589,8 @@ UninstallList::has_errors() const
return end() != std::find_if(begin(), end(), IsError());
}
+template class Set<std::tr1::shared_ptr<DepTag> >;
+template class WrappedForwardIterator<Set<std::tr1::shared_ptr<DepTag> >::ConstIteratorTag, const std::tr1::shared_ptr<DepTag> >;
+template class WrappedOutputIterator<Set<std::tr1::shared_ptr<DepTag> >::InserterTag, std::tr1::shared_ptr<DepTag> >;
+template class WrappedForwardIterator<UninstallList::UninstallListTag, const UninstallListEntry>;
+
diff --git a/paludis/uninstall_list.hh b/paludis/uninstall_list.hh
index a098cfe..0f993ee 100644
--- a/paludis/uninstall_list.hh
+++ b/paludis/uninstall_list.hh
@@ -22,7 +22,7 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/named_value.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/dep_tag-fwd.hh>
@@ -152,6 +152,10 @@ namespace paludis
///\}
};
+
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+ extern template class WrappedForwardIterator<UninstallList::UninstallListTag, const UninstallListEntry>;
+#endif
}
#endif
diff --git a/paludis/uninstall_task.cc b/paludis/uninstall_task.cc
index d0bcfe3..e38a63c 100644
--- a/paludis/uninstall_task.cc
+++ b/paludis/uninstall_task.cc
@@ -31,10 +31,11 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/iterator_funcs.hh>
-#include <paludis/util/sequence.hh>
+#include <paludis/util/sequence-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/options.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/package_database.hh>
#include <paludis/hook.hh>
#include <paludis/dep_tag.hh>
@@ -50,8 +51,6 @@
using namespace paludis;
-template class WrappedForwardIterator<AmbiguousUnmergeTargetError::ConstIteratorTag, const std::tr1::shared_ptr<const PackageID> >;
-
AmbiguousUnmergeTargetError::AmbiguousUnmergeTargetError(const std::string & t,
const std::tr1::shared_ptr<const PackageIDSequence> m) throw () :
Exception("Ambiguous unmerge target '" + t + "'"),
@@ -117,6 +116,12 @@ namespace paludis
{
}
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<AmbiguousUnmergeTargetError::ConstIteratorTag>
+ {
+ typedef PackageIDSequence::ConstIterator UnderlyingIterator;
+ };
}
UninstallTask::UninstallTask(Environment * const e) :
@@ -474,3 +479,5 @@ UninstallTask::world_remove_packages(const std::tr1::shared_ptr<const SetSpecTre
a->root()->accept(w);
}
+template class WrappedForwardIterator<AmbiguousUnmergeTargetError::ConstIteratorTag, const std::tr1::shared_ptr<const PackageID> >;
+
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index a36ef7d..83d9d3b 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -35,6 +35,7 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
using namespace paludis;
diff --git a/paludis/util/config_file.cc b/paludis/util/config_file.cc
index 5604782..5306fb1 100644
--- a/paludis/util/config_file.cc
+++ b/paludis/util/config_file.cc
@@ -37,8 +37,23 @@ using namespace paludis;
#include <paludis/util/config_file-se.cc>
-template class WrappedForwardIterator<LineConfigFile::ConstIteratorTag, const std::string>;
-template class WrappedForwardIterator<KeyValueConfigFile::ConstIteratorTag, const std::pair<const std::string, std::string> >;
+typedef std::list<std::string> LineConfigFileLines;
+typedef std::map<std::string, std::string> KeyValueConfigFileValues;
+
+namespace paludis
+{
+ template <>
+ struct WrappedForwardIteratorTraits<LineConfigFile::ConstIteratorTag>
+ {
+ typedef LineConfigFileLines::const_iterator UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<KeyValueConfigFile::ConstIteratorTag>
+ {
+ typedef KeyValueConfigFileValues::const_iterator UnderlyingIterator;
+ };
+}
ConfigFileError::ConfigFileError(const std::string & filename, const std::string & m) throw () :
ConfigurationError(filename.empty() ? m : "In file '" + filename + "': " + m)
@@ -153,7 +168,7 @@ namespace paludis
struct Implementation<LineConfigFile>
{
const LineConfigFileOptions options;
- std::list<std::string> lines;
+ LineConfigFileLines lines;
Implementation(const LineConfigFileOptions & o) :
options(o)
@@ -317,7 +332,7 @@ namespace paludis
const KeyValueConfigFile::DefaultFunction default_function;
const KeyValueConfigFile::TransformationFunction transformation_function;
- std::map<std::string, std::string> values;
+ KeyValueConfigFileValues values;
Implementation(
const KeyValueConfigFileOptions & o,
@@ -758,3 +773,6 @@ KeyValueConfigFile::transformation_function() const
template class PrivateImplementationPattern<KeyValueConfigFile>;
+template class WrappedForwardIterator<LineConfigFile::ConstIteratorTag, const std::string>;
+template class WrappedForwardIterator<KeyValueConfigFile::ConstIteratorTag, const std::pair<const std::string, std::string> >;
+
diff --git a/paludis/util/config_file.hh b/paludis/util/config_file.hh
index 657b8f3..9026ad7 100644
--- a/paludis/util/config_file.hh
+++ b/paludis/util/config_file.hh
@@ -26,7 +26,7 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/options-fwd.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <iosfwd>
@@ -252,8 +252,10 @@ namespace paludis
extern template class PrivateImplementationPattern<ConfigFile::Source>;
extern template class PrivateImplementationPattern<LineConfigFile>;
extern template class PrivateImplementationPattern<KeyValueConfigFile>;
-#endif
+ extern template class WrappedForwardIterator<LineConfigFile::ConstIteratorTag, const std::string>;
+ extern template class WrappedForwardIterator<KeyValueConfigFile::ConstIteratorTag, const std::pair<const std::string, std::string> >;
+#endif
}
#endif
diff --git a/paludis/util/fs_entry.cc b/paludis/util/fs_entry.cc
index ecea5cd..3c70585 100644
--- a/paludis/util/fs_entry.cc
+++ b/paludis/util/fs_entry.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
* Copyright (c) 2006 Mark Loeser
* Copyright (c) 2008 Fernando J. Pereda
*
@@ -53,12 +53,6 @@
using namespace paludis;
-template class Sequence<FSEntry>;
-template class WrappedForwardIterator<Sequence<FSEntry>::ConstIteratorTag, const FSEntry>;
-template class WrappedForwardIterator<Sequence<FSEntry>::ReverseConstIteratorTag, const FSEntry>;
-template class WrappedOutputIterator<Sequence<FSEntry>::InserterTag, FSEntry>;
-template class Set<FSEntry>;
-
FSError::FSError(const std::string & our_message) throw () :
Exception(our_message)
{
@@ -707,3 +701,12 @@ FSEntry::lowlevel_id() const
return std::make_pair(_imp->stat_info->st_dev, _imp->stat_info->st_ino);
}
+
+template class Sequence<FSEntry>;
+template class WrappedForwardIterator<Sequence<FSEntry>::ConstIteratorTag, const FSEntry>;
+template class WrappedForwardIterator<Sequence<FSEntry>::ReverseConstIteratorTag, const FSEntry>;
+template class WrappedOutputIterator<Sequence<FSEntry>::InserterTag, FSEntry>;
+
+template class Set<FSEntry>;
+template class WrappedForwardIterator<Set<FSEntry>::ConstIteratorTag, const FSEntry>;
+
diff --git a/paludis/util/graph-impl.hh b/paludis/util/graph-impl.hh
index 30e6f43..5d682a7 100644
--- a/paludis/util/graph-impl.hh
+++ b/paludis/util/graph-impl.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -77,6 +77,12 @@ namespace paludis
///\}
};
+ template <>
+ struct WrappedForwardIteratorTraits<NoGraphTopologicalOrderExistsError::RemainingNodes::ConstIteratorTag>
+ {
+ typedef std::list<std::string>::const_iterator UnderlyingIterator;
+ };
+
/**
* Implementation data for a DirectedGraph.
*
diff --git a/paludis/util/map-fwd.hh b/paludis/util/map-fwd.hh
index 508b68d..bc92a0b 100644
--- a/paludis/util/map-fwd.hh
+++ b/paludis/util/map-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -33,6 +33,9 @@ namespace paludis
template <typename K_, typename V_, typename C_ = DefaultMapComparator<K_> >
struct Map;
+
+ template <typename K_, typename V_, typename C_ = DefaultMapComparator<K_> >
+ struct MapConstIteratorTag;
}
#endif
diff --git a/paludis/util/map-impl.hh b/paludis/util/map-impl.hh
index 1f34120..df6dfa4 100644
--- a/paludis/util/map-impl.hh
+++ b/paludis/util/map-impl.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -61,6 +61,12 @@ namespace paludis
{
std::map<K_, V_, C_> map;
};
+
+ template <typename K_, typename V_, typename C_>
+ struct WrappedForwardIteratorTraits<MapConstIteratorTag<K_, V_, C_> >
+ {
+ typedef typename std::map<K_, V_, C_>::const_iterator UnderlyingIterator;
+ };
}
template <typename K_, typename V_, typename C_>
diff --git a/paludis/util/map.hh b/paludis/util/map.hh
index 35e2cc5..f49622c 100644
--- a/paludis/util/map.hh
+++ b/paludis/util/map.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -25,8 +25,8 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/wrapped_output_iterator-fwd.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
-
+#include <paludis/util/wrapped_forward_iterator.hh>
+#include <string>
#include <utility>
/** \file
@@ -69,7 +69,7 @@ namespace paludis
///\name Iteration
///\{
- struct ConstIteratorTag;
+ typedef MapConstIteratorTag<K_, V_, C_> ConstIteratorTag;
typedef WrappedForwardIterator<ConstIteratorTag, const std::pair<const K_, V_> > ConstIterator;
ConstIterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -98,6 +98,11 @@ namespace paludis
///\}
};
+
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+ extern template class Map<std::string, std::string>;
+ extern template class WrappedForwardIterator<Map<std::string, std::string>::ConstIteratorTag, const std::pair<const std::string, std::string> >;
+#endif
}
#endif
diff --git a/paludis/util/sequence-fwd.hh b/paludis/util/sequence-fwd.hh
index 2767460..4df8906 100644
--- a/paludis/util/sequence-fwd.hh
+++ b/paludis/util/sequence-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -30,6 +30,12 @@ namespace paludis
{
template <typename T_>
struct Sequence;
+
+ template <typename T_>
+ struct SequenceConstIteratorTag;
+
+ template <typename T_>
+ struct SequenceReverseConstIteratorTag;
}
#endif
diff --git a/paludis/util/sequence-impl.hh b/paludis/util/sequence-impl.hh
index 1efb368..ee748be 100644
--- a/paludis/util/sequence-impl.hh
+++ b/paludis/util/sequence-impl.hh
@@ -49,6 +49,18 @@ namespace paludis
{
std::list<T_> list;
};
+
+ template <typename T_>
+ struct WrappedForwardIteratorTraits<SequenceConstIteratorTag<T_> >
+ {
+ typedef typename std::list<T_>::const_iterator UnderlyingIterator;
+ };
+
+ template <typename T_>
+ struct WrappedForwardIteratorTraits<SequenceReverseConstIteratorTag<T_> >
+ {
+ typedef typename std::list<T_>::const_reverse_iterator UnderlyingIterator;
+ };
}
template <typename T_>
diff --git a/paludis/util/sequence.cc b/paludis/util/sequence.cc
index 9c8cefd..00036a1 100644
--- a/paludis/util/sequence.cc
+++ b/paludis/util/sequence.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
diff --git a/paludis/util/sequence.hh b/paludis/util/sequence.hh
index fc3c268..5b8b74d 100644
--- a/paludis/util/sequence.hh
+++ b/paludis/util/sequence.hh
@@ -75,13 +75,13 @@ namespace paludis
///\name Iteration
///\{
- struct ConstIteratorTag;
+ typedef SequenceConstIteratorTag<T_> ConstIteratorTag;
typedef WrappedForwardIterator<ConstIteratorTag, const T_> ConstIterator;
ConstIterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator last() const PALUDIS_ATTRIBUTE((warn_unused_result));
- struct ReverseConstIteratorTag;
+ typedef SequenceReverseConstIteratorTag<T_> ReverseConstIteratorTag;
typedef WrappedForwardIterator<ReverseConstIteratorTag, const T_> ReverseConstIterator;
ReverseConstIterator rbegin() const PALUDIS_ATTRIBUTE((warn_unused_result));
ReverseConstIterator rend() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/util/set-fwd.hh b/paludis/util/set-fwd.hh
index 87956d7..692ebcb 100644
--- a/paludis/util/set-fwd.hh
+++ b/paludis/util/set-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -33,6 +33,9 @@ namespace paludis
template <typename T_, typename C_ = DefaultSetComparator<T_> >
struct Set;
+
+ template <typename T_, typename C_>
+ struct SetConstIteratorTag;
}
#endif
diff --git a/paludis/util/set-impl.hh b/paludis/util/set-impl.hh
index 2229d05..5e49ab3 100644
--- a/paludis/util/set-impl.hh
+++ b/paludis/util/set-impl.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -63,6 +63,12 @@ namespace paludis
{
std::set<T_, C_> set;
};
+
+ template <typename T_, typename C_>
+ struct WrappedForwardIteratorTraits<SetConstIteratorTag<T_, C_> >
+ {
+ typedef typename std::set<T_, C_>::const_iterator UnderlyingIterator;
+ };
}
template <typename T_, typename C_>
diff --git a/paludis/util/set.hh b/paludis/util/set.hh
index f4a190f..f1b8b5d 100644
--- a/paludis/util/set.hh
+++ b/paludis/util/set.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -26,6 +26,7 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/util/wrapped_output_iterator-fwd.hh>
+#include <string>
/** \file
* Declarations for the Set<> class.
@@ -75,7 +76,7 @@ namespace paludis
///\name Iteration
///\{
- struct ConstIteratorTag;
+ typedef SetConstIteratorTag<T_, C_> ConstIteratorTag;
typedef WrappedForwardIterator<ConstIteratorTag, const T_> ConstIterator;
ConstIterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -105,6 +106,10 @@ namespace paludis
///\}
};
+
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+ extern template class Set<std::string>;
+#endif
}
#endif
diff --git a/paludis/util/system.cc b/paludis/util/system.cc
index 1c65459..e918fd2 100644
--- a/paludis/util/system.cc
+++ b/paludis/util/system.cc
@@ -49,7 +49,16 @@
using namespace paludis;
-template class WrappedForwardIterator<Command::ConstIteratorTag, const std::pair<const std::string, std::string> >;
+typedef std::map<std::string, std::string> CommandSetenvValues;
+
+namespace paludis
+{
+ template <>
+ struct WrappedForwardIteratorTraits<Command::ConstIteratorTag>
+ {
+ typedef CommandSetenvValues::const_iterator UnderlyingIterator;
+ };
+}
namespace
{
@@ -154,7 +163,7 @@ namespace paludis
{
std::string command;
bool clearenv;
- std::map<std::string, std::string> setenv_values;
+ CommandSetenvValues setenv_values;
std::string chdir;
bool echo_to_stderr;
std::tr1::shared_ptr<uid_t> uid;
@@ -1322,3 +1331,5 @@ paludis::get_group_name(const gid_t u)
}
}
+template class WrappedForwardIterator<Command::ConstIteratorTag, const std::pair<const std::string, std::string> >;
+
diff --git a/paludis/util/wrapped_forward_iterator-fwd.hh b/paludis/util/wrapped_forward_iterator-fwd.hh
index 9b3fa5f..54fd31a 100644
--- a/paludis/util/wrapped_forward_iterator-fwd.hh
+++ b/paludis/util/wrapped_forward_iterator-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -24,6 +24,11 @@ namespace paludis
{
template <typename Tag_, typename Value_>
struct WrappedForwardIterator;
+
+ template <typename Tag_>
+ struct WrappedForwardIteratorTraits;
+
+ struct WrappedForwardIteratorUnderlyingIteratorHolder;
}
#endif
diff --git a/paludis/util/wrapped_forward_iterator-impl.hh b/paludis/util/wrapped_forward_iterator-impl.hh
index 7a02ded..502e9c6 100644
--- a/paludis/util/wrapped_forward_iterator-impl.hh
+++ b/paludis/util/wrapped_forward_iterator-impl.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -21,104 +21,100 @@
#define PALUDIS_GUARD_PALUDIS_UTIL_WRAPPED_FORWARD_ITERATOR_IMPL_HH 1
#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/checked_delete.hh>
namespace paludis
{
- template <typename Tag_, typename Value_>
- struct WrappedForwardIterator<Tag_, Value_>::Base
+ template <typename WrappedIter_>
+ typename WrappedForwardIteratorTraits<typename WrappedIter_::Tag>::UnderlyingIterator *
+ wrapped_underlying_iterator_real_type(const WrappedIter_ &, void * i)
{
- virtual Base * clone() const = 0;
- virtual void increment() = 0;
- virtual typename WrappedForwardIterator<Tag_, Value_>::pointer pointer() const = 0;
- virtual typename WrappedForwardIterator<Tag_, Value_>::reference reference() const = 0;
- virtual bool equal(const Base *) const = 0;
- virtual void * underlying_iterator_ptr() = 0;
- virtual const void * underlying_iterator_ptr() const = 0;
+ return reinterpret_cast<typename WrappedForwardIteratorTraits<typename WrappedIter_::Tag>::UnderlyingIterator *>(i);
+ }
- virtual ~Base()
- {
- }
- };
+ template <typename WrappedIter_>
+ WrappedForwardIteratorUnderlyingIteratorHolder *
+ wrapped_underlying_iterator_hide_real_type(const WrappedIter_ &,
+ typename WrappedForwardIteratorTraits<typename WrappedIter_::Tag>::UnderlyingIterator * const i)
+ {
+ return reinterpret_cast<WrappedForwardIteratorUnderlyingIteratorHolder *>(i);
+ }
template <typename Tag_, typename Value_>
- template <typename Iter_>
- struct WrappedForwardIterator<Tag_, Value_>::BaseImpl :
- WrappedForwardIterator<Tag_, Value_>::Base
+ WrappedForwardIterator<Tag_, Value_>::WrappedForwardIterator() :
+ _iter(wrapped_underlying_iterator_hide_real_type(*this, new typename WrappedForwardIteratorTraits<Tag_>::UnderlyingIterator))
{
- Iter_ i;
-
- BaseImpl(const Iter_ & ii) :
- i(ii)
- {
- }
-
- Base * clone() const
- {
- return new BaseImpl(i);
- }
-
- void increment()
- {
- ++i;
- }
+ }
- typename WrappedForwardIterator<Tag_, Value_>::reference reference() const
- {
- return *i;
- }
+ template <typename Tag_, typename Value_>
+ WrappedForwardIterator<Tag_, Value_>::~WrappedForwardIterator()
+ {
+ checked_delete(wrapped_underlying_iterator_real_type(*this, _iter));
+ }
- typename WrappedForwardIterator<Tag_, Value_>::pointer pointer() const
+ template <typename Tag_, typename Value_, typename Iter_>
+ struct WrappedForwardIteratorGetBase
+ {
+ template <typename Traits_>
+ static typename Traits_::UnderlyingIterator real_get_iter(const typename Traits_::UnderlyingIterator & i)
{
- return i.operator-> ();
+ return i;
}
- bool equal(const Base * other) const
+ template <typename Traits_>
+ static typename Traits_::UnderlyingIterator
+ real_get_iter(const typename Traits_::EquivalentNonConstIterator & i)
{
- return i == static_cast<const BaseImpl *>(other)->i;
+ return typename Traits_::UnderlyingIterator(
+ i.template underlying_iterator<typename WrappedForwardIteratorTraits<
+ typename WrappedForwardIteratorTraits<Tag_>::EquivalentNonConstIterator::Tag
+ >::UnderlyingIterator>()
+ );
}
- void * underlying_iterator_ptr()
+ static typename WrappedForwardIteratorTraits<Tag_>::UnderlyingIterator get_iter(const Iter_ & i)
{
- return &i;
+ return real_get_iter<WrappedForwardIteratorTraits<Tag_> >(i);
}
+ };
- const void * underlying_iterator_ptr() const
+ template <typename Tag_, typename Value_>
+ struct WrappedForwardIteratorGetBase<Tag_, Value_, WrappedForwardIterator<Tag_, Value_> >
+ {
+ static WrappedForwardIterator<Tag_, Value_> get_iter(const WrappedForwardIterator<Tag_, Value_> & i)
{
- return &i;
+ return i.template underlying_iterator<typename WrappedForwardIteratorTraits<Tag_>::UnderlyingIterator>();
}
};
- template <typename Tag_, typename Value_>
- WrappedForwardIterator<Tag_, Value_>::WrappedForwardIterator() :
- _base(0)
+ template <typename LHS_, typename RHS_>
+ void set_wrapped_forward_iterator_iterator(LHS_ & lhs, RHS_ rhs)
{
+ lhs = rhs;
}
template <typename Tag_, typename Value_>
- WrappedForwardIterator<Tag_, Value_>::~WrappedForwardIterator()
+ template <typename T_>
+ WrappedForwardIterator<Tag_, Value_>::WrappedForwardIterator(const T_ & iter) :
+ _iter(wrapped_underlying_iterator_hide_real_type(*this, new typename WrappedForwardIteratorTraits<Tag_>::UnderlyingIterator))
{
- delete _base;
+ set_wrapped_forward_iterator_iterator(
+ *wrapped_underlying_iterator_real_type(*this, _iter),
+ WrappedForwardIteratorGetBase<Tag_, Value_, T_>::get_iter(iter));
}
template <typename Tag_, typename Value_>
WrappedForwardIterator<Tag_, Value_>::WrappedForwardIterator(const WrappedForwardIterator & other) :
- _base(other._base ? other._base->clone() : other._base)
- {
- }
-
- template <typename Tag_, typename Value_>
- template <typename T_>
- WrappedForwardIterator<Tag_, Value_>::WrappedForwardIterator(const T_ & base) :
- _base(new BaseImpl<T_>(base))
+ _iter(wrapped_underlying_iterator_hide_real_type(*this, new typename WrappedForwardIteratorTraits<Tag_>::UnderlyingIterator(
+ *wrapped_underlying_iterator_real_type(other, other._iter))))
{
}
template <typename Tag_, typename Value_>
WrappedForwardIterator<Tag_, Value_> &
- WrappedForwardIterator<Tag_, Value_>::operator= (const WrappedForwardIterator<Tag_, Value_> & other)
+ WrappedForwardIterator<Tag_, Value_>::operator= (const WrappedForwardIterator & other)
{
- if (this != &other)
- _base = other._base ? other._base->clone() : other._base;
+ *wrapped_underlying_iterator_real_type(*this, _iter) = *wrapped_underlying_iterator_real_type(other, other._iter);
return *this;
}
@@ -126,7 +122,7 @@ namespace paludis
WrappedForwardIterator<Tag_, Value_> &
WrappedForwardIterator<Tag_, Value_>::operator++ ()
{
- _base->increment();
+ ++*wrapped_underlying_iterator_real_type(*this, _iter);
return *this;
}
@@ -135,7 +131,7 @@ namespace paludis
WrappedForwardIterator<Tag_, Value_>::operator++ (int)
{
WrappedForwardIterator result(*this);
- _base->increment();
+ operator++ ();
return result;
}
@@ -143,40 +139,37 @@ namespace paludis
typename WrappedForwardIterator<Tag_, Value_>::pointer
WrappedForwardIterator<Tag_, Value_>::operator-> () const
{
- return _base->pointer();
+ return wrapped_underlying_iterator_real_type(*this, _iter)->operator-> ();
}
template <typename Tag_, typename Value_>
typename WrappedForwardIterator<Tag_, Value_>::reference
WrappedForwardIterator<Tag_, Value_>::operator* () const
{
- return _base->reference();
+ return wrapped_underlying_iterator_real_type(*this, _iter)->operator* ();
}
template <typename Tag_, typename Value_>
bool
WrappedForwardIterator<Tag_, Value_>::operator== (const WrappedForwardIterator & other) const
{
- if (! _base)
- return ! other._base;
-
- return _base->equal(other._base);
+ return *wrapped_underlying_iterator_real_type(*this, _iter) == *wrapped_underlying_iterator_real_type(other, other._iter);
}
template <typename Tag_, typename Value_>
- template <typename Iter_>
- Iter_ &
+ template <typename T_>
+ T_ &
WrappedForwardIterator<Tag_, Value_>::underlying_iterator()
{
- return *static_cast<Iter_ *>(_base->underlying_iterator_ptr());
+ return *wrapped_underlying_iterator_real_type(*this, _iter);
}
template <typename Tag_, typename Value_>
- template <typename Iter_>
- const Iter_ &
+ template <typename T_>
+ const T_ &
WrappedForwardIterator<Tag_, Value_>::underlying_iterator() const
{
- return *static_cast<const Iter_ *>(_base->underlying_iterator_ptr());
+ return *wrapped_underlying_iterator_real_type(*this, _iter);
}
}
diff --git a/paludis/util/wrapped_forward_iterator.hh b/paludis/util/wrapped_forward_iterator.hh
index 9b6bca6..bf0eac5 100644
--- a/paludis/util/wrapped_forward_iterator.hh
+++ b/paludis/util/wrapped_forward_iterator.hh
@@ -41,12 +41,11 @@ namespace paludis
public equality_operators::HasEqualityOperators
{
private:
- struct Base;
- template <typename T_> struct BaseImpl;
-
- Base * _base;
+ WrappedForwardIteratorUnderlyingIteratorHolder * _iter;
public:
+ typedef Tag_ Tag;
+
///\name Basic operations
///\{
diff --git a/paludis/util/wrapped_forward_iterator_TEST.cc b/paludis/util/wrapped_forward_iterator_TEST.cc
index 9a8af56..53aef37 100644
--- a/paludis/util/wrapped_forward_iterator_TEST.cc
+++ b/paludis/util/wrapped_forward_iterator_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -28,6 +28,15 @@
using namespace test;
using namespace paludis;
+namespace paludis
+{
+ template <>
+ struct WrappedForwardIteratorTraits<void>
+ {
+ typedef std::list<int>::iterator UnderlyingIterator;
+ };
+}
+
namespace test_cases
{
struct WrappedForwardIteratorTest : TestCase
diff --git a/paludis/version_spec.cc b/paludis/version_spec.cc
index 5957ef8..2eab8e1 100644
--- a/paludis/version_spec.cc
+++ b/paludis/version_spec.cc
@@ -77,6 +77,12 @@ namespace paludis
}
};
+ template <>
+ struct WrappedForwardIteratorTraits<VersionSpec::ConstIteratorTag>
+ {
+ typedef Parts::const_iterator UnderlyingIterator;
+ };
+
simple_parser::SimpleParserExpression make_dash_parse_expression(const std::string & strict_dash,
const std::string & text,
const bool ignore_case,
diff --git a/python/dep_spec.cc b/python/dep_spec.cc
index e9126db..3b1b409 100644
--- a/python/dep_spec.cc
+++ b/python/dep_spec.cc
@@ -28,13 +28,17 @@
#include <paludis/environment.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/version_requirements.hh>
-#include <paludis/util/clone-impl.hh>
-#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/save.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/clone-impl.hh>
+#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_output_iterator-impl.hh>
+#include <paludis/util/sequence-impl.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
+
#include <tr1/type_traits>
#include <list>
@@ -42,9 +46,6 @@ using namespace paludis;
using namespace paludis::python;
namespace bp = boost::python;
-template class WrappedForwardIterator<PythonCompositeDepSpec::ConstIteratorTag,
- const std::tr1::shared_ptr<const PythonDepSpec> >;
-
PythonDepSpec::PythonDepSpec()
{
}
@@ -73,6 +74,12 @@ namespace paludis
std::list<std::tr1::shared_ptr<const PythonDepSpec> > children;
};
+ template <>
+ struct WrappedForwardIteratorTraits<PythonCompositeDepSpec::ConstIteratorTag>
+ {
+ typedef std::list<std::tr1::shared_ptr<const PythonDepSpec> >::const_iterator UnderlyingIterator;
+ };
+
template<>
struct Implementation<PythonPackageDepSpec>
{
@@ -1391,3 +1398,6 @@ void expose_dep_spec()
;
}
+template class WrappedForwardIterator<PythonCompositeDepSpec::ConstIteratorTag,
+ const std::tr1::shared_ptr<const PythonDepSpec> >;
+
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
index bd2b071..d5205b0 100644
--- a/ruby/dep_spec.cc
+++ b/ruby/dep_spec.cc
@@ -29,6 +29,7 @@
#include <paludis/util/options.hh>
#include <paludis/util/save.hh>
#include <paludis/util/member_iterator-impl.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <list>
#include <ruby.h>
diff --git a/ruby/paludis_ruby.cc b/ruby/paludis_ruby.cc
index 0301fa4..7eca224 100644
--- a/ruby/paludis_ruby.cc
+++ b/ruby/paludis_ruby.cc
@@ -18,12 +18,17 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/paludis.hh>
#include <paludis_ruby.hh>
#include <paludis/util/config_file.hh>
-#include <paludis/dep_list_exceptions.hh>
-#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/dep_list_exceptions.hh>
+#include <paludis/match_package.hh>
+#include <paludis/version_spec.hh>
+#include <paludis/version_operator.hh>
+#include <paludis/about.hh>
+#include <paludis/user_dep_spec.hh>
+#include <paludis/action.hh>
#include <ruby.h>
#include <list>
#include <ctype.h>
diff --git a/src/clients/adjutrix/find_insecure_packages.cc b/src/clients/adjutrix/find_insecure_packages.cc
index 452d213..9c4a3e3 100644
--- a/src/clients/adjutrix/find_insecure_packages.cc
+++ b/src/clients/adjutrix/find_insecure_packages.cc
@@ -31,6 +31,7 @@
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/selection.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <set>
#include <map>
diff --git a/src/clients/adjutrix/find_reverse_deps.cc b/src/clients/adjutrix/find_reverse_deps.cc
index e666096..0536f54 100644
--- a/src/clients/adjutrix/find_reverse_deps.cc
+++ b/src/clients/adjutrix/find_reverse_deps.cc
@@ -26,6 +26,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/dep_spec.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/package_id.hh>
diff --git a/src/clients/adjutrix/what_needs_keywording.cc b/src/clients/adjutrix/what_needs_keywording.cc
index b2c281e..53ea085 100644
--- a/src/clients/adjutrix/what_needs_keywording.cc
+++ b/src/clients/adjutrix/what_needs_keywording.cc
@@ -26,7 +26,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/iterator_funcs.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/dep_list_exceptions.hh>
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index 5467f34..43be03f 100644
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -36,6 +36,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_shared_copy.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/resolver/resolutions.hh>
#include <paludis/resolver/reason.hh>
#include <paludis/resolver/sanitised_dependencies.hh>
diff --git a/src/clients/cave/cmd_print_id_executables.cc b/src/clients/cave/cmd_print_id_executables.cc
index fcc3fd9..822821d 100644
--- a/src/clients/cave/cmd_print_id_executables.cc
+++ b/src/clients/cave/cmd_print_id_executables.cc
@@ -33,7 +33,7 @@
#include <paludis/selection.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/util/fs_entry.hh>
-#include <paludis/util/indirect_iterator.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
diff --git a/src/clients/cave/cmd_resolve.cc b/src/clients/cave/cmd_resolve.cc
index 550deeb..79e59bd 100644
--- a/src/clients/cave/cmd_resolve.cc
+++ b/src/clients/cave/cmd_resolve.cc
@@ -31,6 +31,8 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/system.hh>
#include <paludis/util/enum_iterator.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/args/do_help.hh>
#include <paludis/args/escape.hh>
#include <paludis/resolver/resolver.hh>
diff --git a/src/clients/cave/cmd_resolve_dump.cc b/src/clients/cave/cmd_resolve_dump.cc
index 6d0e541..df8fbda 100644
--- a/src/clients/cave/cmd_resolve_dump.cc
+++ b/src/clients/cave/cmd_resolve_dump.cc
@@ -33,7 +33,8 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/join.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <iostream>
#include <sstream>
diff --git a/src/clients/cave/command_factory.cc b/src/clients/cave/command_factory.cc
index 7d589b8..26e2fc0 100644
--- a/src/clients/cave/command_factory.cc
+++ b/src/clients/cave/command_factory.cc
@@ -60,6 +60,12 @@ namespace paludis
{
Handlers handlers;
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<CommandFactory::ConstIteratorTag>
+ {
+ typedef FirstIteratorTypes<Handlers::const_iterator>::Type UnderlyingIterator;
+ };
}
namespace
diff --git a/src/clients/inquisitio/key_extractor.cc b/src/clients/inquisitio/key_extractor.cc
index 25c6553..13e2562 100644
--- a/src/clients/inquisitio/key_extractor.cc
+++ b/src/clients/inquisitio/key_extractor.cc
@@ -25,6 +25,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/join.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/stringify_formatter.hh>
diff --git a/src/clients/instruo/instruo.cc b/src/clients/instruo/instruo.cc
index 4bbf64f..a3fdc96 100644
--- a/src/clients/instruo/instruo.cc
+++ b/src/clients/instruo/instruo.cc
@@ -41,6 +41,7 @@
#include <paludis/util/destringify.hh>
#include <paludis/util/safe_ofstream.hh>
#include <paludis/util/pretty_print.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/environments/no_config/no_config_environment.hh>
#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
diff --git a/src/clients/paludis/info.cc b/src/clients/paludis/info.cc
index ab8df99..6eececd 100644
--- a/src/clients/paludis/info.cc
+++ b/src/clients/paludis/info.cc
@@ -28,6 +28,8 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/system.hh>
#include <paludis/util/pretty_print.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/package_database.hh>
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
diff --git a/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc b/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc
index 06cbaa6..7d6ead5 100644
--- a/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc
+++ b/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc
@@ -31,6 +31,7 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/set-impl.hh>
+#include <paludis/util/sequence-impl.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/member_iterator-impl.hh>
@@ -56,12 +57,6 @@
using namespace paludis;
using namespace broken_linkage_finder;
-template class WrappedForwardIterator<BrokenLinkageFinder::BrokenPackageConstIteratorTag,
- const std::tr1::shared_ptr<const paludis::PackageID> >;
-template class WrappedForwardIterator<BrokenLinkageFinder::BrokenFileConstIteratorTag,
- const paludis::FSEntry>;
-template class WrappedForwardIterator<BrokenLinkageFinder::MissingRequirementConstIteratorTag, const std::string>;
-
typedef std::multimap<FSEntry, std::tr1::shared_ptr<const PackageID> > Files;
typedef std::map<FSEntry, std::set<std::string> > PackageBreakage;
typedef std::map<std::tr1::shared_ptr<const PackageID>, PackageBreakage, PackageIDSetComparator> Breakage;
@@ -102,12 +97,30 @@ namespace paludis
{
}
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<BrokenLinkageFinder::BrokenPackageConstIteratorTag>
+ {
+ typedef FirstIteratorTypes<Breakage::const_iterator>::Type UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<BrokenLinkageFinder::BrokenFileConstIteratorTag>
+ {
+ typedef FirstIteratorTypes<PackageBreakage::const_iterator>::Type UnderlyingIterator;
+ };
+
+ template <>
+ struct WrappedForwardIteratorTraits<BrokenLinkageFinder::MissingRequirementConstIteratorTag>
+ {
+ typedef std::set<std::string>::const_iterator UnderlyingIterator;
+ };
}
namespace
{
- std::set<FSEntry> no_files;
- std::set<std::string> no_reqs;
+ const std::map<FSEntry, std::set<std::string> > no_files;
+ const std::set<std::string> no_reqs;
struct ParentOf : std::unary_function<FSEntry, bool>
{
@@ -161,7 +174,7 @@ BrokenLinkageFinder::BrokenLinkageFinder(const Environment * env, const std::str
std::for_each(search_dirs_pruned.begin(), search_dirs_pruned.end(),
std::tr1::bind(&Implementation<BrokenLinkageFinder>::search_directory, _imp.get(), _1));
- for (Configuration::DirsIterator it(_imp->extra_lib_dirs.begin()),
+ for (std::set<FSEntry>::const_iterator it(_imp->extra_lib_dirs.begin()),
it_end(_imp->extra_lib_dirs.end()); it_end != it; ++it)
{
Log::get_instance()->message("reconcilio.broken_linkage_finder.config", ll_debug, lc_context)
@@ -427,3 +440,9 @@ BrokenLinkageFinder::end_missing_requirements(
}
}
+template class WrappedForwardIterator<BrokenLinkageFinder::BrokenPackageConstIteratorTag,
+ const std::tr1::shared_ptr<const paludis::PackageID> >;
+template class WrappedForwardIterator<BrokenLinkageFinder::BrokenFileConstIteratorTag,
+ const paludis::FSEntry>;
+template class WrappedForwardIterator<BrokenLinkageFinder::MissingRequirementConstIteratorTag, const std::string>;
+
diff --git a/src/clients/reconcilio/broken_linkage_finder/configuration.cc b/src/clients/reconcilio/broken_linkage_finder/configuration.cc
index b12ac4a..398eb2e 100644
--- a/src/clients/reconcilio/broken_linkage_finder/configuration.cc
+++ b/src/clients/reconcilio/broken_linkage_finder/configuration.cc
@@ -41,8 +41,6 @@
using namespace paludis;
using namespace broken_linkage_finder;
-template class WrappedForwardIterator<Configuration::DirsIteratorTag, const paludis::FSEntry>;
-
namespace paludis
{
template <>
@@ -59,6 +57,12 @@ namespace paludis
void load_from_etc_ld_so_conf(const FSEntry &);
void add_defaults();
};
+
+ template <>
+ struct WrappedForwardIteratorTraits<Configuration::DirsIteratorTag>
+ {
+ typedef std::vector<FSEntry>::const_iterator UnderlyingIterator;
+ };
}
namespace
@@ -350,3 +354,5 @@ Configuration::lib_is_masked(const std::string & lib) const
return std::binary_search(_imp->ld_library_mask.begin(), _imp->ld_library_mask.end(), lib);
}
+template class WrappedForwardIterator<Configuration::DirsIteratorTag, const paludis::FSEntry>;
+
diff --git a/src/clients/reconcilio/broken_linkage_finder/configuration.hh b/src/clients/reconcilio/broken_linkage_finder/configuration.hh
index b74016f..c8bd7ef 100644
--- a/src/clients/reconcilio/broken_linkage_finder/configuration.hh
+++ b/src/clients/reconcilio/broken_linkage_finder/configuration.hh
@@ -24,7 +24,7 @@
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <string>
@@ -50,5 +50,12 @@ namespace broken_linkage_finder
};
}
+#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
+namespace paludis
+{
+ extern template class WrappedForwardIterator<broken_linkage_finder::Configuration::DirsIteratorTag, const FSEntry>;
+}
+#endif
+
#endif
diff --git a/src/clients/reconcilio/littlelf/elf.cc b/src/clients/reconcilio/littlelf/elf.cc
index 7fc7700..f8aa2fa 100644
--- a/src/clients/reconcilio/littlelf/elf.cc
+++ b/src/clients/reconcilio/littlelf/elf.cc
@@ -50,6 +50,12 @@ namespace paludis
{
std::vector<std::tr1::shared_ptr<Section<ElfType_> > > sections;
};
+
+ template <typename ElfType_>
+ struct WrappedForwardIteratorTraits<ElfObjectSectionIteratorTag<ElfType_> >
+ {
+ typedef IndirectIterator<typename std::vector<std::tr1::shared_ptr<Section<ElfType_> > >::const_iterator> UnderlyingIterator;
+ };
}
enum {
diff --git a/src/clients/reconcilio/littlelf/elf.hh b/src/clients/reconcilio/littlelf/elf.hh
index 1459393..3d2aa9d 100644
--- a/src/clients/reconcilio/littlelf/elf.hh
+++ b/src/clients/reconcilio/littlelf/elf.hh
@@ -39,6 +39,9 @@ class InvalidElfFileError :
};
template <typename ElfType_>
+struct ElfObjectSectionIteratorTag;
+
+template <typename ElfType_>
class ElfObject :
private paludis::PrivateImplementationPattern<ElfObject<ElfType_> >
{
@@ -108,7 +111,7 @@ class ElfObject :
return _hdr.e_shnum;
}
- struct SectionIteratorTag;
+ typedef ElfObjectSectionIteratorTag<ElfType_> SectionIteratorTag;
typedef paludis::WrappedForwardIterator<SectionIteratorTag, Section<ElfType_> > SectionIterator;
SectionIterator section_begin() const;
SectionIterator section_end() const;
diff --git a/src/clients/reconcilio/littlelf/elf_dynamic_section.cc b/src/clients/reconcilio/littlelf/elf_dynamic_section.cc
index 6e0906a..8b0fa0c 100644
--- a/src/clients/reconcilio/littlelf/elf_dynamic_section.cc
+++ b/src/clients/reconcilio/littlelf/elf_dynamic_section.cc
@@ -55,6 +55,12 @@ namespace paludis
{
std::vector<std::tr1::shared_ptr<DynamicEntry<ElfType_> > > dynamic_entries;
};
+
+ template <typename ElfType_>
+ struct WrappedForwardIteratorTraits<DynamicSectionEntryIteratorTag<ElfType_> >
+ {
+ typedef IndirectIterator<typename std::vector<std::tr1::shared_ptr<DynamicEntry<ElfType_> > >::const_iterator> UnderlyingIterator;
+ };
}
namespace littlelf_internals
@@ -354,4 +360,3 @@ template class DynamicSection<Elf64Type>;
template class WrappedForwardIterator<DynamicSection<Elf32Type>::EntryIteratorTag, DynamicEntry<Elf32Type> >;
template class WrappedForwardIterator<DynamicSection<Elf64Type>::EntryIteratorTag, DynamicEntry<Elf64Type> >;
-
diff --git a/src/clients/reconcilio/littlelf/elf_dynamic_section.hh b/src/clients/reconcilio/littlelf/elf_dynamic_section.hh
index d846789..8108c23 100644
--- a/src/clients/reconcilio/littlelf/elf_dynamic_section.hh
+++ b/src/clients/reconcilio/littlelf/elf_dynamic_section.hh
@@ -189,6 +189,9 @@ class DynamicEntries :
};
template <typename ElfType_>
+struct DynamicSectionEntryIteratorTag;
+
+template <typename ElfType_>
class DynamicSection :
public Section<ElfType_>,
public paludis::ImplementAcceptMethods<Section<ElfType_>, DynamicSection<ElfType_> >,
@@ -204,7 +207,7 @@ class DynamicSection :
void resolve_entry_names(Section<ElfType_> &);
- struct EntryIteratorTag;
+ typedef DynamicSectionEntryIteratorTag<ElfType_> EntryIteratorTag;
typedef paludis::WrappedForwardIterator<EntryIteratorTag, DynamicEntry<ElfType_> > EntryIterator;
EntryIterator entry_begin() const;
EntryIterator entry_end() const;
diff --git a/src/clients/reconcilio/littlelf/elf_relocation_section.cc b/src/clients/reconcilio/littlelf/elf_relocation_section.cc
index 096cd89..d7e9d15 100644
--- a/src/clients/reconcilio/littlelf/elf_relocation_section.cc
+++ b/src/clients/reconcilio/littlelf/elf_relocation_section.cc
@@ -39,6 +39,12 @@ namespace paludis
{
std::vector<typename Relocation_::Entry> relocations;
};
+
+ template <typename ElfType_, typename Relocation_>
+ struct WrappedForwardIteratorTraits<RelocationSectionRelocationIteratorTag<ElfType_, Relocation_> >
+ {
+ typedef typename std::vector<typename Relocation_::Entry>::const_iterator UnderlyingIterator;
+ };
}
namespace
diff --git a/src/clients/reconcilio/littlelf/elf_relocation_section.hh b/src/clients/reconcilio/littlelf/elf_relocation_section.hh
index 9ca3a52..1878f71 100644
--- a/src/clients/reconcilio/littlelf/elf_relocation_section.hh
+++ b/src/clients/reconcilio/littlelf/elf_relocation_section.hh
@@ -92,6 +92,9 @@ struct RelocationA
};
template <typename ElfType_, typename Relocation_>
+struct RelocationSectionRelocationIteratorTag;
+
+template <typename ElfType_, typename Relocation_>
class RelocationSection :
public Section<ElfType_>,
public paludis::ImplementAcceptMethods<Section<ElfType_>, RelocationSection<ElfType_, Relocation_> >,
@@ -108,7 +111,7 @@ class RelocationSection :
return Relocation_::type_name;
}
- struct RelocationIteratorTag;
+ typedef RelocationSectionRelocationIteratorTag<ElfType_, Relocation_> RelocationIteratorTag;
typedef paludis::WrappedForwardIterator<RelocationIteratorTag, const typename Relocation_::Entry> RelocationIterator;
RelocationIterator relocation_begin() const;
RelocationIterator relocation_end() const;
diff --git a/src/clients/reconcilio/littlelf/elf_symbol_section.cc b/src/clients/reconcilio/littlelf/elf_symbol_section.cc
index 14178ce..09e9ce1 100644
--- a/src/clients/reconcilio/littlelf/elf_symbol_section.cc
+++ b/src/clients/reconcilio/littlelf/elf_symbol_section.cc
@@ -44,6 +44,12 @@ namespace paludis
{
std::vector<Symbol<ElfType_> > symbols;
};
+
+ template <typename ElfType_>
+ struct WrappedForwardIteratorTraits<SymbolSectionSymbolIteratorTag<ElfType_> >
+ {
+ typedef typename std::vector<Symbol<ElfType_> >::const_iterator UnderlyingIterator;
+ };
}
namespace
@@ -219,4 +225,3 @@ template class SymbolSection<Elf64Type>;
template class WrappedForwardIterator<SymbolSection<Elf32Type>::SymbolIteratorTag, const Symbol<Elf32Type> >;
template class WrappedForwardIterator<SymbolSection<Elf64Type>::SymbolIteratorTag, const Symbol<Elf64Type> >;
-
diff --git a/src/clients/reconcilio/littlelf/elf_symbol_section.hh b/src/clients/reconcilio/littlelf/elf_symbol_section.hh
index 0a087d9..cefe3fe 100644
--- a/src/clients/reconcilio/littlelf/elf_symbol_section.hh
+++ b/src/clients/reconcilio/littlelf/elf_symbol_section.hh
@@ -75,6 +75,9 @@ class Symbol
};
template <typename ElfType_>
+struct SymbolSectionSymbolIteratorTag;
+
+template <typename ElfType_>
class SymbolSection :
public Section<ElfType_>,
public paludis::ImplementAcceptMethods<Section<ElfType_>, SymbolSection<ElfType_> >,
@@ -96,7 +99,7 @@ class SymbolSection :
void resolve_symbols(Section<ElfType_> &);
- struct SymbolIteratorTag;
+ typedef SymbolSectionSymbolIteratorTag<ElfType_> SymbolIteratorTag;
typedef paludis::WrappedForwardIterator<SymbolIteratorTag, const Symbol<ElfType_ > > SymbolIterator;
SymbolIterator symbol_begin() const;
SymbolIterator symbol_end() const;
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index d5d54ef..c71feed 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -28,7 +28,6 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/join.hh>
-#include <paludis/util/set-impl.hh>
#include <paludis/util/safe_ofstream.hh>
#include <paludis/util/system.hh>
#include <paludis/util/iterator_funcs.hh>
@@ -37,7 +36,7 @@
#include <paludis/util/pretty_print.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/indirect_iterator.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/action.hh>
#include <paludis/repository.hh>
#include <paludis/package_database.hh>
diff --git a/src/output/console_query_task.cc b/src/output/console_query_task.cc
index 1976d79..468694d 100644
--- a/src/output/console_query_task.cc
+++ b/src/output/console_query_task.cc
@@ -27,10 +27,11 @@
#include <paludis/util/map-impl.hh>
#include <paludis/util/join.hh>
#include <paludis/util/strip.hh>
-#include <paludis/util/sequence.hh>
+#include <paludis/util/sequence-impl.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/pretty_print.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/package_dep_spec_properties.hh>
#include <paludis/mask.hh>
#include <paludis/metadata_key.hh>
@@ -47,8 +48,6 @@
using namespace paludis;
-template class Map<char, std::string>;
-
namespace paludis
{
template<>
@@ -954,3 +953,6 @@ ConsoleQueryTask::masks_to_explain() const
return _imp->masks_to_explain;
}
+template class Map<char, std::string>;
+template class WrappedForwardIterator<Map<char, std::string>::ConstIteratorTag, const std::pair<const char, std::string> >;
+