aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-22 09:21:59 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-22 18:54:47 +0100
commit34700872057c99c57416612fbc264c48cfd38f9d (patch)
tree044975f3c70d18160b5a431f71fad75dbe16af88
parent801afbbaf5570b96b4717147b3d7f6ff93454c8d (diff)
downloadpaludis-34700872057c99c57416612fbc264c48cfd38f9d.tar.gz
paludis-34700872057c99c57416612fbc264c48cfd38f9d.tar.xz
Kill NonCopyable, make Singleton its own thing
-rw-r--r--.gitignore2
-rw-r--r--doc/api/cplusplus/examples/example_command_line.cc2
-rw-r--r--doc/api/cplusplus/examples/example_command_line.hh4
-rw-r--r--paludis/about_metadata.cc4
-rw-r--r--paludis/about_metadata.hh8
-rw-r--r--paludis/args/args_group.hh7
-rw-r--r--paludis/args/args_handler.hh6
-rw-r--r--paludis/broken_linkage_configuration.hh13
-rw-r--r--paludis/broken_linkage_finder.hh7
-rw-r--r--paludis/comma_separated_dep_parser.hh6
-rw-r--r--paludis/contents.cc4
-rw-r--r--paludis/contents.hh6
-rw-r--r--paludis/dep_label.cc5
-rw-r--r--paludis/dep_label.hh14
-rw-r--r--paludis/dep_list.hh5
-rw-r--r--paludis/dep_spec.hh12
-rw-r--r--paludis/dep_spec_flattener.hh6
-rw-r--r--paludis/dep_tag.cc6
-rw-r--r--paludis/dep_tag.hh18
-rw-r--r--paludis/distribution-impl.hh1
-rw-r--r--paludis/distribution.cc5
-rw-r--r--paludis/distribution.hh12
-rw-r--r--paludis/environment.hh6
-rw-r--r--paludis/environment_factory.cc6
-rw-r--r--paludis/environment_factory.hh8
-rw-r--r--paludis/environments/no_config/no_config_environment.hh3
-rw-r--r--paludis/environments/paludis/extra_distribution_data.cc4
-rw-r--r--paludis/environments/paludis/keywords_conf.hh9
-rw-r--r--paludis/environments/paludis/licenses_conf.hh9
-rw-r--r--paludis/environments/paludis/mirrors_conf.hh9
-rw-r--r--paludis/environments/paludis/output_conf.hh7
-rw-r--r--paludis/environments/paludis/package_mask_conf.hh9
-rw-r--r--paludis/environments/paludis/paludis_config.hh1
-rw-r--r--paludis/environments/paludis/paludis_environment.hh1
-rw-r--r--paludis/environments/paludis/use_conf.hh9
-rw-r--r--paludis/find_unused_packages_task.hh7
-rw-r--r--paludis/hooker.hh17
-rw-r--r--paludis/install_task.hh7
-rw-r--r--paludis/linkage_checker.hh7
-rw-r--r--paludis/metadata_key.hh8
-rw-r--r--paludis/output_manager.hh8
-rw-r--r--paludis/output_manager_factory.cc4
-rw-r--r--paludis/output_manager_factory.hh9
-rw-r--r--paludis/package_database.hh7
-rw-r--r--paludis/report_task.hh7
-rw-r--r--paludis/repositories/e/dep_parser.hh1
-rw-r--r--paludis/repositories/e/e_repository.cc7
-rw-r--r--paludis/repositories/e/e_repository_news.hh9
-rw-r--r--paludis/repositories/e/e_repository_sets.hh8
-rw-r--r--paludis/repositories/e/eapi.cc4
-rw-r--r--paludis/repositories/e/eapi.hh6
-rw-r--r--paludis/repositories/e/ebuild.hh25
-rw-r--r--paludis/repositories/e/extra_distribution_data.cc2
-rw-r--r--paludis/repositories/e/layout.cc6
-rw-r--r--paludis/repositories/e/layout.hh7
-rw-r--r--paludis/repositories/e/memoised_hashes.cc4
-rw-r--r--paludis/repositories/e/memoised_hashes.hh8
-rw-r--r--paludis/repositories/e/metadata_xml.cc4
-rw-r--r--paludis/repositories/e/metadata_xml.hh8
-rw-r--r--paludis/repositories/e/profile.hh6
-rw-r--r--paludis/repositories/e/use_desc.hh9
-rw-r--r--paludis/repositories/e/xml_things_handle.cc4
-rw-r--r--paludis/repositories/e/xml_things_handle.hh8
-rw-r--r--paludis/repositories/fake/fake_repository_base.cc3
-rw-r--r--paludis/repositories/gems/extra_distribution_data.cc4
-rw-r--r--paludis/repositories/gems/yaml.cc6
-rw-r--r--paludis/repositories/gems/yaml.hh6
-rw-r--r--paludis/repository.cc1
-rw-r--r--paludis/repository.hh6
-rw-r--r--paludis/repository_factory.cc4
-rw-r--r--paludis/repository_factory.hh8
-rw-r--r--paludis/selection_handler.cc3
-rw-r--r--paludis/selection_handler.hh9
-rw-r--r--paludis/selinux/security_context.cc10
-rw-r--r--paludis/selinux/security_context.hh11
-rw-r--r--paludis/set_file.hh5
-rw-r--r--paludis/sync_task.hh9
-rw-r--r--paludis/syncer.hh6
-rw-r--r--paludis/uninstall_list.hh7
-rw-r--r--paludis/uninstall_task.hh9
-rw-r--r--paludis/util/channel.hh10
-rw-r--r--paludis/util/config_file.hh1
-rw-r--r--paludis/util/elf_dynamic_section.cc2
-rw-r--r--paludis/util/elf_dynamic_section.hh42
-rw-r--r--paludis/util/files.m42
-rw-r--r--paludis/util/graph.hh1
-rw-r--r--paludis/util/instantiation_policy.hh163
-rw-r--r--paludis/util/log.cc6
-rw-r--r--paludis/util/log.hh12
-rw-r--r--paludis/util/map.hh7
-rw-r--r--paludis/util/sequence.hh10
-rw-r--r--paludis/util/set.hh7
-rw-r--r--paludis/util/singleton-impl.hh (renamed from paludis/util/instantiation_policy-impl.hh)24
-rw-r--r--paludis/util/singleton.hh84
-rw-r--r--paludis/util/singleton_TEST.cc (renamed from paludis/util/instantiation_policy_TEST.cc)27
-rw-r--r--paludis/util/tokeniser.hh3
-rw-r--r--paludis/version_operator.hh3
-rw-r--r--python/dep_spec.hh16
-rw-r--r--python/exception.cc4
-rw-r--r--python/exception.hh6
-rw-r--r--ruby/paludis_ruby.cc6
-rw-r--r--ruby/paludis_ruby.hh11
-rw-r--r--src/clients/accerso/command_line.cc6
-rw-r--r--src/clients/accerso/command_line.hh8
-rw-r--r--src/clients/adjutrix/command_line.cc4
-rw-r--r--src/clients/adjutrix/command_line.hh8
-rw-r--r--src/clients/appareo/command_line.cc4
-rw-r--r--src/clients/appareo/command_line.hh8
-rw-r--r--src/clients/cave/cmd_match.cc4
-rw-r--r--src/clients/cave/command_factory.cc4
-rw-r--r--src/clients/cave/command_factory.hh8
-rw-r--r--src/clients/importare/command_line.cc6
-rw-r--r--src/clients/importare/command_line.hh8
-rw-r--r--src/clients/inquisitio/command_line.cc4
-rw-r--r--src/clients/inquisitio/command_line.hh8
-rw-r--r--src/clients/inquisitio/extractor.hh6
-rw-r--r--src/clients/inquisitio/matcher.cc6
-rw-r--r--src/clients/inquisitio/matcher.hh11
-rw-r--r--src/clients/instruo/command_line.cc6
-rw-r--r--src/clients/instruo/command_line.hh8
-rw-r--r--src/clients/paludis/command_line.cc4
-rw-r--r--src/clients/paludis/command_line.hh8
-rw-r--r--src/clients/reconcilio/command_line.cc4
-rw-r--r--src/clients/reconcilio/command_line.hh6
124 files changed, 550 insertions, 584 deletions
diff --git a/.gitignore b/.gitignore
index 3dd6214..7142b13 100644
--- a/.gitignore
+++ b/.gitignore
@@ -443,7 +443,6 @@ paludis-*.*.*.tar.bz2
/paludis/util/fs_entry_TEST
/paludis/util/graph_TEST
/paludis/util/indirect_iterator_TEST
-/paludis/util/instantiation_policy_TEST
/paludis/util/is_file_with_extension_TEST
/paludis/util/iterator_funcs_TEST
/paludis/util/join_TEST
@@ -466,6 +465,7 @@ paludis-*.*.*.tar.bz2
/paludis/util/sha1_TEST
/paludis/util/sha256_TEST
/paludis/util/simple_parser_TEST
+/paludis/util/singleton_TEST
/paludis/util/stringify_TEST
/paludis/util/string_list_stream_TEST
/paludis/util/strip_TEST
diff --git a/doc/api/cplusplus/examples/example_command_line.cc b/doc/api/cplusplus/examples/example_command_line.cc
index b033af7..984fdf6 100644
--- a/doc/api/cplusplus/examples/example_command_line.cc
+++ b/doc/api/cplusplus/examples/example_command_line.cc
@@ -16,7 +16,7 @@ using namespace examples;
using std::cout;
using std::endl;
-template class InstantiationPolicy<CommandLine, instantiation_method::SingletonTag>;
+template class Singleton<CommandLine>;
CommandLine::CommandLine() :
ArgsHandler(),
diff --git a/doc/api/cplusplus/examples/example_command_line.hh b/doc/api/cplusplus/examples/example_command_line.hh
index 6b3c5f5..d66fa7f 100644
--- a/doc/api/cplusplus/examples/example_command_line.hh
+++ b/doc/api/cplusplus/examples/example_command_line.hh
@@ -33,9 +33,9 @@ namespace examples
*/
class CommandLine :
public paludis::args::ArgsHandler,
- public paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>
+ public paludis::Singleton<CommandLine>
{
- friend class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>;
+ friend class paludis::Singleton<CommandLine>;
private:
CommandLine();
diff --git a/paludis/about_metadata.cc b/paludis/about_metadata.cc
index 1646ec2..9e2b365 100644
--- a/paludis/about_metadata.cc
+++ b/paludis/about_metadata.cc
@@ -18,7 +18,7 @@
*/
#include <paludis/about_metadata.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/about.hh>
@@ -83,5 +83,5 @@ AboutMetadata::need_keys_added() const
}
template class PrivateImplementationPattern<AboutMetadata>;
-template class InstantiationPolicy<AboutMetadata, instantiation_method::SingletonTag>;
+template class Singleton<AboutMetadata>;
diff --git a/paludis/about_metadata.hh b/paludis/about_metadata.hh
index 9ec7237..6a1da81 100644
--- a/paludis/about_metadata.hh
+++ b/paludis/about_metadata.hh
@@ -23,7 +23,7 @@
#include <paludis/about_metadata-fwd.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/metadata_key_holder.hh>
/** \file
@@ -43,10 +43,10 @@ namespace paludis
*/
class PALUDIS_VISIBLE AboutMetadata :
private PrivateImplementationPattern<AboutMetadata>,
- public InstantiationPolicy<AboutMetadata, instantiation_method::SingletonTag>,
+ public Singleton<AboutMetadata>,
public MetadataKeyHolder
{
- friend class InstantiationPolicy<AboutMetadata, instantiation_method::SingletonTag>;
+ friend class Singleton<AboutMetadata>;
private:
PrivateImplementationPattern<AboutMetadata>::ImpPtr & _imp;
@@ -59,7 +59,7 @@ namespace paludis
};
extern template class PrivateImplementationPattern<AboutMetadata>;
- extern template class InstantiationPolicy<AboutMetadata, instantiation_method::SingletonTag>;
+ extern template class Singleton<AboutMetadata>;
}
#endif
diff --git a/paludis/args/args_group.hh b/paludis/args/args_group.hh
index c6f25c7..c050c8a 100644
--- a/paludis/args/args_group.hh
+++ b/paludis/args/args_group.hh
@@ -21,7 +21,6 @@
#define PALUDIS_GUARD_ARGS_ARGS_GROUP_HH 1
#include <paludis/args/args_option.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <string>
@@ -49,8 +48,7 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE ArgsGroup :
- private PrivateImplementationPattern<ArgsGroup>,
- private InstantiationPolicy<ArgsGroup, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<ArgsGroup>
{
private:
const std::string _name;
@@ -104,6 +102,9 @@ namespace paludis
~ArgsGroup();
+ ArgsGroup(const ArgsGroup &) = delete;
+ ArgsGroup & operator= (const ArgsGroup &) = delete;
+
///\}
/**
diff --git a/paludis/args/args_handler.hh b/paludis/args/args_handler.hh
index f906670..9890982 100644
--- a/paludis/args/args_handler.hh
+++ b/paludis/args/args_handler.hh
@@ -22,7 +22,6 @@
#include <paludis/args/args_section.hh>
#include <paludis/args/args_group.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/options.hh>
#include <paludis/util/sequence.hh>
@@ -57,7 +56,6 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE ArgsHandler :
- private InstantiationPolicy<ArgsHandler, instantiation_method::NonCopyableTag>,
private PrivateImplementationPattern<ArgsHandler>
{
friend class ArgsSection;
@@ -119,6 +117,10 @@ namespace paludis
virtual ~ArgsHandler();
+ ArgsHandler(const ArgsHandler &) = delete;
+
+ ArgsHandler & operator= (const ArgsHandler &) = delete;
+
///\}
///\name Iterate over our parameters (non - and -- switches and their values)
diff --git a/paludis/broken_linkage_configuration.hh b/paludis/broken_linkage_configuration.hh
index 219efce..07d8807 100644
--- a/paludis/broken_linkage_configuration.hh
+++ b/paludis/broken_linkage_configuration.hh
@@ -22,7 +22,6 @@
#include <paludis/util/attributes.hh>
#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.hh>
@@ -31,21 +30,23 @@
namespace paludis
{
class PALUDIS_VISIBLE BrokenLinkageConfiguration :
- private paludis::PrivateImplementationPattern<BrokenLinkageConfiguration>,
- private paludis::InstantiationPolicy<BrokenLinkageConfiguration, paludis::instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<BrokenLinkageConfiguration>
{
public:
- BrokenLinkageConfiguration(const paludis::FSEntry &);
+ BrokenLinkageConfiguration(const FSEntry &);
~BrokenLinkageConfiguration();
+ BrokenLinkageConfiguration(const BrokenLinkageConfiguration &) = delete;
+ BrokenLinkageConfiguration & operator= (const BrokenLinkageConfiguration &) = delete;
+
struct DirsIteratorTag;
- typedef paludis::WrappedForwardIterator<DirsIteratorTag, const paludis::FSEntry> DirsIterator;
+ typedef WrappedForwardIterator<DirsIteratorTag, const FSEntry> DirsIterator;
DirsIterator begin_search_dirs() const PALUDIS_ATTRIBUTE((warn_unused_result));
DirsIterator end_search_dirs() const PALUDIS_ATTRIBUTE((warn_unused_result));
DirsIterator begin_ld_so_conf() const PALUDIS_ATTRIBUTE((warn_unused_result));
DirsIterator end_ld_so_conf() const PALUDIS_ATTRIBUTE((warn_unused_result));
- bool dir_is_masked(const paludis::FSEntry &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ bool dir_is_masked(const FSEntry &) const PALUDIS_ATTRIBUTE((warn_unused_result));
bool lib_is_masked(const std::string &) const PALUDIS_ATTRIBUTE((warn_unused_result));
};
diff --git a/paludis/broken_linkage_finder.hh b/paludis/broken_linkage_finder.hh
index 8e42416..3db28ba 100644
--- a/paludis/broken_linkage_finder.hh
+++ b/paludis/broken_linkage_finder.hh
@@ -22,7 +22,6 @@
#include <paludis/util/attributes.hh>
#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>
@@ -34,13 +33,15 @@
namespace paludis
{
class PALUDIS_VISIBLE BrokenLinkageFinder :
- private paludis::PrivateImplementationPattern<BrokenLinkageFinder>,
- private paludis::InstantiationPolicy<BrokenLinkageFinder, paludis::instantiation_method::NonCopyableTag>
+ private paludis::PrivateImplementationPattern<BrokenLinkageFinder>
{
public:
BrokenLinkageFinder(const paludis::Environment *, const std::string &);
~BrokenLinkageFinder();
+ BrokenLinkageFinder(const BrokenLinkageFinder &) = delete;
+ BrokenLinkageFinder & operator= (const BrokenLinkageFinder &) = delete;
+
struct BrokenPackageConstIteratorTag;
typedef paludis::WrappedForwardIterator<BrokenPackageConstIteratorTag,
const std::tr1::shared_ptr<const paludis::PackageID>
diff --git a/paludis/comma_separated_dep_parser.hh b/paludis/comma_separated_dep_parser.hh
index e707709..6e5acd8 100644
--- a/paludis/comma_separated_dep_parser.hh
+++ b/paludis/comma_separated_dep_parser.hh
@@ -20,16 +20,16 @@
#ifndef PALUDIS_GUARD_PALUDIS_COMMA_SEPARATED_DEP_PARSER_HH
#define PALUDIS_GUARD_PALUDIS_COMMA_SEPARATED_DEP_PARSER_HH 1
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/spec_tree-fwd.hh>
#include <paludis/environment-fwd.hh>
namespace paludis
{
- class PALUDIS_VISIBLE CommaSeparatedDepParser :
- private InstantiationPolicy<CommaSeparatedDepParser, instantiation_method::NonInstantiableTag>
+ class PALUDIS_VISIBLE CommaSeparatedDepParser
{
public:
+ CommaSeparatedDepParser() = delete;
+
static std::tr1::shared_ptr<const DependencySpecTree> parse(
const Environment * const env, const std::string &);
};
diff --git a/paludis/contents.cc b/paludis/contents.cc
index 9fc3bd4..302ffde 100644
--- a/paludis/contents.cc
+++ b/paludis/contents.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 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
@@ -152,8 +152,6 @@ Contents::end() const
return ConstIterator(_imp->c.end());
}
-template class InstantiationPolicy<Contents, instantiation_method::NonCopyableTag>;
-
template class PrivateImplementationPattern<Contents>;
template class PrivateImplementationPattern<ContentsEntry>;
template class PrivateImplementationPattern<ContentsSymEntry>;
diff --git a/paludis/contents.hh b/paludis/contents.hh
index 2b8f943..ef0878e 100644
--- a/paludis/contents.hh
+++ b/paludis/contents.hh
@@ -22,7 +22,6 @@
#include <paludis/contents-fwd.hh>
#include <paludis/util/simple_visitor.hh>
-#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.hh>
@@ -200,7 +199,6 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE Contents :
- private InstantiationPolicy<Contents, instantiation_method::NonCopyableTag>,
private PrivateImplementationPattern<Contents>
{
public:
@@ -210,6 +208,9 @@ namespace paludis
Contents();
~Contents();
+ Contents(const Contents &) = delete;
+ Contents & operator= (const Contents &) = delete;
+
///\}
/// Add a new entry.
@@ -230,7 +231,6 @@ namespace paludis
///\}
};
- extern template class InstantiationPolicy<Contents, instantiation_method::NonCopyableTag>;
extern template class PrivateImplementationPattern<Contents>;
extern template class PrivateImplementationPattern<ContentsEntry>;
extern template class PrivateImplementationPattern<ContentsSymEntry>;
diff --git a/paludis/dep_label.cc b/paludis/dep_label.cc
index 3dec920..a475be7 100644
--- a/paludis/dep_label.cc
+++ b/paludis/dep_label.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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
@@ -98,9 +98,6 @@ ConcreteDependenciesLabel<T_>::enabled() const
return _enabled();
}
-template class InstantiationPolicy<DependenciesLabel, instantiation_method::NonCopyableTag>;
-template class InstantiationPolicy<URILabel, instantiation_method::NonCopyableTag>;
-
template class ConcreteURILabel<URIMirrorsThenListedLabelTag>;
template class ConcreteURILabel<URIMirrorsOnlyLabelTag>;
template class ConcreteURILabel<URIListedOnlyLabelTag>;
diff --git a/paludis/dep_label.hh b/paludis/dep_label.hh
index 31ca7bc..c4bc210 100644
--- a/paludis/dep_label.hh
+++ b/paludis/dep_label.hh
@@ -23,7 +23,6 @@
#include <paludis/dep_label-fwd.hh>
#include <paludis/dep_spec-fwd.hh>
#include <paludis/util/simple_visitor.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/type_list.hh>
@@ -53,7 +52,6 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE URILabel :
- private InstantiationPolicy<URILabel, instantiation_method::NonCopyableTag>,
public virtual DeclareAbstractAcceptMethods<URILabel, MakeTypeList<
URIMirrorsThenListedLabel, URIMirrorsOnlyLabel, URIListedOnlyLabel, URIListedThenMirrorsLabel,
URILocalMirrorsOnlyLabel, URIManualOnlyLabel>::Type>
@@ -62,8 +60,12 @@ namespace paludis
///\name Basic operations
///\{
+ URILabel() = default;
virtual ~URILabel() = 0;
+ URILabel(const URILabel &) = delete;
+ URILabel & operator= (const URILabel &) = delete;
+
///\}
/// Our text.
@@ -107,7 +109,6 @@ namespace paludis
* \ingroup g_dep_spec
*/
class PALUDIS_VISIBLE DependenciesLabel :
- private InstantiationPolicy<DependenciesLabel, instantiation_method::NonCopyableTag>,
public virtual DeclareAbstractAcceptMethods<DependenciesLabel, MakeTypeList<
DependenciesBuildLabel, DependenciesRunLabel, DependenciesPostLabel, DependenciesCompileAgainstLabel,
DependenciesFetchLabel, DependenciesInstallLabel, DependenciesSuggestionLabel,
@@ -117,8 +118,12 @@ namespace paludis
///\name Basic operations
///\{
+ DependenciesLabel() = default;
virtual ~DependenciesLabel() = 0;
+ DependenciesLabel(const DependenciesLabel &) = delete;
+ DependenciesLabel & operator= (const DependenciesLabel &) = delete;
+
///\}
/// Our text.
@@ -159,9 +164,6 @@ namespace paludis
typedef T_ Tag;
};
- extern template class InstantiationPolicy<URILabel, instantiation_method::NonCopyableTag>;
- extern template class InstantiationPolicy<DependenciesLabel, instantiation_method::NonCopyableTag>;
-
extern template class ConcreteURILabel<URIMirrorsThenListedLabelTag>;
extern template class ConcreteURILabel<URIMirrorsOnlyLabelTag>;
extern template class ConcreteURILabel<URIListedOnlyLabelTag>;
diff --git a/paludis/dep_list.hh b/paludis/dep_list.hh
index db3376c..c7fac0b 100644
--- a/paludis/dep_list.hh
+++ b/paludis/dep_list.hh
@@ -29,7 +29,6 @@
#include <paludis/name.hh>
#include <paludis/environment.hh>
#include <paludis/match_package.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/options.hh>
#include <paludis/version_spec.hh>
@@ -148,7 +147,6 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE DepList :
- private InstantiationPolicy<DepList, instantiation_method::NonCopyableTag>,
private PrivateImplementationPattern<DepList>
{
protected:
@@ -222,6 +220,9 @@ namespace paludis
virtual ~DepList();
+ DepList(const DepList &) = delete;
+ DepList & operator= (const DepList &) = delete;
+
///\}
///\name Iterate over our dependency list entries.
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index 8299bdf..b744c3d 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -22,7 +22,6 @@
#include <paludis/util/attributes.hh>
#include <paludis/util/clone.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/fs_entry.hh>
@@ -64,7 +63,6 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE DepSpec :
- private InstantiationPolicy<DepSpec, instantiation_method::NonCopyableTag>,
private PrivateImplementationPattern<DepSpec>,
public MetadataKeyHolder,
public virtual Cloneable<DepSpec>
@@ -81,6 +79,9 @@ namespace paludis
virtual ~DepSpec();
+ DepSpec(const DepSpec &) = delete;
+ DepSpec & operator= (const DepSpec &) = delete;
+
///\}
///\name Upcasts
@@ -277,12 +278,15 @@ namespace paludis
* \since 0.26
* \ingroup g_dep_spec
*/
- class PALUDIS_VISIBLE AdditionalPackageDepSpecRequirement :
- private InstantiationPolicy<AdditionalPackageDepSpecRequirement, instantiation_method::NonCopyableTag>
+ class PALUDIS_VISIBLE AdditionalPackageDepSpecRequirement
{
public:
+ AdditionalPackageDepSpecRequirement() = default;
virtual ~AdditionalPackageDepSpecRequirement();
+ AdditionalPackageDepSpecRequirement(const AdditionalPackageDepSpecRequirement &) = delete;
+ AdditionalPackageDepSpecRequirement & operator= (const AdditionalPackageDepSpecRequirement &) = delete;
+
/**
* Is our requirement met for a given PackageID?
*
diff --git a/paludis/dep_spec_flattener.hh b/paludis/dep_spec_flattener.hh
index c1cd5ee..1fdca56 100644
--- a/paludis/dep_spec_flattener.hh
+++ b/paludis/dep_spec_flattener.hh
@@ -25,7 +25,6 @@
#include <paludis/dep_spec-fwd.hh>
#include <paludis/spec_tree.hh>
#include <paludis/util/attributes.hh>
-#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.hh>
@@ -63,7 +62,6 @@ namespace paludis
*/
template <typename Heirarchy_, typename Item_>
class PALUDIS_VISIBLE DepSpecFlattener :
- private InstantiationPolicy<DepSpecFlattener<Heirarchy_, Item_>, instantiation_method::NonCopyableTag>,
private PrivateImplementationPattern<DepSpecFlattener<Heirarchy_, Item_> >
{
private:
@@ -99,6 +97,10 @@ namespace paludis
~DepSpecFlattener();
+ DepSpecFlattener(const DepSpecFlattener &) = delete;
+
+ DepSpecFlattener & operator= (const DepSpecFlattener &) = delete;
+
///\}
///\name Iterate over our dep specs
diff --git a/paludis/dep_tag.cc b/paludis/dep_tag.cc
index 4b912f8..3ccb733 100644
--- a/paludis/dep_tag.cc
+++ b/paludis/dep_tag.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, 2010 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/dep_label.hh>
#include <paludis/spec_tree.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/util/set-impl.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/indirect_iterator-impl.hh>
@@ -32,7 +32,7 @@
using namespace paludis;
-template class InstantiationPolicy<DepTagCategoryFactory, instantiation_method::SingletonTag>;
+template class Singleton<DepTagCategoryFactory>;
template class Set<DepTagEntry, DepTagEntryComparator>;
template class WrappedForwardIterator<Set<DepTagEntry, DepTagEntryComparator>::ConstIteratorTag, const DepTagEntry>;
diff --git a/paludis/dep_tag.hh b/paludis/dep_tag.hh
index 280e8ed..48f58bc 100644
--- a/paludis/dep_tag.hh
+++ b/paludis/dep_tag.hh
@@ -37,13 +37,13 @@
#include <paludis/name-fwd.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/spec_tree-fwd.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/simple_visitor.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/named_value.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/operators.hh>
#include <paludis/util/type_list.hh>
+#include <paludis/util/singleton.hh>
#include <string>
#include <tr1/memory>
@@ -68,8 +68,7 @@ namespace paludis
* \ingroup g_dep_spec
* \nosubgrouping
*/
- class PALUDIS_VISIBLE DepTagCategory :
- private InstantiationPolicy<DepTagCategory, instantiation_method::NonCopyableTag>
+ class PALUDIS_VISIBLE DepTagCategory
{
private:
bool _visible;
@@ -89,6 +88,9 @@ namespace paludis
const std::string & pre,
const std::string & post);
+ DepTagCategory(const DepTagCategory &) = delete;
+ DepTagCategory & operator= (const DepTagCategory &) = delete;
+
///\}
/**
@@ -125,9 +127,9 @@ namespace paludis
* \since 0.30
*/
class PALUDIS_VISIBLE DepTagCategoryFactory :
- public InstantiationPolicy<DepTagCategoryFactory, instantiation_method::SingletonTag>
+ public Singleton<DepTagCategoryFactory>
{
- friend class InstantiationPolicy<DepTagCategoryFactory, instantiation_method::SingletonTag>;
+ friend class Singleton<DepTagCategoryFactory>;
private:
DepTagCategoryFactory();
@@ -148,7 +150,6 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE DepTag :
- private InstantiationPolicy<DepTag, instantiation_method::NonCopyableTag>,
public relational_operators::HasRelationalOperators,
public virtual DeclareAbstractAcceptMethods<DepTag, MakeTypeList<
GLSADepTag, GeneralSetDepTag, DependencyDepTag, TargetDepTag>::Type>
@@ -162,6 +163,9 @@ namespace paludis
public:
virtual ~DepTag();
+ DepTag(const DepTag &) = delete;
+ DepTag & operator= (const DepTag &) = delete;
+
///\}
/**
@@ -349,7 +353,7 @@ namespace paludis
bool operator() (const DepTagEntry &, const DepTagEntry &) const PALUDIS_ATTRIBUTE((warn_unused_result));
};
- extern template class InstantiationPolicy<DepTagCategoryFactory, instantiation_method::SingletonTag>;
+ extern template class Singleton<DepTagCategoryFactory>;
extern template class PrivateImplementationPattern<DependencyDepTag>;
extern template class PrivateImplementationPattern<GeneralSetDepTag>;
diff --git a/paludis/distribution-impl.hh b/paludis/distribution-impl.hh
index 6f38af4..9034367 100644
--- a/paludis/distribution-impl.hh
+++ b/paludis/distribution-impl.hh
@@ -25,7 +25,6 @@
#include <paludis/util/hashes.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/options.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <tr1/unordered_map>
diff --git a/paludis/distribution.cc b/paludis/distribution.cc
index 49ed006..d21faa9 100644
--- a/paludis/distribution.cc
+++ b/paludis/distribution.cc
@@ -25,16 +25,17 @@
#include <paludis/util/system.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/strip.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/singleton-impl.hh>
#include <tr1/unordered_map>
using namespace paludis;
-template class InstantiationPolicy<DistributionData, instantiation_method::SingletonTag>;
+template class Singleton<DistributionData>;
DistributionConfigurationError::DistributionConfigurationError(const std::string & s) throw () :
ConfigurationError("Distribution configuration error: " + s)
diff --git a/paludis/distribution.hh b/paludis/distribution.hh
index 37f8860..00b2c1e 100644
--- a/paludis/distribution.hh
+++ b/paludis/distribution.hh
@@ -24,9 +24,9 @@
#include <paludis/util/attributes.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/named_value.hh>
#include <paludis/util/fs_entry.hh>
+#include <paludis/util/singleton.hh>
#include <tr1/memory>
/** \file
@@ -114,9 +114,9 @@ namespace paludis
*/
class PALUDIS_VISIBLE DistributionData :
private PrivateImplementationPattern<DistributionData>,
- public InstantiationPolicy<DistributionData, instantiation_method::SingletonTag>
+ public Singleton<DistributionData>
{
- friend class InstantiationPolicy<DistributionData, instantiation_method::SingletonTag>;
+ friend class Singleton<DistributionData>;
private:
DistributionData();
@@ -141,9 +141,9 @@ namespace paludis
template <typename Data_>
class PALUDIS_VISIBLE ExtraDistributionData :
private PrivateImplementationPattern<ExtraDistributionData<Data_> >,
- public InstantiationPolicy<ExtraDistributionData<Data_>, instantiation_method::SingletonTag>
+ public Singleton<ExtraDistributionData<Data_> >
{
- friend class InstantiationPolicy<ExtraDistributionData<Data_>, instantiation_method::SingletonTag>;
+ friend class Singleton<ExtraDistributionData<Data_> >;
private:
ExtraDistributionData();
@@ -157,6 +157,8 @@ namespace paludis
const Distribution &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
};
+
+ extern template class Singleton<DistributionData>;
}
#endif
diff --git a/paludis/environment.hh b/paludis/environment.hh
index bc1f2a5..526fa1c 100644
--- a/paludis/environment.hh
+++ b/paludis/environment.hh
@@ -21,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENT_HH 1
#include <paludis/environment-fwd.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/options-fwd.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/tribool-fwd.hh>
@@ -76,15 +75,18 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE Environment :
- private InstantiationPolicy<Environment, instantiation_method::NonCopyableTag>,
public MetadataKeyHolder
{
public:
///\name Basic operations
///\{
+ Environment() = default;
virtual ~Environment() = 0;
+ Environment(const Environment &) = delete;
+ Environment & operator= (const Environment &) = delete;
+
///\}
///\name Choice-related queries
diff --git a/paludis/environment_factory.cc b/paludis/environment_factory.cc
index 0f2c9b5..a1ab753 100644
--- a/paludis/environment_factory.cc
+++ b/paludis/environment_factory.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 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
@@ -18,7 +18,7 @@
*/
#include <paludis/environment_factory.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/system.hh>
#include <paludis/util/member_iterator-impl.hh>
@@ -144,6 +144,6 @@ EnvironmentFactory::add_environment_format(
}
}
-template class InstantiationPolicy<EnvironmentFactory, instantiation_method::SingletonTag>;
+template class Singleton<EnvironmentFactory>;
template class PrivateImplementationPattern<EnvironmentFactory>;
diff --git a/paludis/environment_factory.hh b/paludis/environment_factory.hh
index a0ef29c..98065b1 100644
--- a/paludis/environment_factory.hh
+++ b/paludis/environment_factory.hh
@@ -22,11 +22,11 @@
#include <paludis/environment_factory-fwd.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/set-fwd.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/no_type.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/environment-fwd.hh>
#include <tr1/memory>
#include <tr1/functional>
@@ -45,9 +45,9 @@ namespace paludis
*/
class PALUDIS_VISIBLE EnvironmentFactory :
private PrivateImplementationPattern<EnvironmentFactory>,
- public InstantiationPolicy<EnvironmentFactory, instantiation_method::SingletonTag>
+ public Singleton<EnvironmentFactory>
{
- friend class InstantiationPolicy<EnvironmentFactory, instantiation_method::SingletonTag>;
+ friend class Singleton<EnvironmentFactory>;
private:
EnvironmentFactory();
@@ -91,7 +91,7 @@ namespace paludis
void register_environment(const EnvironmentClass_ * const, EnvironmentFactory * const);
extern template class PrivateImplementationPattern<EnvironmentFactory>;
- extern template class InstantiationPolicy<EnvironmentFactory, instantiation_method::SingletonTag>;
+ extern template class Singleton<EnvironmentFactory>;
}
#endif
diff --git a/paludis/environments/no_config/no_config_environment.hh b/paludis/environments/no_config/no_config_environment.hh
index 5ee30f9..cda582e 100644
--- a/paludis/environments/no_config/no_config_environment.hh
+++ b/paludis/environments/no_config/no_config_environment.hh
@@ -84,8 +84,7 @@ namespace paludis
*/
class PALUDIS_VISIBLE NoConfigEnvironment :
public EnvironmentImplementation,
- private PrivateImplementationPattern<NoConfigEnvironment>,
- private InstantiationPolicy<NoConfigEnvironment, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<NoConfigEnvironment>
{
private:
PrivateImplementationPattern<NoConfigEnvironment>::ImpPtr & _imp;
diff --git a/paludis/environments/paludis/extra_distribution_data.cc b/paludis/environments/paludis/extra_distribution_data.cc
index cffe8ea..6c26eb0 100644
--- a/paludis/environments/paludis/extra_distribution_data.cc
+++ b/paludis/environments/paludis/extra_distribution_data.cc
@@ -21,6 +21,7 @@
#include <paludis/util/destringify.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/distribution-impl.hh>
using namespace paludis;
@@ -58,6 +59,5 @@ namespace paludis
}
template class ExtraDistributionData<PaludisDistribution>;
-template class InstantiationPolicy<ExtraDistributionData<PaludisDistribution>, instantiation_method::SingletonTag>;
-
+template class Singleton<ExtraDistributionData<PaludisDistribution>>;
diff --git a/paludis/environments/paludis/keywords_conf.hh b/paludis/environments/paludis/keywords_conf.hh
index c15f00c..ee736bb 100644
--- a/paludis/environments/paludis/keywords_conf.hh
+++ b/paludis/environments/paludis/keywords_conf.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010 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,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENTS_PALUDIS_KEYWORDS_CONF_HH 1
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/name-fwd.hh>
#include <paludis/package_id-fwd.hh>
@@ -39,8 +38,7 @@ namespace paludis
* \nosubgrouping
*/
class KeywordsConf :
- private PrivateImplementationPattern<KeywordsConf>,
- private InstantiationPolicy<KeywordsConf, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<KeywordsConf>
{
public:
///\name Basic operations
@@ -49,6 +47,9 @@ namespace paludis
KeywordsConf(const PaludisEnvironment * const);
~KeywordsConf();
+ KeywordsConf(const KeywordsConf &) = delete;
+ KeywordsConf & operator= (const KeywordsConf &) = delete;
+
///\}
/**
diff --git a/paludis/environments/paludis/licenses_conf.hh b/paludis/environments/paludis/licenses_conf.hh
index c92adf2..126462d 100644
--- a/paludis/environments/paludis/licenses_conf.hh
+++ b/paludis/environments/paludis/licenses_conf.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2010 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,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_PALUDIS_ENVIRONMENTS_PALUDIS_LICENSES_CONF_HH 1
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/name-fwd.hh>
#include <paludis/package_id-fwd.hh>
@@ -39,8 +38,7 @@ namespace paludis
* \nosubgrouping
*/
class LicensesConf :
- private PrivateImplementationPattern<LicensesConf>,
- private InstantiationPolicy<LicensesConf, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<LicensesConf>
{
public:
///\name Basic operations
@@ -49,6 +47,9 @@ namespace paludis
LicensesConf(const PaludisEnvironment * const);
~LicensesConf();
+ LicensesConf(const LicensesConf &) = delete;
+ LicensesConf & operator= (const LicensesConf &) = delete;
+
///\}
/**
diff --git a/paludis/environments/paludis/mirrors_conf.hh b/paludis/environments/paludis/mirrors_conf.hh
index 8352ae2..408ae25 100644
--- a/paludis/environments/paludis/mirrors_conf.hh
+++ b/paludis/environments/paludis/mirrors_conf.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010 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,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENTS_PALUDIS_MIRRORS_CONF_HH 1
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/config_file.hh>
#include <paludis/environment.hh>
#include <paludis/name.hh>
@@ -39,8 +38,7 @@ namespace paludis
* \nosubgrouping
*/
class MirrorsConf :
- private PrivateImplementationPattern<MirrorsConf>,
- private InstantiationPolicy<MirrorsConf, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<MirrorsConf>
{
public:
///\name Basic operations
@@ -49,6 +47,9 @@ namespace paludis
MirrorsConf(const PaludisEnvironment * const);
~MirrorsConf();
+ MirrorsConf(const MirrorsConf &) = delete;
+ MirrorsConf & operator= (const MirrorsConf &) = delete;
+
///\}
/**
diff --git a/paludis/environments/paludis/output_conf.hh b/paludis/environments/paludis/output_conf.hh
index 785273c..8867589 100644
--- a/paludis/environments/paludis/output_conf.hh
+++ b/paludis/environments/paludis/output_conf.hh
@@ -21,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENTS_PALUDIS_OUTPUT_CONF_HH 1
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/output_manager-fwd.hh>
#include <paludis/create_output_manager_info-fwd.hh>
@@ -34,8 +33,7 @@ namespace paludis
namespace paludis_environment
{
class OutputConf :
- private PrivateImplementationPattern<OutputConf>,
- private InstantiationPolicy<OutputConf, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<OutputConf>
{
public:
///\name Basic operations
@@ -44,6 +42,9 @@ namespace paludis
OutputConf(const PaludisEnvironment * const);
~OutputConf();
+ OutputConf(const OutputConf &) = delete;
+ OutputConf & operator= (const OutputConf &) = delete;
+
///\}
/**
diff --git a/paludis/environments/paludis/package_mask_conf.hh b/paludis/environments/paludis/package_mask_conf.hh
index 702dae1..f6e7e1c 100644
--- a/paludis/environments/paludis/package_mask_conf.hh
+++ b/paludis/environments/paludis/package_mask_conf.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2010 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,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENTS_PALUDIS_PACKAGE_MASK_CONF_HH 1
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/name-fwd.hh>
#include <paludis/package_id-fwd.hh>
@@ -40,8 +39,7 @@ namespace paludis
* \nosubgrouping
*/
class PackageMaskConf :
- private PrivateImplementationPattern<PackageMaskConf>,
- private InstantiationPolicy<PackageMaskConf, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<PackageMaskConf>
{
public:
///\name Basic operations
@@ -50,6 +48,9 @@ namespace paludis
PackageMaskConf(const PaludisEnvironment * const);
~PackageMaskConf();
+ PackageMaskConf(const PackageMaskConf &) = delete;
+ PackageMaskConf & operator= (const PackageMaskConf &) = delete;
+
///\}
/**
diff --git a/paludis/environments/paludis/paludis_config.hh b/paludis/environments/paludis/paludis_config.hh
index 0186469..ff7eacf 100644
--- a/paludis/environments/paludis/paludis_config.hh
+++ b/paludis/environments/paludis/paludis_config.hh
@@ -24,7 +24,6 @@
#include <paludis/name.hh>
#include <paludis/environment_factory.hh>
#include <paludis/util/exception.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/sequence-fwd.hh>
#include <paludis/util/map-fwd.hh>
#include <paludis/util/wrapped_forward_iterator-fwd.hh>
diff --git a/paludis/environments/paludis/paludis_environment.hh b/paludis/environments/paludis/paludis_environment.hh
index eb1d1fb..f96c310 100644
--- a/paludis/environments/paludis/paludis_environment.hh
+++ b/paludis/environments/paludis/paludis_environment.hh
@@ -46,7 +46,6 @@ namespace paludis
*/
class PALUDIS_VISIBLE PaludisEnvironment :
public EnvironmentImplementation,
- public InstantiationPolicy<PaludisEnvironment, instantiation_method::SingletonTag>,
private PrivateImplementationPattern<PaludisEnvironment>
{
diff --git a/paludis/environments/paludis/use_conf.hh b/paludis/environments/paludis/use_conf.hh
index 9140718..c3dfb65 100644
--- a/paludis/environments/paludis/use_conf.hh
+++ b/paludis/environments/paludis/use_conf.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_PALUDIS_ENVIRONMENTS_PALUDIS_USE_CONF_HH 1
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/tribool-fwd.hh>
#include <paludis/choice-fwd.hh>
@@ -41,8 +40,7 @@ namespace paludis
* \nosubgrouping
*/
class UseConf :
- private PrivateImplementationPattern<UseConf>,
- private InstantiationPolicy<UseConf, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<UseConf>
{
public:
///\name Basic operations
@@ -51,6 +49,9 @@ namespace paludis
UseConf(const PaludisEnvironment * const);
~UseConf();
+ UseConf(const UseConf &) = delete;
+ UseConf & operator= (const UseConf &) = delete;
+
///\}
/**
diff --git a/paludis/find_unused_packages_task.hh b/paludis/find_unused_packages_task.hh
index 7f5e390..bc1f553 100644
--- a/paludis/find_unused_packages_task.hh
+++ b/paludis/find_unused_packages_task.hh
@@ -20,7 +20,6 @@
#ifndef PALUDIS_GUARD_PALUDIS_FIND_UNUSED_PACKAGES_TASK_HH
#define PALUDIS_GUARD_PALUDIS_FIND_UNUSED_PACKAGES_TASK_HH 1
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/name-fwd.hh>
#include <paludis/environment-fwd.hh>
@@ -44,8 +43,7 @@ namespace paludis
* \ingroup g_tasks
* \nosubgrouping
*/
- class PALUDIS_VISIBLE FindUnusedPackagesTask :
- InstantiationPolicy<FindUnusedPackagesTask, instantiation_method::NonCopyableTag>
+ class PALUDIS_VISIBLE FindUnusedPackagesTask
{
private:
const Environment * const _env;
@@ -63,6 +61,9 @@ namespace paludis
virtual ~FindUnusedPackagesTask();
+ FindUnusedPackagesTask(const FindUnusedPackagesTask &) = delete;
+ FindUnusedPackagesTask & operator= (const FindUnusedPackagesTask &) = delete;
+
///\}
/**
diff --git a/paludis/hooker.hh b/paludis/hooker.hh
index b72fdbc..e167a0e 100644
--- a/paludis/hooker.hh
+++ b/paludis/hooker.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010 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
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_HOOKER_HH
#define PALUDIS_GUARD_PALUDIS_HOOKER_HH 1
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/attributes.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/graph-fwd.hh>
#include <paludis/util/sequence-fwd.hh>
@@ -50,15 +50,18 @@ namespace paludis
* \ingroup g_hooks
* \nosubgrouping
*/
- class PALUDIS_VISIBLE HookFile :
- private InstantiationPolicy<HookFile, instantiation_method::NonCopyableTag>
+ class PALUDIS_VISIBLE HookFile
{
public:
///\name Basic operations
///\{
+ HookFile() = default;
virtual ~HookFile();
+ HookFile(const HookFile &) = delete;
+ HookFile & operator= (const HookFile &) = delete;
+
///\}
virtual HookResult run(const Hook &) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
@@ -74,8 +77,7 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE Hooker :
- private PrivateImplementationPattern<Hooker>,
- private InstantiationPolicy<Hooker, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<Hooker>
{
private:
std::tr1::shared_ptr<Sequence<std::tr1::shared_ptr<HookFile> > > _find_hooks(const Hook &) const;
@@ -87,6 +89,9 @@ namespace paludis
Hooker(const Environment * const) PALUDIS_ATTRIBUTE((nonnull(1)));
~Hooker();
+ Hooker(const Hooker &) = delete;
+ Hooker & operator= (const Hooker &) = delete;
+
///\}
/**
diff --git a/paludis/install_task.hh b/paludis/install_task.hh
index 11172d6..19758ed 100644
--- a/paludis/install_task.hh
+++ b/paludis/install_task.hh
@@ -20,7 +20,6 @@
#ifndef PALUDIS_GUARD_PALUDIS_INSTALL_TASK_HH
#define PALUDIS_GUARD_PALUDIS_INSTALL_TASK_HH 1
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/dep_list.hh>
@@ -54,8 +53,7 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE InstallTask :
- PrivateImplementationPattern<InstallTask>,
- InstantiationPolicy<InstallTask, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<InstallTask>
{
private:
void _execute();
@@ -103,6 +101,9 @@ namespace paludis
virtual ~InstallTask();
+ InstallTask(const InstallTask &) = delete;
+ InstallTask & operator= (const InstallTask &) = delete;
+
///\}
///\name DepList and Install behaviour options
diff --git a/paludis/linkage_checker.hh b/paludis/linkage_checker.hh
index e2ab485..20b6687 100644
--- a/paludis/linkage_checker.hh
+++ b/paludis/linkage_checker.hh
@@ -22,7 +22,6 @@
#include <paludis/broken_linkage_finder.hh>
#include <paludis/util/fs_entry-fwd.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/set-fwd.hh>
#include <paludis/package_id-fwd.hh>
@@ -32,13 +31,15 @@
namespace paludis
{
- class LinkageChecker :
- private paludis::InstantiationPolicy<LinkageChecker, paludis::instantiation_method::NonCopyableTag>
+ class LinkageChecker
{
public:
LinkageChecker();
virtual ~LinkageChecker();
+ LinkageChecker(const LinkageChecker &) = delete;
+ LinkageChecker & operator= (const LinkageChecker &) = delete;
+
virtual bool check_file(const paludis::FSEntry &) PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
virtual void note_symlink(const paludis::FSEntry &, const paludis::FSEntry &) = 0;
diff --git a/paludis/metadata_key.hh b/paludis/metadata_key.hh
index 6d2e9db..6392433 100644
--- a/paludis/metadata_key.hh
+++ b/paludis/metadata_key.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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,7 +33,6 @@
#include <paludis/choice-fwd.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/remove_shared_ptr.hh>
#include <paludis/util/simple_visitor.hh>
#include <paludis/util/type_list.hh>
@@ -85,7 +84,6 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE MetadataKey :
- private InstantiationPolicy<MetadataKey, instantiation_method::NonCopyableTag>,
public virtual DeclareAbstractAcceptMethods<MetadataKey, MakeTypeList<
MetadataCollectionKey<KeywordNameSet>,
MetadataCollectionKey<Set<std::string> >,
@@ -115,8 +113,12 @@ namespace paludis
///\name Basic operations
///\{
+ MetadataKey() = default;
virtual ~MetadataKey() = 0;
+ MetadataKey(const MetadataKey &) = delete;
+ MetadataKey & operator= (const MetadataKey &) = delete;
+
///\}
/**
diff --git a/paludis/output_manager.hh b/paludis/output_manager.hh
index 5edfb31..d938ce9 100644
--- a/paludis/output_manager.hh
+++ b/paludis/output_manager.hh
@@ -22,17 +22,19 @@
#include <paludis/output_manager-fwd.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <iosfwd>
namespace paludis
{
- class PALUDIS_VISIBLE OutputManager :
- private InstantiationPolicy<OutputManager, instantiation_method::NonCopyableTag>
+ class PALUDIS_VISIBLE OutputManager
{
public:
+ OutputManager() = default;
virtual ~OutputManager() = 0;
+ OutputManager(const OutputManager &) = delete;
+ OutputManager & operator= (const OutputManager &) = delete;
+
virtual std::ostream & stdout_stream() PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
virtual std::ostream & stderr_stream() PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
diff --git a/paludis/output_manager_factory.cc b/paludis/output_manager_factory.cc
index 89afd17..1b14a1e 100644
--- a/paludis/output_manager_factory.cc
+++ b/paludis/output_manager_factory.cc
@@ -19,7 +19,7 @@
#include <paludis/output_manager_factory.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/util/member_iterator-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/join.hh>
@@ -146,6 +146,6 @@ OutputManagerFactory::add_manager(
}
template class PrivateImplementationPattern<OutputManagerFactory>;
-template class InstantiationPolicy<OutputManagerFactory, instantiation_method::SingletonTag>;
+template class Singleton<OutputManagerFactory>;
template class WrappedForwardIterator<OutputManagerFactory::ConstIteratorTag, const std::string>;
diff --git a/paludis/output_manager_factory.hh b/paludis/output_manager_factory.hh
index 386e4e3..df1f5e1 100644
--- a/paludis/output_manager_factory.hh
+++ b/paludis/output_manager_factory.hh
@@ -23,9 +23,10 @@
#include <paludis/output_manager_factory-fwd.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/map-fwd.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/output_manager-fwd.hh>
#include <paludis/util/set-fwd.hh>
#include <tr1/functional>
@@ -35,9 +36,9 @@ namespace paludis
{
class PALUDIS_VISIBLE OutputManagerFactory :
private PrivateImplementationPattern<OutputManagerFactory>,
- public InstantiationPolicy<OutputManagerFactory, instantiation_method::SingletonTag>
+ public Singleton<OutputManagerFactory>
{
- friend class InstantiationPolicy<OutputManagerFactory, instantiation_method::SingletonTag>;
+ friend class Singleton<OutputManagerFactory>;
private:
OutputManagerFactory();
@@ -102,7 +103,7 @@ namespace paludis
};
extern template class PrivateImplementationPattern<OutputManagerFactory>;
- extern template class InstantiationPolicy<OutputManagerFactory, instantiation_method::SingletonTag>;
+ extern template class Singleton<OutputManagerFactory>;
extern template class WrappedForwardIterator<OutputManagerFactory::ConstIteratorTag, const std::string>;
}
diff --git a/paludis/package_database.hh b/paludis/package_database.hh
index 147d83c..b70bda6 100644
--- a/paludis/package_database.hh
+++ b/paludis/package_database.hh
@@ -27,7 +27,6 @@
#include <paludis/selection-fwd.hh>
#include <paludis/filter-fwd.hh>
#include <paludis/util/exception.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/join.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/stringify.hh>
@@ -219,8 +218,7 @@ namespace paludis
* \ingroup g_package_database
*/
class PALUDIS_VISIBLE PackageDatabase :
- private PrivateImplementationPattern<PackageDatabase>,
- private InstantiationPolicy<PackageDatabase, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<PackageDatabase>
{
private:
static const Filter & all_filter() PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -233,6 +231,9 @@ namespace paludis
~PackageDatabase();
+ PackageDatabase(const PackageDatabase &) = delete;
+ PackageDatabase & operator= (const PackageDatabase &) = delete;
+
///\}
/**
diff --git a/paludis/report_task.hh b/paludis/report_task.hh
index bce701b..b85bd2d 100644
--- a/paludis/report_task.hh
+++ b/paludis/report_task.hh
@@ -20,7 +20,6 @@
#ifndef PALUDIS_GUARD_PALUDIS_REPORT_TASK_HH
#define PALUDIS_GUARD_PALUDIS_REPORT_TASK_HH 1
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/repository.hh>
#include <paludis/dep_tag-fwd.hh>
@@ -46,8 +45,7 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE ReportTask :
- PrivateImplementationPattern<ReportTask>,
- InstantiationPolicy<ReportTask, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<ReportTask>
{
protected:
///\name Basic operations
@@ -63,6 +61,9 @@ namespace paludis
virtual ~ReportTask();
+ ReportTask(const ReportTask &) = delete;
+ ReportTask & operator= (const ReportTask &) = delete;
+
///\}
///\name Event callbacks
diff --git a/paludis/repositories/e/dep_parser.hh b/paludis/repositories/e/dep_parser.hh
index 24f3a10..357baab 100644
--- a/paludis/repositories/e/dep_parser.hh
+++ b/paludis/repositories/e/dep_parser.hh
@@ -25,7 +25,6 @@
#include <paludis/package_id-fwd.hh>
#include <paludis/repositories/e/eapi-fwd.hh>
#include <paludis/util/exception.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/environment-fwd.hh>
#include <string>
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index eefbec9..acf8771 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -71,7 +71,7 @@
#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/singleton-impl.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/log.hh>
@@ -1676,7 +1676,7 @@ ERepository::sync_host_key() const
namespace
{
struct Suffixes :
- InstantiationPolicy<Suffixes, instantiation_method::SingletonTag>
+ Singleton<Suffixes>
{
KeyValueConfigFile file;
@@ -1725,8 +1725,7 @@ ERepository::make_id(const QualifiedPackageName & q, const FSEntry & f) const
namespace
{
- class AFinder :
- private InstantiationPolicy<AFinder, instantiation_method::NonCopyableTag>
+ class AFinder
{
private:
std::list<std::pair<const FetchableURIDepSpec *, const URILabelsDepSpec *> > _specs;
diff --git a/paludis/repositories/e/e_repository_news.hh b/paludis/repositories/e/e_repository_news.hh
index f0bcce3..81b46b6 100644
--- a/paludis/repositories/e/e_repository_news.hh
+++ b/paludis/repositories/e/e_repository_news.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 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,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_E_E_REPOSITORY_NEWS_HH 1
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/wrapped_forward_iterator-fwd.hh>
@@ -44,8 +43,7 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE ERepositoryNews :
- private PrivateImplementationPattern<ERepositoryNews>,
- private InstantiationPolicy<ERepositoryNews, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<ERepositoryNews>
{
public:
///\name Basic operations
@@ -55,6 +53,9 @@ namespace paludis
const erepository::ERepositoryParams &);
~ERepositoryNews();
+ ERepositoryNews(const ERepositoryNews &) = delete;
+ ERepositoryNews & operator= (const ERepositoryNews &) = delete;
+
///\}
void update_news() const;
diff --git a/paludis/repositories/e/e_repository_sets.hh b/paludis/repositories/e/e_repository_sets.hh
index ba1bb11..1a8676d 100644
--- a/paludis/repositories/e/e_repository_sets.hh
+++ b/paludis/repositories/e/e_repository_sets.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, 2010 Ciaran McCreesh
* Copyright (c) 2006 Danny van Dyk
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -42,8 +42,7 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE ERepositorySets :
- private PrivateImplementationPattern<ERepositorySets>,
- private InstantiationPolicy<ERepositorySets, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<ERepositorySets>
{
public:
///\name Basic operations
@@ -53,6 +52,9 @@ namespace paludis
const erepository::ERepositoryParams &);
~ERepositorySets();
+ ERepositorySets(const ERepositorySets &) = delete;
+ ERepositorySets & operator= (const ERepositorySets &) = delete;
+
///\}
/**
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 1e27da2..f39fccd 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -31,7 +31,7 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/hashes.hh>
@@ -44,7 +44,7 @@
using namespace paludis;
using namespace paludis::erepository;
-template class InstantiationPolicy<EAPIData, instantiation_method::SingletonTag>;
+template class Singleton<EAPIData>;
namespace
{
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index d382ef6..213af9e 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -24,10 +24,10 @@
#include <paludis/repositories/e/dep_parser-fwd.hh>
#include <paludis/repositories/e/iuse.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/options.hh>
#include <paludis/util/named_value.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/name.hh>
#include <paludis/dep_spec-fwd.hh>
#include <paludis/merger-fwd.hh>
@@ -229,9 +229,9 @@ namespace paludis
*/
class PALUDIS_VISIBLE EAPIData :
private PrivateImplementationPattern<EAPIData>,
- public InstantiationPolicy<EAPIData, instantiation_method::SingletonTag>
+ public Singleton<EAPIData>
{
- friend class InstantiationPolicy<EAPIData, instantiation_method::SingletonTag>;
+ friend class Singleton<EAPIData>;
private:
EAPIData();
diff --git a/paludis/repositories/e/ebuild.hh b/paludis/repositories/e/ebuild.hh
index f4ccd74..0991fa3 100644
--- a/paludis/repositories/e/ebuild.hh
+++ b/paludis/repositories/e/ebuild.hh
@@ -20,7 +20,6 @@
#ifndef PALUDIS_GUARD_PALUDIS_EBUILD_HH
#define PALUDIS_GUARD_PALUDIS_EBUILD_HH 1
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/map-fwd.hh>
@@ -324,8 +323,7 @@ namespace paludis
*
* \ingroup grpebuildinterface
*/
- class EbuildCommand :
- private InstantiationPolicy<EbuildCommand, instantiation_method::NonCopyableTag>
+ class EbuildCommand
{
protected:
/**
@@ -390,6 +388,9 @@ namespace paludis
*/
virtual ~EbuildCommand();
+ EbuildCommand(const EbuildCommand &) = delete;
+ EbuildCommand & operator= (const EbuildCommand &) = delete;
+
/**
* Run the command.
*/
@@ -648,8 +649,7 @@ namespace paludis
*
* \ingroup grpebuildinterface
*/
- class WriteVDBEntryCommand :
- private InstantiationPolicy<WriteVDBEntryCommand, instantiation_method::NonCopyableTag>
+ class WriteVDBEntryCommand
{
protected:
/**
@@ -663,6 +663,9 @@ namespace paludis
*/
WriteVDBEntryCommand(const WriteVDBEntryParams &);
+ WriteVDBEntryCommand(const WriteVDBEntryCommand &) = delete;
+ WriteVDBEntryCommand & operator= (const WriteVDBEntryCommand &) = delete;
+
/**
* Run the command.
*/
@@ -674,8 +677,7 @@ namespace paludis
*
* \ingroup grpebuildinterface
*/
- class WriteBinaryEbuildCommand :
- private InstantiationPolicy<WriteVDBEntryCommand, instantiation_method::NonCopyableTag>
+ class WriteBinaryEbuildCommand
{
protected:
/**
@@ -689,6 +691,9 @@ namespace paludis
*/
WriteBinaryEbuildCommand(const WriteBinaryEbuildCommandParams &);
+ WriteBinaryEbuildCommand(const WriteBinaryEbuildCommand &) = delete;
+ WriteBinaryEbuildCommand & operator= (const WriteBinaryEbuildCommand) = delete;
+
/**
* Run the command.
*/
@@ -700,8 +705,7 @@ namespace paludis
*
* \ingroup grpebuildinterface
*/
- class VDBPostMergeUnmergeCommand :
- private InstantiationPolicy<VDBPostMergeUnmergeCommand, instantiation_method::NonCopyableTag>
+ class VDBPostMergeUnmergeCommand
{
private:
const VDBPostMergeUnmergeCommandParams params;
@@ -712,6 +716,9 @@ namespace paludis
VDBPostMergeUnmergeCommand(const VDBPostMergeUnmergeCommandParams &);
+ VDBPostMergeUnmergeCommand(const VDBPostMergeUnmergeCommand &) = delete;
+ VDBPostMergeUnmergeCommand & operator= (const VDBPostMergeUnmergeCommand &) = delete;
+
///\}
/**
diff --git a/paludis/repositories/e/extra_distribution_data.cc b/paludis/repositories/e/extra_distribution_data.cc
index e180b53..d10e22d 100644
--- a/paludis/repositories/e/extra_distribution_data.cc
+++ b/paludis/repositories/e/extra_distribution_data.cc
@@ -74,5 +74,5 @@ namespace paludis
}
template class ExtraDistributionData<EDistribution>;
-template class InstantiationPolicy<ExtraDistributionData<EDistribution>, instantiation_method::SingletonTag>;
+template class Singleton<ExtraDistributionData<EDistribution>>;
diff --git a/paludis/repositories/e/layout.cc b/paludis/repositories/e/layout.cc
index db54981..7ccb8f0 100644
--- a/paludis/repositories/e/layout.cc
+++ b/paludis/repositories/e/layout.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
* Copyright (c) 2006 Danny van Dyk
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -22,14 +22,14 @@
#include <paludis/repositories/e/traditional_layout.hh>
#include <paludis/repositories/e/exheres_layout.hh>
#include <paludis/util/fs_entry.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-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 Singleton<LayoutFactory>;
Layout::Layout(const std::tr1::shared_ptr<const FSEntrySequence> & l) :
_master_repositories_locations(l)
diff --git a/paludis/repositories/e/layout.hh b/paludis/repositories/e/layout.hh
index 1191ccb..04593d3 100644
--- a/paludis/repositories/e/layout.hh
+++ b/paludis/repositories/e/layout.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
* Copyright (c) 2006 Danny van Dyk
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -28,6 +28,7 @@
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/map-fwd.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/repositories/e/use_desc.hh>
#include <paludis/metadata_key-fwd.hh>
#include <tr1/memory>
@@ -166,9 +167,9 @@ namespace paludis
* \ingroup grperepository
*/
class PALUDIS_VISIBLE LayoutFactory :
- public InstantiationPolicy<LayoutFactory, instantiation_method::SingletonTag>
+ public Singleton<LayoutFactory>
{
- friend class InstantiationPolicy<LayoutFactory, instantiation_method::SingletonTag>;
+ friend class Singleton<LayoutFactory>;
private:
LayoutFactory();
diff --git a/paludis/repositories/e/memoised_hashes.cc b/paludis/repositories/e/memoised_hashes.cc
index 2da2403..640fe56 100644
--- a/paludis/repositories/e/memoised_hashes.cc
+++ b/paludis/repositories/e/memoised_hashes.cc
@@ -21,7 +21,7 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/rmd160.hh>
@@ -127,5 +127,5 @@ template const std::string MemoisedHashes::get<SHA256>(const FSEntry &, SafeIFSt
template const std::string MemoisedHashes::get<MD5>(const FSEntry &, SafeIFStream &) const;
template class PrivateImplementationPattern<MemoisedHashes>;
-template class InstantiationPolicy<MemoisedHashes, instantiation_method::SingletonTag>;
+template class Singleton<MemoisedHashes>;
diff --git a/paludis/repositories/e/memoised_hashes.hh b/paludis/repositories/e/memoised_hashes.hh
index c18124d..5458965 100644
--- a/paludis/repositories/e/memoised_hashes.hh
+++ b/paludis/repositories/e/memoised_hashes.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_E_MEMOISED_HASHES_HH 1
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/safe_ifstream-fwd.hh>
@@ -30,10 +30,10 @@ namespace paludis
namespace erepository
{
class PALUDIS_VISIBLE MemoisedHashes :
- public InstantiationPolicy<MemoisedHashes, instantiation_method::SingletonTag>,
+ public Singleton<MemoisedHashes>,
private PrivateImplementationPattern<MemoisedHashes>
{
- friend class InstantiationPolicy<MemoisedHashes, instantiation_method::SingletonTag>;
+ friend class Singleton<MemoisedHashes>;
public:
template <typename H_>
@@ -45,7 +45,7 @@ namespace paludis
};
}
extern template class PrivateImplementationPattern<erepository::MemoisedHashes>;
- extern template class InstantiationPolicy<erepository::MemoisedHashes, instantiation_method::SingletonTag>;
+ extern template class Singleton<erepository::MemoisedHashes>;
}
#endif
diff --git a/paludis/repositories/e/metadata_xml.cc b/paludis/repositories/e/metadata_xml.cc
index 09d3a89..ecb4290 100644
--- a/paludis/repositories/e/metadata_xml.cc
+++ b/paludis/repositories/e/metadata_xml.cc
@@ -20,7 +20,7 @@
#include <paludis/repositories/e/metadata_xml.hh>
#include <paludis/repositories/e/xml_things_handle.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/util/map-impl.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/fs_entry.hh>
@@ -87,5 +87,5 @@ MetadataXMLPool::metadata_if_exists(const FSEntry & f) const
template class Map<ChoiceNameWithPrefix, std::string>;
template class PrivateImplementationPattern<MetadataXMLPool>;
-template class InstantiationPolicy<MetadataXMLPool, instantiation_method::SingletonTag>;
+template class Singleton<MetadataXMLPool>;
diff --git a/paludis/repositories/e/metadata_xml.hh b/paludis/repositories/e/metadata_xml.hh
index 4ab335c..70ed23f 100644
--- a/paludis/repositories/e/metadata_xml.hh
+++ b/paludis/repositories/e/metadata_xml.hh
@@ -23,7 +23,7 @@
#include <paludis/util/attributes.hh>
#include <paludis/util/named_value.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/util/sequence-fwd.hh>
#include <paludis/util/map-fwd.hh>
#include <paludis/util/fs_entry-fwd.hh>
@@ -52,9 +52,9 @@ namespace paludis
class PALUDIS_VISIBLE MetadataXMLPool :
private PrivateImplementationPattern<MetadataXMLPool>,
- public InstantiationPolicy<MetadataXMLPool, instantiation_method::SingletonTag>
+ public Singleton<MetadataXMLPool>
{
- friend class InstantiationPolicy<MetadataXMLPool, instantiation_method::SingletonTag>;
+ friend class Singleton<MetadataXMLPool>;
private:
MetadataXMLPool();
@@ -66,7 +66,7 @@ namespace paludis
}
extern template class PrivateImplementationPattern<erepository::MetadataXMLPool>;
- extern template class InstantiationPolicy<erepository::MetadataXMLPool, instantiation_method::SingletonTag>;
+ extern template class Singleton<erepository::MetadataXMLPool>;
}
#endif
diff --git a/paludis/repositories/e/profile.hh b/paludis/repositories/e/profile.hh
index ae52592..4e1b27d 100644
--- a/paludis/repositories/e/profile.hh
+++ b/paludis/repositories/e/profile.hh
@@ -32,7 +32,7 @@
#include <paludis/util/tribool.hh>
#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/util/map-fwd.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/repositories/e/e_repository_id.hh>
#include <string>
@@ -101,9 +101,9 @@ namespace paludis
};
class PALUDIS_VISIBLE ProfileFactory :
- public InstantiationPolicy<ProfileFactory, instantiation_method::SingletonTag>
+ public Singleton<ProfileFactory>
{
- friend class InstantiationPolicy<ProfileFactory, instantiation_method::SingletonTag>;
+ friend class Singleton<ProfileFactory>;
private:
ProfileFactory();
diff --git a/paludis/repositories/e/use_desc.hh b/paludis/repositories/e/use_desc.hh
index bb244b2..475a7b6 100644
--- a/paludis/repositories/e/use_desc.hh
+++ b/paludis/repositories/e/use_desc.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, 2010 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,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_PALUDIS_REPOSITORIES_E_USE_DESC_HH 1
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/name-fwd.hh>
#include <paludis/package_id-fwd.hh>
@@ -39,8 +38,7 @@ namespace paludis
* \ingroup grperepository
*/
class UseDesc :
- private PrivateImplementationPattern<UseDesc>,
- private InstantiationPolicy<UseDesc, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<UseDesc>
{
public:
///\name Basic operations
@@ -49,6 +47,9 @@ namespace paludis
UseDesc(const std::tr1::shared_ptr<const UseDescFileInfoSequence> &);
~UseDesc();
+ UseDesc(const UseDesc &) = delete;
+ UseDesc & operator= (const UseDesc &) = delete;
+
///\}
/**
diff --git a/paludis/repositories/e/xml_things_handle.cc b/paludis/repositories/e/xml_things_handle.cc
index cf312f5..c90625e 100644
--- a/paludis/repositories/e/xml_things_handle.cc
+++ b/paludis/repositories/e/xml_things_handle.cc
@@ -22,7 +22,7 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/log.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/util/system.hh>
#include "config.h"
#include <dlfcn.h>
@@ -150,5 +150,5 @@ XMLThingsHandle::create_metadata_xml_from_xml_file() const
}
template class PrivateImplementationPattern<XMLThingsHandle>;
-template class InstantiationPolicy<XMLThingsHandle, instantiation_method::SingletonTag>;
+template class Singleton<XMLThingsHandle>;
diff --git a/paludis/repositories/e/xml_things_handle.hh b/paludis/repositories/e/xml_things_handle.hh
index f77e461..3346590 100644
--- a/paludis/repositories/e/xml_things_handle.hh
+++ b/paludis/repositories/e/xml_things_handle.hh
@@ -23,7 +23,7 @@
#include <paludis/repositories/e/glsa.hh>
#include <paludis/repositories/e/metadata_xml.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/util/fs_entry-fwd.hh>
namespace paludis
@@ -32,9 +32,9 @@ namespace paludis
{
class PALUDIS_VISIBLE XMLThingsHandle :
private PrivateImplementationPattern<XMLThingsHandle>,
- public InstantiationPolicy<XMLThingsHandle, instantiation_method::SingletonTag>
+ public Singleton<XMLThingsHandle>
{
- friend class InstantiationPolicy<XMLThingsHandle, instantiation_method::SingletonTag>;
+ friend class Singleton<XMLThingsHandle>;
private:
XMLThingsHandle();
@@ -52,7 +52,7 @@ namespace paludis
}
extern template class PrivateImplementationPattern<erepository::XMLThingsHandle>;
- extern template class InstantiationPolicy<erepository::XMLThingsHandle, instantiation_method::SingletonTag>;
+ extern template class Singleton<erepository::XMLThingsHandle>;
}
#endif
diff --git a/paludis/repositories/fake/fake_repository_base.cc b/paludis/repositories/fake/fake_repository_base.cc
index 809b09b..102b8c0 100644
--- a/paludis/repositories/fake/fake_repository_base.cc
+++ b/paludis/repositories/fake/fake_repository_base.cc
@@ -44,8 +44,7 @@ using namespace paludis;
namespace paludis
{
template<>
- struct Implementation<FakeRepositoryBase> :
- private InstantiationPolicy<Implementation<FakeRepositoryBase>, instantiation_method::NonCopyableTag>
+ struct Implementation<FakeRepositoryBase>
{
std::tr1::shared_ptr<CategoryNamePartSet> category_names;
std::map<CategoryNamePart, std::tr1::shared_ptr<PackageNamePartSet> > package_names;
diff --git a/paludis/repositories/gems/extra_distribution_data.cc b/paludis/repositories/gems/extra_distribution_data.cc
index 0a39033..ef123d4 100644
--- a/paludis/repositories/gems/extra_distribution_data.cc
+++ b/paludis/repositories/gems/extra_distribution_data.cc
@@ -20,6 +20,7 @@
#include <paludis/repositories/gems/extra_distribution_data.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/distribution-impl.hh>
using namespace paludis;
@@ -45,6 +46,5 @@ namespace paludis
}
template class ExtraDistributionData<GemsDistribution>;
-template class InstantiationPolicy<ExtraDistributionData<GemsDistribution>, instantiation_method::SingletonTag>;
-
+template class Singleton<ExtraDistributionData<GemsDistribution>>;
diff --git a/paludis/repositories/gems/yaml.cc b/paludis/repositories/gems/yaml.cc
index 773f939..6430a9d 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, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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
@@ -19,7 +19,7 @@
#include "yaml.hh"
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <tr1/functional>
@@ -397,7 +397,7 @@ ParseError::ParseError(const std::string & s) throw () :
{
}
-template class InstantiationPolicy<NodeManager, instantiation_method::SingletonTag>;
+template class Singleton<NodeManager>;
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 9ea6093..cedfc63 100644
--- a/paludis/repositories/gems/yaml.hh
+++ b/paludis/repositories/gems/yaml.hh
@@ -23,7 +23,7 @@
#include <paludis/repositories/gems/yaml-fwd.hh>
#include <paludis/util/simple_visitor.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/type_list.hh>
@@ -189,9 +189,9 @@ namespace paludis
*/
class PALUDIS_VISIBLE NodeManager :
private PrivateImplementationPattern<NodeManager>,
- public InstantiationPolicy<NodeManager, instantiation_method::SingletonTag>
+ public Singleton<NodeManager>
{
- friend class InstantiationPolicy<NodeManager, instantiation_method::SingletonTag>;
+ friend class Singleton<NodeManager>;
private:
///\name Basic operations
diff --git a/paludis/repository.cc b/paludis/repository.cc
index 7830f6c..56ed739 100644
--- a/paludis/repository.cc
+++ b/paludis/repository.cc
@@ -30,6 +30,7 @@
#include <paludis/util/set-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/action.hh>
#include <paludis/metadata_key.hh>
#include <paludis/distribution-impl.hh>
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 7de545c..4d9c15c 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -33,7 +33,7 @@
#include <paludis/util/options.hh>
#include <paludis/util/named_value.hh>
#include <paludis/util/timestamp.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/output_manager-fwd.hh>
#include <paludis/version_spec.hh>
#include <paludis/metadata_key-fwd.hh>
@@ -235,7 +235,6 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE Repository :
- private InstantiationPolicy<Repository, instantiation_method::NonCopyableTag>,
private PrivateImplementationPattern<Repository>,
public RepositoryCapabilities,
public MetadataKeyHolder
@@ -257,6 +256,9 @@ namespace paludis
virtual ~Repository();
+ Repository(const Repository &) = delete;
+ Repository & operator= (const Repository &) = delete;
+
///\}
///\name Repository information
diff --git a/paludis/repository_factory.cc b/paludis/repository_factory.cc
index a0e8938..f373243 100644
--- a/paludis/repository_factory.cc
+++ b/paludis/repository_factory.cc
@@ -19,7 +19,7 @@
#include <paludis/repository_factory.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/util/member_iterator-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/join.hh>
@@ -213,6 +213,6 @@ RepositoryFactory::add_repository_format(
}
template class PrivateImplementationPattern<RepositoryFactory>;
-template class InstantiationPolicy<RepositoryFactory, instantiation_method::SingletonTag>;
+template class Singleton<RepositoryFactory>;
template class WrappedForwardIterator<RepositoryFactory::ConstIteratorTag, const std::string>;
diff --git a/paludis/repository_factory.hh b/paludis/repository_factory.hh
index 4eb3814..ddc7591 100644
--- a/paludis/repository_factory.hh
+++ b/paludis/repository_factory.hh
@@ -23,7 +23,7 @@
#include <paludis/repository_factory-fwd.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/no_type.hh>
@@ -37,9 +37,9 @@ namespace paludis
{
class PALUDIS_VISIBLE RepositoryFactory :
private PrivateImplementationPattern<RepositoryFactory>,
- public InstantiationPolicy<RepositoryFactory, instantiation_method::SingletonTag>
+ public Singleton<RepositoryFactory>
{
- friend class InstantiationPolicy<RepositoryFactory, instantiation_method::SingletonTag>;
+ friend class Singleton<RepositoryFactory>;
private:
RepositoryFactory();
@@ -157,7 +157,7 @@ namespace paludis
void register_repositories(const RepositoryClass_ * const, RepositoryFactory * const);
extern template class PrivateImplementationPattern<RepositoryFactory>;
- extern template class InstantiationPolicy<RepositoryFactory, instantiation_method::SingletonTag>;
+ extern template class Singleton<RepositoryFactory>;
extern template class WrappedForwardIterator<RepositoryFactory::ConstIteratorTag, const std::string>;
}
diff --git a/paludis/selection_handler.cc b/paludis/selection_handler.cc
index 68efb0a..40b7529 100644
--- a/paludis/selection_handler.cc
+++ b/paludis/selection_handler.cc
@@ -18,7 +18,6 @@
*/
#include <paludis/selection_handler.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
using namespace paludis;
@@ -26,5 +25,3 @@ SelectionHandler::~SelectionHandler()
{
}
-template class InstantiationPolicy<SelectionHandler, instantiation_method::NonCopyableTag>;
-
diff --git a/paludis/selection_handler.hh b/paludis/selection_handler.hh
index 401be62..0d4ab69 100644
--- a/paludis/selection_handler.hh
+++ b/paludis/selection_handler.hh
@@ -26,13 +26,11 @@
#include <paludis/environment-fwd.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <tr1/memory>
namespace paludis
{
- class SelectionHandler :
- private InstantiationPolicy<SelectionHandler, instantiation_method::NonCopyableTag>
+ class SelectionHandler
{
protected:
const FilteredGenerator _fg;
@@ -45,13 +43,14 @@ namespace paludis
public:
virtual ~SelectionHandler() = 0;
+ SelectionHandler(const SelectionHandler &) = delete;
+ SelectionHandler & operator= (const SelectionHandler &) = delete;
+
virtual std::string as_string() const = 0;
virtual std::tr1::shared_ptr<PackageIDSequence> perform_select(const Environment * const) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
};
-
- extern template class InstantiationPolicy<SelectionHandler, instantiation_method::NonCopyableTag>;
}
#endif
diff --git a/paludis/selinux/security_context.cc b/paludis/selinux/security_context.cc
index e0ab29a..3b52974 100644
--- a/paludis/selinux/security_context.cc
+++ b/paludis/selinux/security_context.cc
@@ -19,7 +19,7 @@
#include <paludis/util/log.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/selinux/security_context.hh>
@@ -30,6 +30,10 @@
// I think the name explains it. C++ is picky about casting to function pointers.
#define STUPID_CAST(type, val) reinterpret_cast<type>(reinterpret_cast<uintptr_t>(val))
+using namespace paludis;
+
+template class Singleton<MatchPathCon>;
+
namespace
{
// Declared here to remove dep on <selinux/selinux.h>
@@ -140,10 +144,6 @@ namespace
} libselinux;
}
-using namespace paludis;
-
-template class InstantiationPolicy<MatchPathCon, instantiation_method::SingletonTag>;
-
namespace paludis
{
template<>
diff --git a/paludis/selinux/security_context.hh b/paludis/selinux/security_context.hh
index b9e5eb8..a68ad82 100644
--- a/paludis/selinux/security_context.hh
+++ b/paludis/selinux/security_context.hh
@@ -22,7 +22,7 @@
#include <string>
#include <paludis/util/exception.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/fs_entry.hh>
@@ -60,8 +60,7 @@ namespace paludis
* \ingroup grplibpaludisselinux
*/
class PALUDIS_VISIBLE SecurityContext :
- private PrivateImplementationPattern<SecurityContext>,
- private InstantiationPolicy<SecurityContext, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<SecurityContext>
{
public:
/**
@@ -79,6 +78,10 @@ namespace paludis
*/
~SecurityContext();
+ SecurityContext(const SecurityContext &) = delete;
+
+ SecurityContext & operator= (const SecurityContext &) = delete;
+
friend std::ostream& paludis::operator<<(std::ostream&, const SecurityContext &);
friend class paludis::FSCreateCon;
friend class paludis::MatchPathCon;
@@ -138,7 +141,7 @@ namespace paludis
* \ingroup grplibpaludisselinux
*/
class PALUDIS_VISIBLE MatchPathCon :
- public InstantiationPolicy<MatchPathCon, instantiation_method::SingletonTag>
+ public Singleton<MatchPathCon>
{
private:
bool _good;
diff --git a/paludis/set_file.hh b/paludis/set_file.hh
index 1b86b88..4e967e5 100644
--- a/paludis/set_file.hh
+++ b/paludis/set_file.hh
@@ -20,7 +20,6 @@
#ifndef PALUDIS_GUARD_PALUDIS_SET_FILE_HH
#define PALUDIS_GUARD_PALUDIS_SET_FILE_HH 1
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/fs_entry.hh>
@@ -113,7 +112,6 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE SetFile :
- private InstantiationPolicy<SetFile, instantiation_method::NonCopyableTag>,
private PrivateImplementationPattern<SetFile>
{
public:
@@ -123,6 +121,9 @@ namespace paludis
SetFile(const SetFileParams &);
~SetFile();
+ SetFile(const SetFile &) = delete;
+ SetFile & operator= (const SetFile &) = delete;
+
///\}
/**
diff --git a/paludis/sync_task.hh b/paludis/sync_task.hh
index b093b82..7173f10 100644
--- a/paludis/sync_task.hh
+++ b/paludis/sync_task.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2010 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
@@ -20,7 +20,6 @@
#ifndef PALUDIS_GUARD_PALUDIS_SYNC_TASK_HH
#define PALUDIS_GUARD_PALUDIS_SYNC_TASK_HH 1
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/dep_list.hh>
@@ -47,8 +46,7 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE SyncTask :
- PrivateImplementationPattern<SyncTask>,
- InstantiationPolicy<SyncTask, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<SyncTask>
{
protected:
///\name Basic operations
@@ -64,6 +62,9 @@ namespace paludis
virtual ~SyncTask();
+ SyncTask(const SyncTask &) = delete;
+ SyncTask & operator= (const SyncTask &) = delete;
+
///\}
///\name Add targets
diff --git a/paludis/syncer.hh b/paludis/syncer.hh
index 173d6f9..489a576 100644
--- a/paludis/syncer.hh
+++ b/paludis/syncer.hh
@@ -86,8 +86,7 @@ namespace paludis
*
* \ingroup g_repository
*/
- class PALUDIS_VISIBLE Syncer :
- private InstantiationPolicy<Syncer, instantiation_method::NonCopyableTag>
+ class PALUDIS_VISIBLE Syncer
{
protected:
/**
@@ -101,6 +100,9 @@ namespace paludis
*/
virtual ~Syncer();
+ Syncer(const Syncer &) = delete;
+ Syncer & operator= (const Syncer &) = delete;
+
/**
* Perform the sync.
*/
diff --git a/paludis/uninstall_list.hh b/paludis/uninstall_list.hh
index b17558b..3d9d43e 100644
--- a/paludis/uninstall_list.hh
+++ b/paludis/uninstall_list.hh
@@ -20,7 +20,6 @@
#ifndef PALUDIS_GUARD_PALUDIS_UNUSED_LIST_HH
#define PALUDIS_GUARD_PALUDIS_UNUSED_LIST_HH 1
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/named_value.hh>
@@ -88,8 +87,7 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE UninstallList :
- private PrivateImplementationPattern<UninstallList>,
- public InstantiationPolicy<UninstallList, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<UninstallList>
{
private:
void add_package(const std::tr1::shared_ptr<const PackageID> &, const std::tr1::shared_ptr<DepTag> &,
@@ -116,6 +114,9 @@ namespace paludis
UninstallList(const Environment * const, const UninstallListOptions &);
virtual ~UninstallList();
+ UninstallList(const UninstallList &) = delete;
+ UninstallList & operator= (const UninstallList &) = delete;
+
///\}
/**
diff --git a/paludis/uninstall_task.hh b/paludis/uninstall_task.hh
index b2af2f9..159b7eb 100644
--- a/paludis/uninstall_task.hh
+++ b/paludis/uninstall_task.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, 2010 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,6 @@
#include <paludis/dep_spec-fwd.hh>
#include <paludis/package_id.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/wrapped_forward_iterator-fwd.hh>
@@ -89,8 +88,7 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE UninstallTask :
- PrivateImplementationPattern<UninstallTask>,
- InstantiationPolicy<UninstallTask, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<UninstallTask>
{
protected:
///\name Basic operations
@@ -106,6 +104,9 @@ namespace paludis
virtual ~UninstallTask();
+ UninstallTask(const UninstallTask &) = delete;
+ UninstallTask & operator= (const UninstallTask &) = delete;
+
///\}
///\name Behaviour options
diff --git a/paludis/util/channel.hh b/paludis/util/channel.hh
index b65623a..10654f7 100644
--- a/paludis/util/channel.hh
+++ b/paludis/util/channel.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2010 Ciaran McCreesh
* Copyright (c) 2009 David Leverton
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -21,7 +21,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_UTIL_CHANNEL_HH
#define PALUDIS_GUARD_PALUDIS_UTIL_CHANNEL_HH 1
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
/** \file
* Declaration for the Channel class.
@@ -41,8 +41,7 @@ namespace paludis
* \ingroup g_system
* \nosubgrouping
*/
- class PALUDIS_VISIBLE Channel :
- InstantiationPolicy<Channel, instantiation_method::NonCopyableTag>
+ class PALUDIS_VISIBLE Channel
{
protected:
int _fds[2];
@@ -55,6 +54,9 @@ namespace paludis
virtual ~Channel();
+ Channel(const Channel &) = delete;
+ Channel & operator= (const Channel &) = delete;
+
///\}
///\name File descriptors
diff --git a/paludis/util/config_file.hh b/paludis/util/config_file.hh
index 265d475..871be9c 100644
--- a/paludis/util/config_file.hh
+++ b/paludis/util/config_file.hh
@@ -23,7 +23,6 @@
#include <paludis/util/config_file-fwd.hh>
#include <paludis/util/map-fwd.hh>
#include <paludis/util/exception.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/options-fwd.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
diff --git a/paludis/util/elf_dynamic_section.cc b/paludis/util/elf_dynamic_section.cc
index 8df72f4..c4b1834 100644
--- a/paludis/util/elf_dynamic_section.cc
+++ b/paludis/util/elf_dynamic_section.cc
@@ -28,7 +28,7 @@
#include <paludis/util/byte_swap.hh>
#include <paludis/util/clone-impl.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
diff --git a/paludis/util/elf_dynamic_section.hh b/paludis/util/elf_dynamic_section.hh
index b4e04f2..59cb92d 100644
--- a/paludis/util/elf_dynamic_section.hh
+++ b/paludis/util/elf_dynamic_section.hh
@@ -23,7 +23,7 @@
#include <paludis/util/elf_sections.hh>
#include <paludis/util/clone.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/util/simple_visitor.hh>
@@ -43,14 +43,14 @@ namespace paludis
template <typename ElfType_>
class DynamicEntry :
- public virtual paludis::DeclareAbstractAcceptMethods<DynamicEntry<ElfType_>, typename paludis::MakeTypeList<
+ public virtual DeclareAbstractAcceptMethods<DynamicEntry<ElfType_>, typename MakeTypeList<
DynamicEntryUnknown<ElfType_>,
DynamicEntryValue<ElfType_>,
DynamicEntryPointer<ElfType_>,
DynamicEntryString<ElfType_>,
DynamicEntryFlag<ElfType_>
>::Type>,
- public virtual paludis::Cloneable<DynamicEntry<ElfType_> >
+ public virtual Cloneable<DynamicEntry<ElfType_> >
{
private:
std::string _tag_name;
@@ -72,8 +72,8 @@ namespace paludis
template <typename ElfType_>
class DynamicEntryUnknown :
public virtual DynamicEntry<ElfType_>,
- public paludis::ImplementAcceptMethods<DynamicEntry<ElfType_>, DynamicEntryUnknown<ElfType_> >,
- public paludis::CloneUsingThis<DynamicEntry<ElfType_>, DynamicEntryUnknown<ElfType_> >
+ public ImplementAcceptMethods<DynamicEntry<ElfType_>, DynamicEntryUnknown<ElfType_> >,
+ public CloneUsingThis<DynamicEntry<ElfType_>, DynamicEntryUnknown<ElfType_> >
{
public:
DynamicEntryUnknown();
@@ -83,8 +83,8 @@ namespace paludis
template <typename ElfType_>
class DynamicEntryFlag :
public virtual DynamicEntry<ElfType_>,
- public paludis::ImplementAcceptMethods<DynamicEntry<ElfType_>, DynamicEntryFlag<ElfType_> >,
- public paludis::CloneUsingThis<DynamicEntry<ElfType_>, DynamicEntryFlag<ElfType_> >
+ public ImplementAcceptMethods<DynamicEntry<ElfType_>, DynamicEntryFlag<ElfType_> >,
+ public CloneUsingThis<DynamicEntry<ElfType_>, DynamicEntryFlag<ElfType_> >
{
public:
DynamicEntryFlag(const std::string &);
@@ -94,8 +94,8 @@ namespace paludis
template <typename ElfType_>
class DynamicEntryValue :
public virtual DynamicEntry<ElfType_>,
- public paludis::ImplementAcceptMethods<DynamicEntry<ElfType_>, DynamicEntryValue<ElfType_> >,
- public paludis::CloneUsingThis<DynamicEntry<ElfType_>, DynamicEntryValue<ElfType_> >
+ public ImplementAcceptMethods<DynamicEntry<ElfType_>, DynamicEntryValue<ElfType_> >,
+ public CloneUsingThis<DynamicEntry<ElfType_>, DynamicEntryValue<ElfType_> >
{
private:
typename ElfType_::DynamicValue _value;
@@ -114,8 +114,8 @@ namespace paludis
template <typename ElfType_>
class DynamicEntryPointer :
public virtual DynamicEntry<ElfType_>,
- public paludis::ImplementAcceptMethods<DynamicEntry<ElfType_>, DynamicEntryPointer<ElfType_> >,
- public paludis::CloneUsingThis<DynamicEntry<ElfType_>, DynamicEntryPointer<ElfType_> >
+ public ImplementAcceptMethods<DynamicEntry<ElfType_>, DynamicEntryPointer<ElfType_> >,
+ public CloneUsingThis<DynamicEntry<ElfType_>, DynamicEntryPointer<ElfType_> >
{
private:
typename ElfType_::DynamicPointer _pointer;
@@ -139,8 +139,8 @@ namespace paludis
template <typename ElfType_>
class DynamicEntryString :
public virtual DynamicEntry<ElfType_>,
- public paludis::ImplementAcceptMethods<DynamicEntry<ElfType_>, DynamicEntryString<ElfType_> >,
- public paludis::CloneUsingThis<DynamicEntry<ElfType_>, DynamicEntryString<ElfType_> >
+ public ImplementAcceptMethods<DynamicEntry<ElfType_>, DynamicEntryString<ElfType_> >,
+ public CloneUsingThis<DynamicEntry<ElfType_>, DynamicEntryString<ElfType_> >
{
friend class littlelf_internals::DynEntriesStringResolvingVisitor<ElfType_>;
@@ -172,11 +172,11 @@ namespace paludis
template <typename ElfType_>
class DynamicEntries :
- public paludis::InstantiationPolicy<DynamicEntries<ElfType_>, paludis::instantiation_method::SingletonTag>,
- private paludis::PrivateImplementationPattern<DynamicEntries<ElfType_> >
+ public Singleton<DynamicEntries<ElfType_> >,
+ private PrivateImplementationPattern<DynamicEntries<ElfType_> >
{
- using paludis::PrivateImplementationPattern<DynamicEntries>::_imp;
- friend class paludis::InstantiationPolicy<DynamicEntries, paludis::instantiation_method::SingletonTag>;
+ using PrivateImplementationPattern<DynamicEntries>::_imp;
+ friend class Singleton<DynamicEntries>;
public:
void register_type(typename ElfType_::DynamicTag, std::tr1::shared_ptr<DynamicEntry<ElfType_> >);
@@ -195,10 +195,10 @@ namespace paludis
template <typename ElfType_>
class PALUDIS_VISIBLE DynamicSection :
public Section<ElfType_>,
- public paludis::ImplementAcceptMethods<Section<ElfType_>, DynamicSection<ElfType_> >,
- private paludis::PrivateImplementationPattern<DynamicSection<ElfType_> >
+ public ImplementAcceptMethods<Section<ElfType_>, DynamicSection<ElfType_> >,
+ private PrivateImplementationPattern<DynamicSection<ElfType_> >
{
- using paludis::PrivateImplementationPattern<DynamicSection>::_imp;
+ using PrivateImplementationPattern<DynamicSection>::_imp;
public:
DynamicSection(typename ElfType_::Word, const typename ElfType_::SectionHeader &, std::istream &, bool);
@@ -209,7 +209,7 @@ namespace paludis
void resolve_entry_names(Section<ElfType_> &);
typedef DynamicSectionEntryIteratorTag<ElfType_> EntryIteratorTag;
- typedef paludis::WrappedForwardIterator<EntryIteratorTag, DynamicEntry<ElfType_> > EntryIterator;
+ typedef WrappedForwardIterator<EntryIteratorTag, DynamicEntry<ElfType_> > EntryIterator;
EntryIterator entry_begin() const;
EntryIterator entry_end() const;
};
diff --git a/paludis/util/files.m4 b/paludis/util/files.m4
index 6ca5dc5..246a889 100644
--- a/paludis/util/files.m4
+++ b/paludis/util/files.m4
@@ -44,7 +44,6 @@ add(`graph', `hh', `cc', `fwd', `impl', `test')
add(`hashes', `hh', `cc')
add(`iterator_funcs', `hh', `test')
add(`indirect_iterator', `hh', `fwd', `impl', `test')
-add(`instantiation_policy', `hh', `impl', `test')
add(`is_file_with_extension', `hh', `cc', `se', `test', `testscript')
add(`join', `hh', `test')
add(`log', `hh', `cc', `se', `test')
@@ -80,6 +79,7 @@ add(`sha256', `hh', `cc', `test')
add(`simple_parser', `hh', `cc', `test', `fwd')
add(`simple_visitor', `hh', `cc', `fwd', `impl')
add(`simple_visitor_cast', `hh', `cc', `fwd')
+add(`singleton', `hh', `impl', `test')
add(`stringify', `hh', `test')
add(`string_list_stream', `hh', `cc', `fwd', `test')
add(`strip', `hh', `cc', `test')
diff --git a/paludis/util/graph.hh b/paludis/util/graph.hh
index ebe5734..3259a6f 100644
--- a/paludis/util/graph.hh
+++ b/paludis/util/graph.hh
@@ -22,7 +22,6 @@
#include <paludis/util/graph-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/exception.hh>
#include <tr1/memory>
diff --git a/paludis/util/instantiation_policy.hh b/paludis/util/instantiation_policy.hh
deleted file mode 100644
index a60cfc9..0000000
--- a/paludis/util/instantiation_policy.hh
+++ /dev/null
@@ -1,163 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2005, 2006, 2007 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_INSTANTIATION_POLICY_HH
-#define PALUDIS_GUARD_PALUDIS_INSTANTIATION_POLICY_HH 1
-
-#include <paludis/util/attributes.hh>
-
-/** \file
- * InstantiationPolicy patterns.
- *
- * \ingroup g_oo
- *
- * \section Examples
- *
- * - None at this time.
- */
-
-namespace paludis
-{
- /**
- * Instantiation policies for paludis::InstantiationPolicy.
- *
- * \ingroup g_oo
- */
- namespace instantiation_method
- {
- /**
- * Cannot be copied or assigned to.
- *
- * \ingroup g_oo
- */
- struct NonCopyableTag;
-
- /**
- * Cannot be instantiated
- *
- * \ingroup g_oo
- */
- struct NonInstantiableTag;
-
- /**
- * Single instance.
- *
- * \ingroup g_oo
- */
- struct SingletonTag;
- }
-
- /**
- * InstantiationPolicy is used to specify behaviour of classes that have
- * something other than the default C++ instantiation behaviour.
- *
- * \ingroup g_oo
- */
- template <typename OurType_, typename InstantiationMethodTag_>
- struct InstantiationPolicy;
-
- /**
- * InstantiationPolicy: specialisation for classes that cannot be copied
- * or assigned to.
- *
- * \ingroup g_oo
- * \nosubgrouping
- */
- template<typename OurType_>
- class PALUDIS_VISIBLE InstantiationPolicy<OurType_, instantiation_method::NonCopyableTag>
- {
- private:
- InstantiationPolicy(const InstantiationPolicy &);
- const InstantiationPolicy & operator= (const InstantiationPolicy &);
-
- public:
- InstantiationPolicy()
- {
- }
- };
-
- /**
- * InstantiationPolicy: specialisation for classes that cannot be created.
- *
- * \ingroup g_oo
- * \nosubgrouping
- */
- template<typename OurType_>
- class InstantiationPolicy<OurType_, instantiation_method::NonInstantiableTag>
- {
- private:
- InstantiationPolicy(const InstantiationPolicy &);
- const InstantiationPolicy & operator= (const InstantiationPolicy &);
- InstantiationPolicy();
- };
-
- /**
- * InstantiationPolicy: specialisation for singleton classes that are
- * created as needed.
- *
- * \ingroup g_oo
- * \nosubgrouping
- */
- template<typename OurType_>
- class PALUDIS_VISIBLE InstantiationPolicy<OurType_, instantiation_method::SingletonTag>
- {
- private:
- InstantiationPolicy(const InstantiationPolicy &);
-
- const InstantiationPolicy & operator= (const InstantiationPolicy &);
-
- static OurType_ * * _get_instance_ptr();
-
- class DeleteOnDestruction;
- friend class DeleteOnDestruction;
-
- static void _delete(OurType_ * const p);
-
- class DeleteOnDestruction;
-
- protected:
- ///\name Basic operations
- ///\{
-
- InstantiationPolicy()
- {
- }
-
- ///\}
-
- public:
- ///\name Singleton operations
- ///\{
-
- /**
- * Fetch our instance.
- */
- static OurType_ * get_instance()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- /**
- * Destroy our instance.
- */
- static void destroy_instance();
-
- ///\}
- };
-}
-
-#endif
diff --git a/paludis/util/log.cc b/paludis/util/log.cc
index d4be1d8..6217e45 100644
--- a/paludis/util/log.cc
+++ b/paludis/util/log.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, 2010 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,7 +21,7 @@
#include <exception>
#include <paludis/util/log.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/action_queue.hh>
#include "config.h"
@@ -37,7 +37,7 @@ using namespace paludis;
#include <paludis/util/log-se.cc>
-template class InstantiationPolicy<Log, instantiation_method::SingletonTag>;
+template class Singleton<Log>;
namespace paludis
{
diff --git a/paludis/util/log.hh b/paludis/util/log.hh
index 66eecbb..bf4b911 100644
--- a/paludis/util/log.hh
+++ b/paludis/util/log.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 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
@@ -20,11 +20,11 @@
#ifndef PALUDIS_GUARD_PALUDIS_LOG_HH
#define PALUDIS_GUARD_PALUDIS_LOG_HH 1
-#include <iosfwd>
-#include <string>
#include <paludis/util/stringify.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/util/private_implementation_pattern.hh>
+#include <iosfwd>
+#include <string>
/** \file
* Declarations for Log and related classes.
@@ -48,10 +48,10 @@ namespace paludis
* \ingroup g_log
*/
class PALUDIS_VISIBLE Log :
- public InstantiationPolicy<Log, instantiation_method::SingletonTag>,
+ public Singleton<Log>,
private PrivateImplementationPattern<Log>
{
- friend class InstantiationPolicy<Log, instantiation_method::SingletonTag>;
+ friend class Singleton<Log>;
friend class LogMessageHandler;
private:
diff --git a/paludis/util/map.hh b/paludis/util/map.hh
index c6681d0..4bca7d3 100644
--- a/paludis/util/map.hh
+++ b/paludis/util/map.hh
@@ -22,7 +22,6 @@
#include <paludis/util/map-fwd.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/wrapped_output_iterator-fwd.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -51,8 +50,7 @@ namespace paludis
*/
template <typename K_, typename V_, typename C_>
class PALUDIS_VISIBLE Map :
- private PrivateImplementationPattern<Map<K_, V_, C_> >,
- private InstantiationPolicy<Map<K_, V_, C_>, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<Map<K_, V_, C_> >
{
private:
using PrivateImplementationPattern<Map<K_, V_, C_> >::_imp;
@@ -64,6 +62,9 @@ namespace paludis
Map();
~Map();
+ Map(const Map &) = delete;
+ Map & operator= (const Map &) = delete;
+
///\}
///\name Iteration
diff --git a/paludis/util/sequence.hh b/paludis/util/sequence.hh
index d9fc012..a558961 100644
--- a/paludis/util/sequence.hh
+++ b/paludis/util/sequence.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2009, 2010 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
@@ -20,9 +20,9 @@
#ifndef PALUDIS_GUARD_PALUDIS_UTIL_SEQUENCE_HH
#define PALUDIS_GUARD_PALUDIS_UTIL_SEQUENCE_HH 1
+#include <paludis/util/attributes.hh>
#include <paludis/util/sequence-fwd.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_output_iterator-fwd.hh>
@@ -48,8 +48,7 @@ namespace paludis
*/
template <typename T_>
class PALUDIS_VISIBLE Sequence :
- private PrivateImplementationPattern<Sequence<T_> >,
- private InstantiationPolicy<Sequence<T_>, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<Sequence<T_> >
{
private:
using PrivateImplementationPattern<Sequence<T_> >::_imp;
@@ -70,6 +69,9 @@ namespace paludis
Sequence();
~Sequence();
+ Sequence(const Sequence &) = delete;
+ Sequence & operator= (const Sequence &) = delete;
+
///\}
///\name Iteration
diff --git a/paludis/util/set.hh b/paludis/util/set.hh
index a1c3932..65efaf0 100644
--- a/paludis/util/set.hh
+++ b/paludis/util/set.hh
@@ -23,7 +23,6 @@
#include <paludis/util/set-fwd.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/util/wrapped_output_iterator-fwd.hh>
#include <string>
@@ -49,8 +48,7 @@ namespace paludis
*/
template <typename T_, typename C_>
class PALUDIS_VISIBLE Set :
- private PrivateImplementationPattern<Set<T_, C_> >,
- private InstantiationPolicy<Set<T_, C_>, instantiation_method::NonCopyableTag>
+ private PrivateImplementationPattern<Set<T_, C_> >
{
private:
using PrivateImplementationPattern<Set<T_, C_> >::_imp;
@@ -73,6 +71,9 @@ namespace paludis
Set();
~Set();
+ Set(const Set &) = delete;
+ Set & operator= (const Set &) = delete;
+
///\}
///\name Iteration
diff --git a/paludis/util/instantiation_policy-impl.hh b/paludis/util/singleton-impl.hh
index 7c590f2..75875df 100644
--- a/paludis/util/instantiation_policy-impl.hh
+++ b/paludis/util/singleton-impl.hh
@@ -17,30 +17,24 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_PALUDIS_UTIL_INSTANTIATION_POLICY_IMPL_HH
-#define PALUDIS_GUARD_PALUDIS_UTIL_INSTANTIATION_POLICY_IMPL_HH 1
+#ifndef PALUDIS_GUARD_PALUDIS_UTIL_SINGLETON_IMPL_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_SINGLETON_IMPL_HH 1
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/save.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/mutex.hh>
-/** \file
- * Implementation for paludis/util/instantiation_policy.hh .
- *
- * \ingroup g_oo
- */
-
template <typename OurType_>
void
-paludis::InstantiationPolicy<OurType_, paludis::instantiation_method::SingletonTag>::_delete(OurType_ * const p)
+paludis::Singleton<OurType_>::_delete(OurType_ * const p)
{
delete p;
}
template <typename OurType_>
-class paludis::InstantiationPolicy<OurType_, paludis::instantiation_method::SingletonTag>::DeleteOnDestruction
+class paludis::Singleton<OurType_>::DeleteOnDestruction
{
private:
OurType_ * * const _ptr;
@@ -53,14 +47,14 @@ class paludis::InstantiationPolicy<OurType_, paludis::instantiation_method::Sing
~DeleteOnDestruction()
{
- paludis::InstantiationPolicy<OurType_, paludis::instantiation_method::SingletonTag>::_delete(* _ptr);
+ paludis::Singleton<OurType_>::_delete(* _ptr);
* _ptr = 0;
}
};
template<typename OurType_>
OurType_ * *
-paludis::InstantiationPolicy<OurType_, paludis::instantiation_method::SingletonTag>::_get_instance_ptr()
+paludis::Singleton<OurType_>::_get_instance_ptr()
{
static OurType_ * instance(0);
static DeleteOnDestruction delete_instance(&instance);
@@ -70,7 +64,7 @@ paludis::InstantiationPolicy<OurType_, paludis::instantiation_method::SingletonT
template<typename OurType_>
OurType_ *
-paludis::InstantiationPolicy<OurType_, paludis::instantiation_method::SingletonTag>::get_instance()
+paludis::Singleton<OurType_>::get_instance()
{
static Mutex m;
Lock l(m);
@@ -92,7 +86,7 @@ paludis::InstantiationPolicy<OurType_, paludis::instantiation_method::SingletonT
template<typename OurType_>
void
-paludis::InstantiationPolicy<OurType_, paludis::instantiation_method::SingletonTag>::destroy_instance()
+paludis::Singleton<OurType_>::destroy_instance()
{
OurType_ * * i(_get_instance_ptr());
delete *i;
diff --git a/paludis/util/singleton.hh b/paludis/util/singleton.hh
new file mode 100644
index 0000000..7d21349
--- /dev/null
+++ b/paludis/util/singleton.hh
@@ -0,0 +1,84 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006, 2007, 2010 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_SINGLETON_HH
+#define PALUDIS_GUARD_PALUDIS_SINGLETON_HH 1
+
+#include <paludis/util/attributes.hh>
+
+/** \file
+ * Singleton pattern.
+ *
+ * \ingroup g_oo
+ *
+ * \section Examples
+ *
+ * - None at this time.
+ */
+
+namespace paludis
+{
+ /**
+ * Singletons have a single instance and are created when first used.
+ *
+ * \ingroup g_oo
+ * \nosubgrouping
+ */
+ template <typename OurType_>
+ class PALUDIS_VISIBLE Singleton
+ {
+ private:
+ static OurType_ * * _get_instance_ptr();
+
+ class DeleteOnDestruction;
+ friend class DeleteOnDestruction;
+
+ static void _delete(OurType_ * const p);
+
+ class DeleteOnDestruction;
+
+ public:
+ ///\name Basic operations
+ ///\{
+
+ Singleton() = default;
+ Singleton(const Singleton &) = delete;
+ const Singleton & operator= (const Singleton &) = delete;
+
+ ///\}
+
+ ///\name Singleton operations
+ ///\{
+
+ /**
+ * Fetch our instance.
+ */
+ static OurType_ * get_instance()
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ /**
+ * Destroy our instance.
+ */
+ static void destroy_instance();
+
+ ///\}
+ };
+}
+
+#endif
diff --git a/paludis/util/instantiation_policy_TEST.cc b/paludis/util/singleton_TEST.cc
index 9e8c447..388611d 100644
--- a/paludis/util/instantiation_policy_TEST.cc
+++ b/paludis/util/singleton_TEST.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, 2010 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
@@ -17,8 +17,8 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/util/instantiation_policy.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/util/thread.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/make_shared_ptr.hh>
@@ -34,17 +34,12 @@
using namespace test;
using namespace paludis;
-/** \file
- * Test cases for instantiation_policy.hh .
- *
- */
-
namespace
{
class MyClass :
- public InstantiationPolicy<MyClass, instantiation_method::SingletonTag>
+ public Singleton<MyClass>
{
- friend class InstantiationPolicy<MyClass, instantiation_method::SingletonTag>;
+ friend class Singleton<MyClass>;
private:
MyClass()
@@ -61,9 +56,9 @@ namespace
int MyClass::instances = 0;
class MyClassTwo :
- public InstantiationPolicy<MyClassTwo, instantiation_method::SingletonTag>
+ public Singleton<MyClassTwo>
{
- friend class InstantiationPolicy<MyClassTwo, instantiation_method::SingletonTag>;
+ friend class Singleton<MyClassTwo>;
private:
MyClassTwo()
@@ -85,9 +80,9 @@ namespace
int MyClassTwo::instances = 0;
class MyRecursiveClass :
- public InstantiationPolicy<MyRecursiveClass, instantiation_method::SingletonTag>
+ public Singleton<MyRecursiveClass>
{
- friend class InstantiationPolicy<MyRecursiveClass, instantiation_method::SingletonTag>;
+ friend class Singleton<MyRecursiveClass>;
public:
std::string s;
@@ -100,9 +95,9 @@ namespace
};
class MyThreadedClass :
- public InstantiationPolicy<MyThreadedClass, instantiation_method::SingletonTag>
+ public Singleton<MyThreadedClass>
{
- friend class InstantiationPolicy<MyThreadedClass, instantiation_method::SingletonTag>;
+ friend class Singleton<MyThreadedClass>;
private:
MyThreadedClass()
diff --git a/paludis/util/tokeniser.hh b/paludis/util/tokeniser.hh
index 6600d00..91168e1 100644
--- a/paludis/util/tokeniser.hh
+++ b/paludis/util/tokeniser.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2010 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,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_TOKENISER_HH 1
#include <iterator>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
#include <string>
diff --git a/paludis/version_operator.hh b/paludis/version_operator.hh
index acd146d..a548c60 100644
--- a/paludis/version_operator.hh
+++ b/paludis/version_operator.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2010 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
@@ -20,7 +20,6 @@
#ifndef PALUDIS_GUARD_PALUDIS_VERSION_OPERATOR_HH
#define PALUDIS_GUARD_PALUDIS_VERSION_OPERATOR_HH 1
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/operators.hh>
#include <paludis/util/exception.hh>
#include <paludis/version_operator-fwd.hh>
diff --git a/python/dep_spec.hh b/python/dep_spec.hh
index c99f047..466bc3e 100644
--- a/python/dep_spec.hh
+++ b/python/dep_spec.hh
@@ -46,7 +46,6 @@ namespace paludis
class PythonNamedSetDepSpec;
class PALUDIS_VISIBLE PythonDepSpec :
- private InstantiationPolicy<PythonDepSpec, instantiation_method::NonCopyableTag>,
public virtual DeclareAbstractAcceptMethods<PythonDepSpec, MakeTypeList<
PythonAnyDepSpec,
PythonAllDepSpec,
@@ -68,6 +67,9 @@ namespace paludis
public:
virtual ~PythonDepSpec();
+
+ PythonDepSpec(const PythonDepSpec &) = delete;
+ PythonDepSpec & operator= (const PythonDepSpec &) = delete;
};
class PALUDIS_VISIBLE PythonCompositeDepSpec :
@@ -271,8 +273,7 @@ namespace paludis
/**
* Used to convert one of the SpecTrees to PythonDepSpec.
*/
- class SpecTreeToPython :
- private InstantiationPolicy<SpecTreeToPython, instantiation_method::NonCopyableTag>
+ class SpecTreeToPython
{
private:
std::tr1::shared_ptr<PythonCompositeDepSpec> _current_parent;
@@ -282,6 +283,9 @@ namespace paludis
virtual ~SpecTreeToPython();
+ SpecTreeToPython(const SpecTreeToPython &) = delete;
+ SpecTreeToPython & operator= (const SpecTreeToPython &) = delete;
+
const std::tr1::shared_ptr<const PythonDepSpec> result() const;
void visit(const GenericSpecTree::NodeType<AllDepSpec>::Type &);
@@ -304,8 +308,7 @@ namespace paludis
* Used to convert Python*DepSpec to one of the SpecTrees.
*/
template <typename H_>
- class SpecTreeFromPython :
- private InstantiationPolicy<SpecTreeFromPython<H_>, instantiation_method::NonCopyableTag>
+ class SpecTreeFromPython
{
private:
std::tr1::shared_ptr<H_> _result;
@@ -316,6 +319,9 @@ namespace paludis
virtual ~SpecTreeFromPython();
+ SpecTreeFromPython(const SpecTreeFromPython &) = delete;
+ SpecTreeFromPython & operator= (const SpecTreeFromPython &) = delete;
+
std::tr1::shared_ptr<H_> result() const;
void visit(const PythonAllDepSpec &);
diff --git a/python/exception.cc b/python/exception.cc
index da5e05a..070c688 100644
--- a/python/exception.cc
+++ b/python/exception.cc
@@ -19,7 +19,7 @@
#include "exception.hh"
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
#include <python/paludis_python.hh>
#include <map>
@@ -29,7 +29,7 @@ using namespace paludis;
using namespace paludis::python;
namespace bp = boost::python;
-template class InstantiationPolicy<ExceptionRegister, instantiation_method::SingletonTag>;
+template class Singleton<ExceptionRegister>;
RegisteredExceptionBase::~RegisteredExceptionBase()
{
diff --git a/python/exception.hh b/python/exception.hh
index a9272c2..b59fbb6 100644
--- a/python/exception.hh
+++ b/python/exception.hh
@@ -22,7 +22,7 @@
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/exception.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton-impl.hh>
#include <boost/python.hpp>
#include <tr1/memory>
#include <tr1/functional>
@@ -89,10 +89,10 @@ namespace paludis
}
class PALUDIS_VISIBLE ExceptionRegister :
- public InstantiationPolicy<ExceptionRegister, instantiation_method::SingletonTag>,
+ public Singleton<ExceptionRegister>,
private PrivateImplementationPattern<ExceptionRegister>
{
- friend class InstantiationPolicy<ExceptionRegister, instantiation_method::SingletonTag>;
+ friend class Singleton<ExceptionRegister>;
private:
ExceptionRegister();
diff --git a/ruby/paludis_ruby.cc b/ruby/paludis_ruby.cc
index 7eca224..8cd497c 100644
--- a/ruby/paludis_ruby.cc
+++ b/ruby/paludis_ruby.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
* Copyright (c) 2006, 2007, 2008 Richard Brown
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -20,7 +20,7 @@
#include <paludis_ruby.hh>
#include <paludis/util/config_file.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/dep_list_exceptions.hh>
#include <paludis/match_package.hh>
@@ -36,7 +36,7 @@
using namespace paludis;
using namespace paludis::ruby;
-template class InstantiationPolicy<RegisterRubyClass, instantiation_method::SingletonTag>;
+template class Singleton<RegisterRubyClass>;
namespace paludis
{
diff --git a/ruby/paludis_ruby.hh b/ruby/paludis_ruby.hh
index 40234e6..a40cf10 100644
--- a/ruby/paludis_ruby.hh
+++ b/ruby/paludis_ruby.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
* Copyright (c) 2006, 2007, 2008 Richard Brown
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -23,11 +23,11 @@
#include "config.h"
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/fs_entry.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/environment.hh>
#include <paludis/environments/no_config/no_config_environment.hh>
#include <paludis/repository.hh>
@@ -150,10 +150,10 @@ namespace paludis
/* registration */
class RegisterRubyClass :
- public InstantiationPolicy<RegisterRubyClass, instantiation_method::SingletonTag>,
+ public Singleton<RegisterRubyClass>,
private PrivateImplementationPattern<RegisterRubyClass>
{
- friend class InstantiationPolicy<RegisterRubyClass, instantiation_method::SingletonTag>;
+ friend class Singleton<RegisterRubyClass>;
private:
RegisterRubyClass();
@@ -166,8 +166,7 @@ namespace paludis
void execute() const;
};
- class RegisterRubyClass::Register :
- public InstantiationPolicy<RegisterRubyClass, instantiation_method::NonCopyableTag>
+ class RegisterRubyClass::Register
{
public:
Register(void (* func)());
diff --git a/src/clients/accerso/command_line.cc b/src/clients/accerso/command_line.cc
index 74f94d2..d6d96ee 100644
--- a/src/clients/accerso/command_line.cc
+++ b/src/clients/accerso/command_line.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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
@@ -18,11 +18,11 @@
*/
#include "command_line.hh"
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
using namespace paludis;
-template class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>;
+template class Singleton<CommandLine>;
CommandLine::CommandLine() :
ArgsHandler(),
diff --git a/src/clients/accerso/command_line.hh b/src/clients/accerso/command_line.hh
index 4964f5b..cd5c572 100644
--- a/src/clients/accerso/command_line.hh
+++ b/src/clients/accerso/command_line.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010 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,15 +21,15 @@
#define PALUDIS_GUARD_SRC_CLIENTS_ACCERSO_COMMAND_LINE_HH 1
#include <paludis/args/args.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/args/log_level_arg.hh>
#include <paludis/args/deps_option_arg.hh>
class CommandLine :
public paludis::args::ArgsHandler,
- public paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>
+ public paludis::Singleton<CommandLine>
{
- friend class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>;
+ friend class paludis::Singleton<CommandLine>;
private:
CommandLine();
diff --git a/src/clients/adjutrix/command_line.cc b/src/clients/adjutrix/command_line.cc
index 2fa4b3f..4f5e668 100644
--- a/src/clients/adjutrix/command_line.cc
+++ b/src/clients/adjutrix/command_line.cc
@@ -19,9 +19,9 @@
#include "command_line.hh"
#include <paludis/name.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
-template class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>;
+template class paludis::Singleton<CommandLine>;
CommandLine::CommandLine() :
ArgsHandler(),
diff --git a/src/clients/adjutrix/command_line.hh b/src/clients/adjutrix/command_line.hh
index 4614ad2..838b57f 100644
--- a/src/clients/adjutrix/command_line.hh
+++ b/src/clients/adjutrix/command_line.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 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,7 +21,7 @@
#define PALUDIS_GUARD_SRC_ARCHTOOL_COMMAND_LINE_HH 1
#include <paludis/args/args.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/args/log_level_arg.hh>
/** \file
@@ -33,9 +33,9 @@
*/
class CommandLine :
public paludis::args::ArgsHandler,
- public paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>
+ public paludis::Singleton<CommandLine>
{
- friend class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>;
+ friend class paludis::Singleton<CommandLine>;
private:
/// Constructor.
diff --git a/src/clients/appareo/command_line.cc b/src/clients/appareo/command_line.cc
index b8441ab..356bf81 100644
--- a/src/clients/appareo/command_line.cc
+++ b/src/clients/appareo/command_line.cc
@@ -19,11 +19,11 @@
*/
#include "command_line.hh"
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
using namespace paludis;
-template class InstantiationPolicy<CommandLine, instantiation_method::SingletonTag>;
+template class Singleton<CommandLine>;
CommandLine::CommandLine() :
ArgsHandler(),
diff --git a/src/clients/appareo/command_line.hh b/src/clients/appareo/command_line.hh
index cdd78b1..7a57db2 100644
--- a/src/clients/appareo/command_line.hh
+++ b/src/clients/appareo/command_line.hh
@@ -2,7 +2,7 @@
/*
* Copyright (c) 2009 Kim Højgaard-Hansen
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010 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,15 +22,15 @@
#define PALUDIS_GUARD_SRC_CLIENTS_APPAREO_COMMAND_LINE_HH 1
#include <paludis/args/args.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/args/log_level_arg.hh>
#include <paludis/args/deps_option_arg.hh>
class CommandLine :
public paludis::args::ArgsHandler,
- public paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>
+ public paludis::Singleton<CommandLine>
{
- friend class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>;
+ friend class paludis::Singleton<CommandLine>;
private:
CommandLine();
diff --git a/src/clients/cave/cmd_match.cc b/src/clients/cave/cmd_match.cc
index fac9659..a5f3ca9 100644
--- a/src/clients/cave/cmd_match.cc
+++ b/src/clients/cave/cmd_match.cc
@@ -31,7 +31,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/iterator_funcs.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/generator.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/filter.hh>
@@ -64,7 +64,7 @@ using std::endl;
namespace
{
struct ExtrasHandle :
- InstantiationPolicy<ExtrasHandle, instantiation_method::SingletonTag>
+ Singleton<ExtrasHandle>
{
typedef bool (* MatchFunction)(const std::string &, const std::string &);
diff --git a/src/clients/cave/command_factory.cc b/src/clients/cave/command_factory.cc
index 8a9772e..ef8ccbb 100644
--- a/src/clients/cave/command_factory.cc
+++ b/src/clients/cave/command_factory.cc
@@ -20,7 +20,7 @@
#include "command_factory.hh"
#include "script_command.hh"
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
@@ -211,7 +211,7 @@ UnknownCommand::UnknownCommand(const std::string & s) throw () :
{
}
-template class InstantiationPolicy<CommandFactory, instantiation_method::SingletonTag>;
+template class Singleton<CommandFactory>;
template class PrivateImplementationPattern<CommandFactory>;
template class WrappedForwardIterator<CommandFactory::ConstIteratorTag, const std::string>;
diff --git a/src/clients/cave/command_factory.hh b/src/clients/cave/command_factory.hh
index 780e168..63e7c82 100644
--- a/src/clients/cave/command_factory.hh
+++ b/src/clients/cave/command_factory.hh
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_SRC_CLIENTS_CAVE_COMMAND_FACTORY_HH
#define PALUDIS_GUARD_SRC_CLIENTS_CAVE_COMMAND_FACTORY_HH 1
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/exception.hh>
@@ -41,9 +41,9 @@ namespace paludis
class PALUDIS_VISIBLE CommandFactory :
private PrivateImplementationPattern<CommandFactory>,
- public InstantiationPolicy<CommandFactory, instantiation_method::SingletonTag>
+ public Singleton<CommandFactory>
{
- friend class InstantiationPolicy<CommandFactory, instantiation_method::SingletonTag>;
+ friend class Singleton<CommandFactory>;
private:
CommandFactory();
@@ -60,7 +60,7 @@ namespace paludis
};
}
- extern template class InstantiationPolicy<cave::CommandFactory, instantiation_method::SingletonTag>;
+ extern template class Singleton<cave::CommandFactory>;
extern template class PrivateImplementationPattern<cave::CommandFactory>;
}
diff --git a/src/clients/importare/command_line.cc b/src/clients/importare/command_line.cc
index 410442b..fdb9dc4 100644
--- a/src/clients/importare/command_line.cc
+++ b/src/clients/importare/command_line.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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
@@ -18,11 +18,11 @@
*/
#include "command_line.hh"
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
using namespace paludis;
-template class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>;
+template class paludis::Singleton<CommandLine>;
CommandLine::CommandLine() :
ArgsHandler(),
diff --git a/src/clients/importare/command_line.hh b/src/clients/importare/command_line.hh
index eb43d8a..52ad25e 100644
--- a/src/clients/importare/command_line.hh
+++ b/src/clients/importare/command_line.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010 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,16 +21,16 @@
#define PALUDIS_GUARD_SRC_CLIENTS_IMPORTARE_COMMAND_LINE_HH 1
#include <paludis/args/args.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/args/dep_list_args_group.hh>
#include <paludis/args/install_args_group.hh>
#include <paludis/args/log_level_arg.hh>
class CommandLine :
public paludis::args::ArgsHandler,
- public paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>
+ public paludis::Singleton<CommandLine>
{
- friend class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>;
+ friend class paludis::Singleton<CommandLine>;
private:
CommandLine();
diff --git a/src/clients/inquisitio/command_line.cc b/src/clients/inquisitio/command_line.cc
index 98e634e..582022e 100644
--- a/src/clients/inquisitio/command_line.cc
+++ b/src/clients/inquisitio/command_line.cc
@@ -19,11 +19,11 @@
#include "command_line.hh"
#include <paludis/name.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
using namespace paludis;
-template class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>;
+template class paludis::Singleton<CommandLine>;
CommandLine::CommandLine() :
ArgsHandler(),
diff --git a/src/clients/inquisitio/command_line.hh b/src/clients/inquisitio/command_line.hh
index ae48984..3c444af 100644
--- a/src/clients/inquisitio/command_line.hh
+++ b/src/clients/inquisitio/command_line.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010 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,14 +21,14 @@
#define PALUDIS_GUARD_SRC_CLIENTS_INQUISITIO_COMMAND_LINE_HH 1
#include <paludis/args/args.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/args/log_level_arg.hh>
class CommandLine :
public paludis::args::ArgsHandler,
- public paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>
+ public paludis::Singleton<CommandLine>
{
- friend class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>;
+ friend class paludis::Singleton<CommandLine>;
private:
CommandLine();
diff --git a/src/clients/inquisitio/extractor.hh b/src/clients/inquisitio/extractor.hh
index d2546da..7264784 100644
--- a/src/clients/inquisitio/extractor.hh
+++ b/src/clients/inquisitio/extractor.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2010 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,15 +21,13 @@
#define PALUDIS_GUARD_SRC_CLIENTS_INQUISITIO_EXTRACTOR_HH 1
#include <string>
-#include <paludis/util/instantiation_policy.hh>
#include <paludis/package_id-fwd.hh>
namespace inquisitio
{
class Matcher;
- class Extractor :
- private paludis::InstantiationPolicy<Extractor, paludis::instantiation_method::NonCopyableTag>
+ class Extractor
{
protected:
Extractor();
diff --git a/src/clients/inquisitio/matcher.cc b/src/clients/inquisitio/matcher.cc
index 75ab3a4..3f684a1 100644
--- a/src/clients/inquisitio/matcher.cc
+++ b/src/clients/inquisitio/matcher.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010 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,12 +22,12 @@
#include "pcre_matcher.hh"
#include "text_matcher.hh"
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
using namespace inquisitio;
using namespace paludis;
-template class paludis::InstantiationPolicy<MatcherFactory, paludis::instantiation_method::SingletonTag>;
+template class paludis::Singleton<MatcherFactory>;
Matcher::Matcher()
{
diff --git a/src/clients/inquisitio/matcher.hh b/src/clients/inquisitio/matcher.hh
index 70d5fcd..6332838 100644
--- a/src/clients/inquisitio/matcher.hh
+++ b/src/clients/inquisitio/matcher.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010 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
@@ -20,15 +20,14 @@
#ifndef PALUDIS_GUARD_SRC_CLIENTS_INQUISITIO_MATCHER_HH
#define PALUDIS_GUARD_SRC_CLIENTS_INQUISITIO_MATCHER_HH 1
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/util/exception.hh>
#include <string>
#include <tr1/memory>
namespace inquisitio
{
- class Matcher :
- private paludis::InstantiationPolicy<Matcher, paludis::instantiation_method::NonCopyableTag>
+ class Matcher
{
protected:
Matcher();
@@ -49,9 +48,9 @@ namespace inquisitio
};
class MatcherFactory :
- public paludis::InstantiationPolicy<MatcherFactory, paludis::instantiation_method::SingletonTag>
+ public paludis::Singleton<MatcherFactory>
{
- friend class paludis::InstantiationPolicy<MatcherFactory, paludis::instantiation_method::SingletonTag>;
+ friend class paludis::Singleton<MatcherFactory>;
private:
MatcherFactory();
diff --git a/src/clients/instruo/command_line.cc b/src/clients/instruo/command_line.cc
index 506b342..e2db4c1 100644
--- a/src/clients/instruo/command_line.cc
+++ b/src/clients/instruo/command_line.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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
@@ -18,11 +18,11 @@
*/
#include "command_line.hh"
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
using namespace paludis;
-template class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>;
+template class paludis::Singleton<CommandLine>;
CommandLine::CommandLine() :
ArgsHandler(),
diff --git a/src/clients/instruo/command_line.hh b/src/clients/instruo/command_line.hh
index b54ecd9..3a1a427 100644
--- a/src/clients/instruo/command_line.hh
+++ b/src/clients/instruo/command_line.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010 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,15 +21,15 @@
#define PALUDIS_GUARD_SRC_CLIENTS_INSTRUO_COMMAND_LINE_HH 1
#include <paludis/args/args.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/args/log_level_arg.hh>
#include <paludis/args/deps_option_arg.hh>
class CommandLine :
public paludis::args::ArgsHandler,
- public paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>
+ public paludis::Singleton<CommandLine>
{
- friend class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>;
+ friend class paludis::Singleton<CommandLine>;
private:
CommandLine();
diff --git a/src/clients/paludis/command_line.cc b/src/clients/paludis/command_line.cc
index df0f432..762c3ee 100644
--- a/src/clients/paludis/command_line.cc
+++ b/src/clients/paludis/command_line.cc
@@ -18,11 +18,11 @@
*/
#include "command_line.hh"
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
using namespace paludis;
-template class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>;
+template class paludis::Singleton<CommandLine>;
CommandLine::CommandLine() :
ArgsHandler(),
diff --git a/src/clients/paludis/command_line.hh b/src/clients/paludis/command_line.hh
index a62a57c..b7514d4 100644
--- a/src/clients/paludis/command_line.hh
+++ b/src/clients/paludis/command_line.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, 2010 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,7 +21,7 @@
#define PALUDIS_GUARD_SRC_COMMAND_LINE_HH 1
#include <paludis/args/args.hh>
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/args/dep_list_args_group.hh>
#include <paludis/args/install_args_group.hh>
#include <paludis/args/log_level_arg.hh>
@@ -35,9 +35,9 @@
*/
class CommandLine :
public paludis::args::ArgsHandler,
- public paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>
+ public paludis::Singleton<CommandLine>
{
- friend class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>;
+ friend class paludis::Singleton<CommandLine>;
private:
/// Constructor.
diff --git a/src/clients/reconcilio/command_line.cc b/src/clients/reconcilio/command_line.cc
index 57e7c86..e458c33 100644
--- a/src/clients/reconcilio/command_line.cc
+++ b/src/clients/reconcilio/command_line.cc
@@ -19,11 +19,11 @@
#include "command_line.hh"
-#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/singleton-impl.hh>
using namespace paludis;
-template class InstantiationPolicy<CommandLine, instantiation_method::SingletonTag>;
+template class Singleton<CommandLine>;
CommandLine::CommandLine() :
ArgsHandler(),
diff --git a/src/clients/reconcilio/command_line.hh b/src/clients/reconcilio/command_line.hh
index 2bcd6d4..9642bc0 100644
--- a/src/clients/reconcilio/command_line.hh
+++ b/src/clients/reconcilio/command_line.hh
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_RECONCILIO_COMMAND_LINE_HH
#define PALUDIS_GUARD_RECONCILIO_COMMAND_LINE_HH
-#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/singleton.hh>
#include <paludis/args/args.hh>
#include <paludis/args/dep_list_args_group.hh>
@@ -29,9 +29,9 @@
class CommandLine :
public paludis::args::ArgsHandler,
- public paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>
+ public paludis::Singleton<CommandLine>
{
- friend class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>;
+ friend class paludis::Singleton<CommandLine>;
private:
CommandLine();