aboutsummaryrefslogtreecommitdiff
path: root/paludis/util
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-09 10:23:12 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-09 10:23:12 +0000
commit7a2c9e974666881f44406c88189ae546a67ff0b7 (patch)
treef6846da02bf779a262f58e5042f3fa1bbf7415d3 /paludis/util
parent7f7c79fcc67df4fae498ca943e36592d3f7a3ad2 (diff)
downloadpaludis-7a2c9e974666881f44406c88189ae546a67ff0b7.tar.gz
paludis-7a2c9e974666881f44406c88189ae546a67ff0b7.tar.xz
Rework Pimp to avoid ImpPtr ickiness
Fixes: ticket:1070
Diffstat (limited to 'paludis/util')
-rw-r--r--paludis/util/action_queue.cc8
-rw-r--r--paludis/util/action_queue.hh8
-rw-r--r--paludis/util/buffer_output_stream.cc4
-rw-r--r--paludis/util/buffer_output_stream.hh6
-rw-r--r--paludis/util/config_file.cc20
-rw-r--r--paludis/util/config_file.hh20
-rw-r--r--paludis/util/damerau_levenshtein.cc6
-rw-r--r--paludis/util/damerau_levenshtein.hh6
-rw-r--r--paludis/util/elf.cc2
-rw-r--r--paludis/util/elf.hh7
-rw-r--r--paludis/util/elf_dynamic_section.cc4
-rw-r--r--paludis/util/elf_dynamic_section.hh13
-rw-r--r--paludis/util/elf_relocation_section.cc2
-rw-r--r--paludis/util/elf_relocation_section.hh6
-rw-r--r--paludis/util/elf_symbol_section.cc2
-rw-r--r--paludis/util/elf_symbol_section.hh6
-rw-r--r--paludis/util/executor.cc4
-rw-r--r--paludis/util/executor.hh7
-rw-r--r--paludis/util/fs_iterator.cc8
-rw-r--r--paludis/util/fs_iterator.hh8
-rw-r--r--paludis/util/fs_path.cc6
-rw-r--r--paludis/util/fs_path.hh7
-rw-r--r--paludis/util/fs_stat.cc6
-rw-r--r--paludis/util/fs_stat.hh8
-rw-r--r--paludis/util/graph-impl.hh6
-rw-r--r--paludis/util/graph.hh7
-rw-r--r--paludis/util/log.cc6
-rw-r--r--paludis/util/log.hh9
-rw-r--r--paludis/util/map-impl.hh4
-rw-r--r--paludis/util/map.hh7
-rw-r--r--paludis/util/pimp-impl.hh26
-rw-r--r--paludis/util/pimp.hh77
-rw-r--r--paludis/util/process.cc14
-rw-r--r--paludis/util/process.hh20
-rw-r--r--paludis/util/safe_ofstream.cc4
-rw-r--r--paludis/util/safe_ofstream.hh6
-rw-r--r--paludis/util/sequence-impl.hh4
-rw-r--r--paludis/util/sequence.hh7
-rw-r--r--paludis/util/set-impl.hh4
-rw-r--r--paludis/util/set.hh7
-rw-r--r--paludis/util/simple_parser.cc4
-rw-r--r--paludis/util/simple_parser.hh8
-rw-r--r--paludis/util/string_list_stream.cc4
-rw-r--r--paludis/util/string_list_stream.hh6
-rw-r--r--paludis/util/tail_output_stream.cc4
-rw-r--r--paludis/util/tail_output_stream.hh7
-rw-r--r--paludis/util/tee_output_stream.cc4
-rw-r--r--paludis/util/tee_output_stream.hh8
-rw-r--r--paludis/util/thread_pool.cc6
-rw-r--r--paludis/util/thread_pool.hh10
-rw-r--r--paludis/util/wildcard_expander.cc8
-rw-r--r--paludis/util/wildcard_expander.hh8
52 files changed, 232 insertions, 227 deletions
diff --git a/paludis/util/action_queue.cc b/paludis/util/action_queue.cc
index 1a30cd940..615c752d7 100644
--- a/paludis/util/action_queue.cc
+++ b/paludis/util/action_queue.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010, 2011 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
@@ -27,8 +27,6 @@
using namespace paludis;
-template class Pimp<ActionQueue>;
-
namespace paludis
{
template <>
@@ -89,7 +87,7 @@ namespace paludis
}
ActionQueue::ActionQueue(const unsigned n_threads, const bool nice, const bool limit_size) :
- Pimp<ActionQueue>(n_threads, nice, limit_size)
+ _imp(n_threads, nice, limit_size)
{
}
@@ -135,3 +133,5 @@ ActionQueue::number_of_threads() const
return _imp->threads.number_of_threads();
}
+template class Pimp<ActionQueue>;
+
diff --git a/paludis/util/action_queue.hh b/paludis/util/action_queue.hh
index 421afe653..479cff502 100644
--- a/paludis/util/action_queue.hh
+++ b/paludis/util/action_queue.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010, 2011 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
@@ -36,9 +36,11 @@ namespace paludis
* \since 0.26
* \nosubgrouping
*/
- class PALUDIS_VISIBLE ActionQueue :
- private Pimp<ActionQueue>
+ class PALUDIS_VISIBLE ActionQueue
{
+ private:
+ Pimp<ActionQueue> _imp;
+
public:
///\name Basic operations
///\{
diff --git a/paludis/util/buffer_output_stream.cc b/paludis/util/buffer_output_stream.cc
index 0026fb117..1de4224ed 100644
--- a/paludis/util/buffer_output_stream.cc
+++ b/paludis/util/buffer_output_stream.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 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
@@ -43,7 +43,7 @@ namespace paludis
}
BufferOutputStreamBuf::BufferOutputStreamBuf() :
- Pimp<BufferOutputStreamBuf>()
+ _imp()
{
setg(0, 0, 0);
}
diff --git a/paludis/util/buffer_output_stream.hh b/paludis/util/buffer_output_stream.hh
index 987004583..1aafc70bd 100644
--- a/paludis/util/buffer_output_stream.hh
+++ b/paludis/util/buffer_output_stream.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -28,9 +28,11 @@
namespace paludis
{
class PALUDIS_VISIBLE BufferOutputStreamBuf :
- private Pimp<BufferOutputStreamBuf>,
public std::streambuf
{
+ private:
+ Pimp<BufferOutputStreamBuf> _imp;
+
protected:
virtual int_type overflow(int_type c);
virtual std::streamsize xsputn(const char * s, std::streamsize num);
diff --git a/paludis/util/config_file.cc b/paludis/util/config_file.cc
index 90dd0ef81..012311838 100644
--- a/paludis/util/config_file.cc
+++ b/paludis/util/config_file.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
* Copyright (c) 2006 Danny van Dyk
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -111,22 +111,22 @@ namespace paludis
}
ConfigFile::Source::Source(const FSPath & f) :
- Pimp<ConfigFile::Source>(f)
+ _imp(f)
{
}
ConfigFile::Source::Source(const std::string & f) :
- Pimp<ConfigFile::Source>(f)
+ _imp(f)
{
}
ConfigFile::Source::Source(std::istream & f) :
- Pimp<ConfigFile::Source>(f)
+ _imp(f)
{
}
ConfigFile::Source::Source(const ConfigFile::Source & f) :
- Pimp<ConfigFile::Source>(f._imp->filename, f._imp->text)
+ _imp(f._imp->filename, f._imp->text)
{
}
@@ -157,8 +157,6 @@ ConfigFile::Source::filename() const
return _imp->filename;
}
-template class Pimp<ConfigFile::Source>;
-
ConfigFile::~ConfigFile()
{
}
@@ -191,7 +189,7 @@ namespace
}
LineConfigFile::LineConfigFile(const Source & sr, const LineConfigFileOptions & o) :
- Pimp<LineConfigFile>(o)
+ _imp(o)
{
Context context("When parsing line-based configuration file '" + (sr.filename().empty() ? "?" : sr.filename()) + "':");
@@ -322,8 +320,6 @@ LineConfigFile::end() const
return ConstIterator(_imp->lines.end());
}
-template class Pimp<LineConfigFile>;
-
namespace paludis
{
template <>
@@ -576,7 +572,7 @@ KeyValueConfigFile::KeyValueConfigFile(
const KeyValueConfigFileOptions & o,
const KeyValueConfigFile::DefaultFunction & f,
const KeyValueConfigFile::TransformationFunction & i) :
- Pimp<KeyValueConfigFile>(o, f, i)
+ _imp(o, f, i)
{
Context context("When parsing key=value-based configuration file '" + (sr.filename().empty() ? "?" : sr.filename()) + "':");
@@ -872,6 +868,8 @@ KeyValueConfigFile::transformation_function() const
return _imp->transformation_function;
}
+template class Pimp<ConfigFile::Source>;
+template class Pimp<LineConfigFile>;
template class Pimp<KeyValueConfigFile>;
template class WrappedForwardIterator<LineConfigFile::ConstIteratorTag, const std::string>;
diff --git a/paludis/util/config_file.hh b/paludis/util/config_file.hh
index 10ec112b5..4429943b4 100644
--- a/paludis/util/config_file.hh
+++ b/paludis/util/config_file.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 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
@@ -100,9 +100,11 @@ namespace paludis
* \ingroup g_config_file
* \nosubgrouping
*/
- class PALUDIS_VISIBLE Source :
- private Pimp<Source>
+ class PALUDIS_VISIBLE Source
{
+ private:
+ Pimp<Source> _imp;
+
public:
///\name Basic operations
///\{
@@ -151,9 +153,11 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE LineConfigFile :
- public ConfigFile,
- private Pimp<LineConfigFile>
+ public ConfigFile
{
+ private:
+ Pimp<LineConfigFile> _imp;
+
public:
///\name Basic operations
///\{
@@ -198,9 +202,11 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE KeyValueConfigFile :
- public ConfigFile,
- private Pimp<KeyValueConfigFile>
+ public ConfigFile
{
+ private:
+ Pimp<KeyValueConfigFile> _imp;
+
public:
typedef std::function<std::string (const KeyValueConfigFile &, const std::string &)> DefaultFunction;
typedef std::function<std::string (const KeyValueConfigFile &,
diff --git a/paludis/util/damerau_levenshtein.cc b/paludis/util/damerau_levenshtein.cc
index ab4d0a5b7..9e59ea11c 100644
--- a/paludis/util/damerau_levenshtein.cc
+++ b/paludis/util/damerau_levenshtein.cc
@@ -24,8 +24,6 @@
using namespace paludis;
-template class Pimp<DamerauLevenshtein>;
-
namespace paludis
{
template <>
@@ -42,7 +40,7 @@ namespace paludis
}
DamerauLevenshtein::DamerauLevenshtein(const std::string & name) :
- Pimp<DamerauLevenshtein>(name)
+ _imp(name)
{
}
@@ -82,3 +80,5 @@ DamerauLevenshtein::distance_with(const std::string & candidate) const
return prev[_imp->n - 1];
}
+template class Pimp<DamerauLevenshtein>;
+
diff --git a/paludis/util/damerau_levenshtein.hh b/paludis/util/damerau_levenshtein.hh
index 3eb345cac..7a9afcf73 100644
--- a/paludis/util/damerau_levenshtein.hh
+++ b/paludis/util/damerau_levenshtein.hh
@@ -37,9 +37,11 @@ namespace paludis
*
* \ingroup g_utils
*/
- class PALUDIS_VISIBLE DamerauLevenshtein :
- private Pimp<DamerauLevenshtein>
+ class PALUDIS_VISIBLE DamerauLevenshtein
{
+ private:
+ Pimp<DamerauLevenshtein> _imp;
+
public:
///\name Basic Operations
///\{
diff --git a/paludis/util/elf.cc b/paludis/util/elf.cc
index 6ac07fba3..abd2a67c0 100644
--- a/paludis/util/elf.cc
+++ b/paludis/util/elf.cc
@@ -265,7 +265,7 @@ ElfObject<ElfType_>::is_valid_elf(std::istream & stream)
template <typename ElfType_>
ElfObject<ElfType_>::ElfObject(std::istream & stream) :
- Pimp<ElfObject>()
+ _imp()
{
try
{
diff --git a/paludis/util/elf.hh b/paludis/util/elf.hh
index edf47015b..b3697b13f 100644
--- a/paludis/util/elf.hh
+++ b/paludis/util/elf.hh
@@ -43,12 +43,11 @@ namespace paludis
struct ElfObjectSectionIteratorTag;
template <typename ElfType_>
- class PALUDIS_VISIBLE ElfObject :
- private paludis::Pimp<ElfObject<ElfType_> >
+ class PALUDIS_VISIBLE ElfObject
{
- using paludis::Pimp<ElfObject>::_imp;
-
private:
+ Pimp<ElfObject> _imp;
+
typename ElfType_::Header _hdr;
public:
diff --git a/paludis/util/elf_dynamic_section.cc b/paludis/util/elf_dynamic_section.cc
index 57b69b9f0..5c3e83be2 100644
--- a/paludis/util/elf_dynamic_section.cc
+++ b/paludis/util/elf_dynamic_section.cc
@@ -253,7 +253,7 @@ DynamicEntryString<ElfType_>::initialize(typename ElfType_::Word index, const ty
template <typename ElfType_>
DynamicEntries<ElfType_>::DynamicEntries() :
- Pimp<DynamicEntries>()
+ _imp()
{
register_type(DT_NEEDED, std::make_shared<DynamicEntryString<ElfType_> >("NEEDED"));
register_type(DT_RPATH, std::make_shared<DynamicEntryString<ElfType_> >("RPATH"));
@@ -297,7 +297,7 @@ DynamicEntries<ElfType_>::has_entry(typename ElfType_::DynamicTag identifier) co
template <typename ElfType_>
DynamicSection<ElfType_>::DynamicSection(typename ElfType_::Word index, const typename ElfType_::SectionHeader & shdr, std::istream & stream, bool need_byte_swap) :
Section<ElfType_>(index, shdr),
- Pimp<DynamicSection>()
+ _imp()
{
if (sizeof(typename ElfType_::DynamicEntry) != shdr.sh_entsize)
throw InvalidElfFileError(
diff --git a/paludis/util/elf_dynamic_section.hh b/paludis/util/elf_dynamic_section.hh
index 1cb966040..6ba87f1ef 100644
--- a/paludis/util/elf_dynamic_section.hh
+++ b/paludis/util/elf_dynamic_section.hh
@@ -172,12 +172,13 @@ namespace paludis
template <typename ElfType_>
class DynamicEntries :
- public Singleton<DynamicEntries<ElfType_> >,
- private Pimp<DynamicEntries<ElfType_> >
+ public Singleton<DynamicEntries<ElfType_> >
{
- using Pimp<DynamicEntries>::_imp;
friend class Singleton<DynamicEntries>;
+ private:
+ Pimp<DynamicEntries> _imp;
+
public:
void register_type(typename ElfType_::DynamicTag, std::shared_ptr<DynamicEntry<ElfType_> >);
@@ -195,10 +196,10 @@ namespace paludis
template <typename ElfType_>
class PALUDIS_VISIBLE DynamicSection :
public Section<ElfType_>,
- public ImplementAcceptMethods<Section<ElfType_>, DynamicSection<ElfType_> >,
- private Pimp<DynamicSection<ElfType_> >
+ public ImplementAcceptMethods<Section<ElfType_>, DynamicSection<ElfType_> >
{
- using Pimp<DynamicSection>::_imp;
+ private:
+ Pimp<DynamicSection> _imp;
public:
DynamicSection(typename ElfType_::Word, const typename ElfType_::SectionHeader &, std::istream &, bool);
diff --git a/paludis/util/elf_relocation_section.cc b/paludis/util/elf_relocation_section.cc
index 566378ed3..a33c89866 100644
--- a/paludis/util/elf_relocation_section.cc
+++ b/paludis/util/elf_relocation_section.cc
@@ -101,7 +101,7 @@ template <typename ElfType_, typename Relocation_>
RelocationSection<ElfType_, Relocation_>::RelocationSection(
typename ElfType_::Word index, const typename ElfType_::SectionHeader & shdr, std::istream & stream, bool need_byte_swap) :
Section<ElfType_>(index, shdr),
- Pimp<RelocationSection>()
+ _imp()
{
if (sizeof(typename Relocation_::Type) != shdr.sh_entsize)
throw InvalidElfFileError(
diff --git a/paludis/util/elf_relocation_section.hh b/paludis/util/elf_relocation_section.hh
index ab92edfea..f995c5cbd 100644
--- a/paludis/util/elf_relocation_section.hh
+++ b/paludis/util/elf_relocation_section.hh
@@ -98,10 +98,10 @@ namespace paludis
template <typename ElfType_, typename Relocation_>
class RelocationSection :
public Section<ElfType_>,
- public paludis::ImplementAcceptMethods<Section<ElfType_>, RelocationSection<ElfType_, Relocation_> >,
- private paludis::Pimp<RelocationSection<ElfType_, Relocation_> >
+ public paludis::ImplementAcceptMethods<Section<ElfType_>, RelocationSection<ElfType_, Relocation_> >
{
- using paludis::Pimp<RelocationSection>::_imp;
+ private:
+ Pimp<RelocationSection> _imp;
public:
RelocationSection(typename ElfType_::Word, const typename ElfType_::SectionHeader &, std::istream &, bool);
diff --git a/paludis/util/elf_symbol_section.cc b/paludis/util/elf_symbol_section.cc
index 46a6e825b..87811dc85 100644
--- a/paludis/util/elf_symbol_section.cc
+++ b/paludis/util/elf_symbol_section.cc
@@ -164,7 +164,7 @@ Symbol<ElfType_>::~Symbol()
template <typename ElfType_>
SymbolSection<ElfType_>::SymbolSection(typename ElfType_::Word index, const typename ElfType_::SectionHeader & shdr, std::istream & stream, bool need_byte_swap) :
Section<ElfType_>(index, shdr),
- Pimp<SymbolSection>(),
+ _imp(),
_type("invalid")
{
if (shdr.sh_type == SHT_DYNSYM)
diff --git a/paludis/util/elf_symbol_section.hh b/paludis/util/elf_symbol_section.hh
index 4a79ef8d8..bb258114d 100644
--- a/paludis/util/elf_symbol_section.hh
+++ b/paludis/util/elf_symbol_section.hh
@@ -81,12 +81,10 @@ namespace paludis
template <typename ElfType_>
class SymbolSection :
public Section<ElfType_>,
- public paludis::ImplementAcceptMethods<Section<ElfType_>, SymbolSection<ElfType_> >,
- private paludis::Pimp<SymbolSection<ElfType_> >
+ public paludis::ImplementAcceptMethods<Section<ElfType_>, SymbolSection<ElfType_> >
{
- using paludis::Pimp<SymbolSection>::_imp;
-
private:
+ Pimp<SymbolSection> _imp;
std::string _type;
public:
diff --git a/paludis/util/executor.cc b/paludis/util/executor.cc
index d6f5566dc..37df8ec65 100644
--- a/paludis/util/executor.cc
+++ b/paludis/util/executor.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -63,7 +63,7 @@ namespace paludis
}
Executor::Executor(int ms_update_interval) :
- Pimp<Executor>(ms_update_interval)
+ _imp(ms_update_interval)
{
}
diff --git a/paludis/util/executor.hh b/paludis/util/executor.hh
index 3974fd1fd..9b61509dd 100644
--- a/paludis/util/executor.hh
+++ b/paludis/util/executor.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 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
@@ -43,10 +43,11 @@ namespace paludis
virtual void post_execute_exclusive() = 0;
};
- class PALUDIS_VISIBLE Executor :
- private Pimp<Executor>
+ class PALUDIS_VISIBLE Executor
{
private:
+ Pimp<Executor> _imp;
+
void _one(const std::shared_ptr<Executive>);
public:
diff --git a/paludis/util/fs_iterator.cc b/paludis/util/fs_iterator.cc
index dba44b809..ca5295853 100644
--- a/paludis/util/fs_iterator.cc
+++ b/paludis/util/fs_iterator.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2010, 2011 Ciaran McCreesh
* Copyright (c) 2008 Fernando J. Pereda
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -69,7 +69,7 @@ namespace paludis
}
FSIterator::FSIterator(const FSPath & base, const FSIteratorOptions & options) :
- Pimp<FSIterator>(std::shared_ptr<EntrySet>())
+ _imp(std::shared_ptr<EntrySet>())
{
using namespace std::placeholders;
@@ -173,13 +173,13 @@ FSIterator::FSIterator(const FSPath & base, const FSIteratorOptions & options) :
}
FSIterator::FSIterator(const FSIterator & other) :
- Pimp<FSIterator>(other._imp->items)
+ _imp(other._imp->items)
{
_imp->iter = other._imp->iter;
}
FSIterator::FSIterator() :
- Pimp<FSIterator>(std::shared_ptr<EntrySet>(std::make_shared<EntrySet>(&compare_name)))
+ _imp(std::shared_ptr<EntrySet>(std::make_shared<EntrySet>(&compare_name)))
{
_imp->iter = _imp->items->end();
}
diff --git a/paludis/util/fs_iterator.hh b/paludis/util/fs_iterator.hh
index 080d9a687..c751a5301 100644
--- a/paludis/util/fs_iterator.hh
+++ b/paludis/util/fs_iterator.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 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
@@ -29,11 +29,13 @@
namespace paludis
{
- class PALUDIS_VISIBLE FSIterator :
- private Pimp<FSIterator>
+ class PALUDIS_VISIBLE FSIterator
{
friend bool operator== (const FSIterator &, const FSIterator &);
+ private:
+ Pimp<FSIterator> _imp;
+
public:
explicit FSIterator();
FSIterator(const FSPath &, const FSIteratorOptions &);
diff --git a/paludis/util/fs_path.cc b/paludis/util/fs_path.cc
index 5ca38f272..f31ceacda 100644
--- a/paludis/util/fs_path.cc
+++ b/paludis/util/fs_path.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 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
@@ -60,13 +60,13 @@ namespace paludis
}
FSPath::FSPath(const std::string & path) :
- Pimp<FSPath>(path)
+ _imp(path)
{
_normalise();
}
FSPath::FSPath(const FSPath & other) :
- Pimp<FSPath>(other._imp->path)
+ _imp(other._imp->path)
{
}
diff --git a/paludis/util/fs_path.hh b/paludis/util/fs_path.hh
index 6147c14a2..f18fa610f 100644
--- a/paludis/util/fs_path.hh
+++ b/paludis/util/fs_path.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
* Copyright (c) 2006 Mark Loeser
* Copyright (c) 2008 Fernando J. Pereda
*
@@ -30,13 +30,14 @@
namespace paludis
{
- class PALUDIS_VISIBLE FSPath :
- private Pimp<FSPath>
+ class PALUDIS_VISIBLE FSPath
{
friend std::ostream & paludis::operator<< (std::ostream & s, const FSPath & f);
friend bool operator== (const FSPath &, const FSPath &);
private:
+ Pimp<FSPath> _imp;
+
void _normalise();
public:
diff --git a/paludis/util/fs_stat.cc b/paludis/util/fs_stat.cc
index 4c9aff3d8..90ded809f 100644
--- a/paludis/util/fs_stat.cc
+++ b/paludis/util/fs_stat.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -63,12 +63,12 @@ namespace paludis
FSStat::FSStat(const FSPath & p) :
- Pimp<FSStat>(p)
+ _imp(p)
{
}
FSStat::FSStat(const FSStat & p) :
- Pimp<FSStat>(p._imp->path, p._imp->exists, p._imp->st)
+ _imp(p._imp->path, p._imp->exists, p._imp->st)
{
}
diff --git a/paludis/util/fs_stat.hh b/paludis/util/fs_stat.hh
index 328ca8ed4..90fe828c4 100644
--- a/paludis/util/fs_stat.hh
+++ b/paludis/util/fs_stat.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
* Copyright (c) 2006 Mark Loeser
* Copyright (c) 2008 Fernando J. Pereda
*
@@ -32,9 +32,11 @@
namespace paludis
{
- class PALUDIS_VISIBLE FSStat :
- private Pimp<FSStat>
+ class PALUDIS_VISIBLE FSStat
{
+ private:
+ Pimp<FSStat> _imp;
+
public:
explicit FSStat(const FSPath &);
diff --git a/paludis/util/graph-impl.hh b/paludis/util/graph-impl.hh
index 6c4769d7b..78753d12a 100644
--- a/paludis/util/graph-impl.hh
+++ b/paludis/util/graph-impl.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010, 2011 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
@@ -113,13 +113,13 @@ namespace paludis
template <typename Node_, typename Edge_, typename Comparator_>
DirectedGraph<Node_, Edge_, Comparator_>::DirectedGraph() :
- Pimp<DirectedGraph<Node_, Edge_, Comparator_> >()
+ _imp()
{
}
template <typename Node_, typename Edge_, typename Comparator_>
DirectedGraph<Node_, Edge_, Comparator_>::DirectedGraph(const DirectedGraph & g) :
- Pimp<DirectedGraph<Node_, Edge_, Comparator_> >(g._imp->store)
+ _imp(g._imp->store)
{
}
diff --git a/paludis/util/graph.hh b/paludis/util/graph.hh
index 932956dcd..ee1be8715 100644
--- a/paludis/util/graph.hh
+++ b/paludis/util/graph.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010, 2011 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
@@ -144,11 +144,10 @@ namespace paludis
* \nosubgrouping
*/
template <typename Node_, typename Edge_, typename Comparator_>
- class PALUDIS_VISIBLE DirectedGraph :
- private Pimp<DirectedGraph<Node_, Edge_, Comparator_> >
+ class PALUDIS_VISIBLE DirectedGraph
{
private:
- using Pimp<DirectedGraph<Node_, Edge_, Comparator_> >::_imp;
+ Pimp<DirectedGraph<Node_, Edge_, Comparator_> > _imp;
void operator= (const DirectedGraph &);
diff --git a/paludis/util/log.cc b/paludis/util/log.cc
index 5a730fed3..5e2c1cd72 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, 2010 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2010, 2011 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
@@ -127,7 +127,7 @@ namespace paludis
}
Log::Log() :
- Pimp<Log>()
+ _imp()
{
}
@@ -217,3 +217,5 @@ LogMessageHandler::~LogMessageHandler()
_log->_message(_id, _log_level, _log_context, _message);
}
+template class Pimp<Log>;
+
diff --git a/paludis/util/log.hh b/paludis/util/log.hh
index 3d205c43c..cddd70a53 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, 2010 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 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
@@ -48,13 +48,14 @@ namespace paludis
* \ingroup g_log
*/
class PALUDIS_VISIBLE Log :
- public Singleton<Log>,
- private Pimp<Log>
+ public Singleton<Log>
{
friend class Singleton<Log>;
friend class LogMessageHandler;
private:
+ Pimp<Log> _imp;
+
Log();
void _message(const std::string & id, const LogLevel, const LogContext, const std::string &);
@@ -145,6 +146,8 @@ namespace paludis
return *this;
}
};
+
+ extern template class Pimp<Log>;
}
#endif
diff --git a/paludis/util/map-impl.hh b/paludis/util/map-impl.hh
index 09ed471de..36d38fd47 100644
--- a/paludis/util/map-impl.hh
+++ b/paludis/util/map-impl.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2009, 2010, 2011 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
@@ -74,7 +74,7 @@ namespace paludis
template <typename K_, typename V_, typename C_>
paludis::Map<K_, V_, C_>::Map() :
- paludis::Pimp<paludis::Map<K_, V_, C_> >()
+ _imp()
{
}
diff --git a/paludis/util/map.hh b/paludis/util/map.hh
index 403056715..a83102335 100644
--- a/paludis/util/map.hh
+++ b/paludis/util/map.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2009, 2010, 2011 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
@@ -49,11 +49,10 @@ namespace paludis
* \nosubgrouping
*/
template <typename K_, typename V_, typename C_>
- class PALUDIS_VISIBLE Map :
- private Pimp<Map<K_, V_, C_> >
+ class PALUDIS_VISIBLE Map
{
private:
- using Pimp<Map<K_, V_, C_> >::_imp;
+ Pimp<Map<K_, V_, C_> > _imp;
public:
///\name Basic operations
diff --git a/paludis/util/pimp-impl.hh b/paludis/util/pimp-impl.hh
index 1cadfe653..926bb220f 100644
--- a/paludis/util/pimp-impl.hh
+++ b/paludis/util/pimp-impl.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -31,56 +31,44 @@
template <typename C_>
template <typename... Args_>
-paludis::Pimp<C_>::ImpPtr::ImpPtr(Args_ && ... args) :
+paludis::Pimp<C_>::Pimp(Args_ && ... args) :
_ptr(new Imp<C_>{std::forward<Args_>(args)...})
{
}
template <typename C_>
-paludis::Pimp<C_>::ImpPtr::ImpPtr(ImpPtr && other) :
+paludis::Pimp<C_>::Pimp(Pimp && other) :
_ptr(std::move(other._ptr))
{
other._ptr = 0;
}
template <typename C_>
-paludis::Pimp<C_>::ImpPtr::~ImpPtr()
+paludis::Pimp<C_>::~Pimp()
{
delete _ptr;
}
template <typename C_>
paludis::Imp<C_> *
-paludis::Pimp<C_>::ImpPtr::get()
+paludis::Pimp<C_>::get()
{
return _ptr;
}
template <typename C_>
const paludis::Imp<C_> *
-paludis::Pimp<C_>::ImpPtr::get() const
+paludis::Pimp<C_>::get() const
{
return _ptr;
}
template <typename C_>
void
-paludis::Pimp<C_>::ImpPtr::reset(Imp<C_> * p)
+paludis::Pimp<C_>::reset(Imp<C_> * p)
{
delete _ptr;
_ptr = p;
}
-template <typename C_>
-template <typename... Args_>
-paludis::Pimp<C_>::Pimp(Args_ && ... args) :
- _imp(std::forward<Args_>(args)...)
-{
-}
-
-template <typename C_>
-paludis::Pimp<C_>::~Pimp()
-{
-}
-
#endif
diff --git a/paludis/util/pimp.hh b/paludis/util/pimp.hh
index aa1a41f96..fe745a238 100644
--- a/paludis/util/pimp.hh
+++ b/paludis/util/pimp.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2010, 2011 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
@@ -42,88 +42,63 @@ namespace paludis
struct Imp;
/**
- * A class descended from Pimp has an associated
- * Imp instance.
+ * Pointer to our implementation data.
*
* \ingroup g_oo
+ * \since 0.58
*/
template <typename C_>
class Pimp
{
- protected:
- /**
- * Smart pointer to our implementation.
- *
- * \see Pimp
- * \ingroup g_oo
- */
- class ImpPtr
- {
- private:
- Imp<C_> * _ptr;
+ private:
+ Imp<C_> * _ptr;
- public:
- ///\name Basic operations
- ///\{
+ public:
+ ///\name Basic operations
+ ///\{
- template <typename... Args_>
- explicit ImpPtr(Args_ && ... args);
+ template <typename... Args_>
+ explicit Pimp(Args_ && ... args);
- ~ImpPtr();
+ ~Pimp();
- ImpPtr(ImpPtr &&);
+ Pimp(Pimp &&);
- ImpPtr(const ImpPtr &) = delete;
- ImpPtr & operator= (const ImpPtr &) = delete;
+ Pimp(const Pimp &) = delete;
+ Pimp & operator= (const Pimp &) = delete;
- ///\}
+ ///\}
- ///\name Dereference operators
- //\{
+ ///\name Dereference operators
+ //\{
- inline Imp<C_> * operator-> ();
+ inline Imp<C_> * operator-> ();
- inline const Imp<C_> * operator-> () const;
+ inline const Imp<C_> * operator-> () const;
- Imp<C_> * get();
- const Imp<C_> * get() const;
+ Imp<C_> * get();
- ///\}
+ const Imp<C_> * get() const;
- /**
- * Reset to a new Imp.
- */
- void reset(Imp<C_> * p);
- };
+ ///\}
/**
- * Pointer to our implementation data.
+ * Reset to a new Imp.
*/
- ImpPtr _imp;
-
- public:
- /**
- * Constructor.
- */
- template <typename... Args_>
- explicit Pimp(Args_ && ... args);
-
- explicit Pimp(Imp<C_> *) = delete;
-
- ~Pimp();
+ void reset(Imp<C_> * p);
};
}
template <typename C_>
paludis::Imp<C_> *
-paludis::Pimp<C_>::ImpPtr::operator-> ()
+paludis::Pimp<C_>::operator-> ()
{
return _ptr;
}
template <typename C_>
const paludis::Imp<C_> *
-paludis::Pimp<C_>::ImpPtr::operator-> () const
+paludis::Pimp<C_>::operator-> () const
{
return _ptr;
}
diff --git a/paludis/util/process.cc b/paludis/util/process.cc
index 0e00723fb..8e971f5ba 100644
--- a/paludis/util/process.cc
+++ b/paludis/util/process.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 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
@@ -70,17 +70,17 @@ namespace paludis
}
ProcessCommand::ProcessCommand(const std::initializer_list<std::string> & i) :
- Pimp<ProcessCommand>(std::vector<std::string>(i), "")
+ _imp(std::vector<std::string>(i), "")
{
}
ProcessCommand::ProcessCommand(const std::string & s) :
- Pimp<ProcessCommand>(std::vector<std::string>(), s)
+ _imp(std::vector<std::string>(), s)
{
}
ProcessCommand::ProcessCommand(ProcessCommand && other) :
- Pimp<ProcessCommand>(std::move(other._imp->args), other._imp->args_string)
+ _imp(std::move(other._imp->args), other._imp->args_string)
{
}
@@ -507,7 +507,7 @@ namespace paludis
}
Process::Process(ProcessCommand && c) :
- Pimp<Process>(std::move(c))
+ _imp(std::move(c))
{
}
@@ -965,7 +965,7 @@ namespace paludis
}
RunningProcessHandle::RunningProcessHandle(pid_t p, std::unique_ptr<RunningProcessThread> && t) :
- Pimp<RunningProcessHandle>(p, std::move(t))
+ _imp(p, std::move(t))
{
}
@@ -979,7 +979,7 @@ RunningProcessHandle::~RunningProcessHandle()
}
RunningProcessHandle::RunningProcessHandle(RunningProcessHandle && other) :
- Pimp<RunningProcessHandle>(other._imp->pid, std::move(other._imp->thread))
+ _imp(other._imp->pid, std::move(other._imp->thread))
{
_imp->pid = -1;
}
diff --git a/paludis/util/process.hh b/paludis/util/process.hh
index ce3ad2759..1b7839da0 100644
--- a/paludis/util/process.hh
+++ b/paludis/util/process.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 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
@@ -46,9 +46,11 @@ namespace paludis
ProcessError(const std::string &) throw ();
};
- class PALUDIS_VISIBLE ProcessCommand :
- private Pimp<ProcessCommand>
+ class PALUDIS_VISIBLE ProcessCommand
{
+ private:
+ Pimp<ProcessCommand> _imp;
+
public:
/**
* List of arguments, one string per argv value.
@@ -73,9 +75,11 @@ namespace paludis
void exec() PALUDIS_ATTRIBUTE((noreturn));
};
- class PALUDIS_VISIBLE Process :
- private Pimp<Process>
+ class PALUDIS_VISIBLE Process
{
+ private:
+ Pimp<Process> _imp;
+
public:
explicit Process(ProcessCommand &&);
~Process();
@@ -109,9 +113,11 @@ namespace paludis
Process & as_main_process();
};
- class PALUDIS_VISIBLE RunningProcessHandle :
- private Pimp<RunningProcessHandle>
+ class PALUDIS_VISIBLE RunningProcessHandle
{
+ private:
+ Pimp<RunningProcessHandle> _imp;
+
public:
RunningProcessHandle(
const pid_t,
diff --git a/paludis/util/safe_ofstream.cc b/paludis/util/safe_ofstream.cc
index 85d84a5ac..641664f1d 100644
--- a/paludis/util/safe_ofstream.cc
+++ b/paludis/util/safe_ofstream.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 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
@@ -39,7 +39,7 @@ namespace paludis
}
SafeOFStreamBuf::SafeOFStreamBuf(const int f, const bool buffer) :
- Pimp<SafeOFStreamBuf>(),
+ _imp(),
fd(f)
{
if (buffer)
diff --git a/paludis/util/safe_ofstream.hh b/paludis/util/safe_ofstream.hh
index ace9c9b6e..8392c1d82 100644
--- a/paludis/util/safe_ofstream.hh
+++ b/paludis/util/safe_ofstream.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 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
@@ -49,9 +49,11 @@ namespace paludis
* \since 0.34.3
*/
class PALUDIS_VISIBLE SafeOFStreamBuf :
- private Pimp<SafeOFStreamBuf>,
public std::streambuf
{
+ private:
+ Pimp<SafeOFStreamBuf> _imp;
+
protected:
virtual int_type
overflow(int_type c);
diff --git a/paludis/util/sequence-impl.hh b/paludis/util/sequence-impl.hh
index 7d7053bc1..f1ae381ac 100644
--- a/paludis/util/sequence-impl.hh
+++ b/paludis/util/sequence-impl.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2009, 2010, 2011 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
@@ -68,7 +68,7 @@ namespace paludis
template <typename T_>
paludis::Sequence<T_>::Sequence() :
- paludis::Pimp<paludis::Sequence<T_> >()
+ _imp()
{
}
diff --git a/paludis/util/sequence.hh b/paludis/util/sequence.hh
index a096747a4..cdc2fd92c 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, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2009, 2010, 2011 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
@@ -47,11 +47,10 @@ namespace paludis
* \nosubgrouping
*/
template <typename T_>
- class PALUDIS_VISIBLE Sequence :
- private Pimp<Sequence<T_> >
+ class PALUDIS_VISIBLE Sequence
{
private:
- using Pimp<Sequence<T_> >::_imp;
+ Pimp<Sequence<T_> > _imp;
public:
///\name Standard library typedefs
diff --git a/paludis/util/set-impl.hh b/paludis/util/set-impl.hh
index dfcd926e7..d99e6dc8a 100644
--- a/paludis/util/set-impl.hh
+++ b/paludis/util/set-impl.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2009, 2010, 2011 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
@@ -76,7 +76,7 @@ namespace paludis
template <typename T_, typename C_>
paludis::Set<T_, C_>::Set() :
- paludis::Pimp<Set<T_, C_> >()
+ _imp()
{
}
diff --git a/paludis/util/set.hh b/paludis/util/set.hh
index a324aebc9..50efd69a5 100644
--- a/paludis/util/set.hh
+++ b/paludis/util/set.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2009, 2010, 2011 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
@@ -47,11 +47,10 @@ namespace paludis
* \since 0.26
*/
template <typename T_, typename C_>
- class PALUDIS_VISIBLE Set :
- private Pimp<Set<T_, C_> >
+ class PALUDIS_VISIBLE Set
{
private:
- using Pimp<Set<T_, C_> >::_imp;
+ Pimp<Set<T_, C_> > _imp;
public:
typedef T_ Tag;
diff --git a/paludis/util/simple_parser.cc b/paludis/util/simple_parser.cc
index 5af45cce7..4df38293a 100644
--- a/paludis/util/simple_parser.cc
+++ b/paludis/util/simple_parser.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010, 2011 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
@@ -235,7 +235,7 @@ namespace paludis
}
SimpleParser::SimpleParser(const std::string & s) :
- Pimp<SimpleParser>(s)
+ _imp(s)
{
}
diff --git a/paludis/util/simple_parser.hh b/paludis/util/simple_parser.hh
index a50a45a27..356ac10b5 100644
--- a/paludis/util/simple_parser.hh
+++ b/paludis/util/simple_parser.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010, 2011 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
@@ -72,9 +72,11 @@ namespace paludis
PALUDIS_VISIBLE PALUDIS_ATTRIBUTE((warn_unused_result));
}
- class PALUDIS_VISIBLE SimpleParser :
- private Pimp<SimpleParser>
+ class PALUDIS_VISIBLE SimpleParser
{
+ private:
+ Pimp<SimpleParser> _imp;
+
public:
SimpleParser(const std::string &);
~SimpleParser();
diff --git a/paludis/util/string_list_stream.cc b/paludis/util/string_list_stream.cc
index 05e6755e2..67609d233 100644
--- a/paludis/util/string_list_stream.cc
+++ b/paludis/util/string_list_stream.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 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
@@ -47,7 +47,7 @@ namespace paludis
}
StringListStreamBuf::StringListStreamBuf() :
- Pimp<StringListStreamBuf>()
+ _imp()
{
setg(0, 0, 0);
}
diff --git a/paludis/util/string_list_stream.hh b/paludis/util/string_list_stream.hh
index 9dd1de859..ded1717a9 100644
--- a/paludis/util/string_list_stream.hh
+++ b/paludis/util/string_list_stream.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 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
@@ -29,9 +29,11 @@
namespace paludis
{
class PALUDIS_VISIBLE StringListStreamBuf :
- private Pimp<StringListStreamBuf>,
public std::streambuf
{
+ private:
+ Pimp<StringListStreamBuf> _imp;
+
protected:
virtual int_type underflow();
diff --git a/paludis/util/tail_output_stream.cc b/paludis/util/tail_output_stream.cc
index 14af0b9c9..8c181586b 100644
--- a/paludis/util/tail_output_stream.cc
+++ b/paludis/util/tail_output_stream.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2008, 2010, 2011 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
@@ -48,7 +48,7 @@ namespace paludis
}
TailOutputStreamBuf::TailOutputStreamBuf(const unsigned int n) :
- Pimp<TailOutputStreamBuf>(n)
+ _imp(n)
{
}
diff --git a/paludis/util/tail_output_stream.hh b/paludis/util/tail_output_stream.hh
index 6631eb52e..baa08d6fe 100644
--- a/paludis/util/tail_output_stream.hh
+++ b/paludis/util/tail_output_stream.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2008, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -30,10 +30,11 @@
namespace paludis
{
class PALUDIS_VISIBLE TailOutputStreamBuf :
- public std::streambuf,
- private Pimp<TailOutputStreamBuf>
+ public std::streambuf
{
private:
+ Pimp<TailOutputStreamBuf> _imp;
+
void _append(const std::string &);
protected:
diff --git a/paludis/util/tee_output_stream.cc b/paludis/util/tee_output_stream.cc
index d179318f8..6da7229e6 100644
--- a/paludis/util/tee_output_stream.cc
+++ b/paludis/util/tee_output_stream.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010, 2011 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,7 @@ namespace paludis
}
TeeOutputStreamBuf::TeeOutputStreamBuf() :
- Pimp<TeeOutputStreamBuf>()
+ _imp()
{
}
diff --git a/paludis/util/tee_output_stream.hh b/paludis/util/tee_output_stream.hh
index cf01beed6..7a2b6e872 100644
--- a/paludis/util/tee_output_stream.hh
+++ b/paludis/util/tee_output_stream.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -28,9 +28,11 @@
namespace paludis
{
class PALUDIS_VISIBLE TeeOutputStreamBuf :
- public std::streambuf,
- private Pimp<TeeOutputStreamBuf>
+ public std::streambuf
{
+ private:
+ Pimp<TeeOutputStreamBuf> _imp;
+
protected:
virtual int_type
overflow(int_type c);
diff --git a/paludis/util/thread_pool.cc b/paludis/util/thread_pool.cc
index 92d80e81f..ee318c716 100644
--- a/paludis/util/thread_pool.cc
+++ b/paludis/util/thread_pool.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010, 2011 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
@@ -35,7 +35,7 @@ namespace paludis
}
ThreadPool::ThreadPool() :
- Pimp<ThreadPool>()
+ _imp()
{
}
@@ -55,3 +55,5 @@ ThreadPool::number_of_threads() const
return _imp->threads.size();
}
+template class Pimp<ThreadPool>;
+
diff --git a/paludis/util/thread_pool.hh b/paludis/util/thread_pool.hh
index ca76cafea..9b450cb0f 100644
--- a/paludis/util/thread_pool.hh
+++ b/paludis/util/thread_pool.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2011 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
@@ -42,9 +42,11 @@ namespace paludis
* \nosubgrouping
* \since 0.26
*/
- class PALUDIS_VISIBLE ThreadPool :
- private Pimp<ThreadPool>
+ class PALUDIS_VISIBLE ThreadPool
{
+ private:
+ Pimp<ThreadPool> _imp;
+
public:
///\name Basic operations
///\{
@@ -64,6 +66,8 @@ namespace paludis
*/
unsigned number_of_threads() const;
};
+
+ extern template class Pimp<ThreadPool>;
}
#endif
diff --git a/paludis/util/wildcard_expander.cc b/paludis/util/wildcard_expander.cc
index 9cbf13143..5ca3623bd 100644
--- a/paludis/util/wildcard_expander.cc
+++ b/paludis/util/wildcard_expander.cc
@@ -107,7 +107,7 @@ namespace
}
WildcardExpander::WildcardExpander(const std::string & pattern, const FSPath & root) :
- Pimp<WildcardExpander>()
+ _imp()
{
// GLOB_NOCHECK seems to be buggy in glibc 2.5: fails
// TEST_CHECK_EQUAL(expand("/foo\\*"), "/foo*");
@@ -124,13 +124,13 @@ WildcardExpander::WildcardExpander(const std::string & pattern, const FSPath & r
}
WildcardExpander::WildcardExpander() :
- Pimp<WildcardExpander>()
+ _imp()
{
_imp->it = _imp->files->end();
}
WildcardExpander::WildcardExpander(const WildcardExpander & other) :
- Pimp<WildcardExpander>(other._imp->files, other._imp->it)
+ _imp(other._imp->files, other._imp->it)
{
}
@@ -181,3 +181,5 @@ WildcardExpander::operator== (const WildcardExpander & other) const
return _imp->files == other._imp->files && _imp->it == other._imp->it;
}
+template class Pimp<WildcardExpander>;
+
diff --git a/paludis/util/wildcard_expander.hh b/paludis/util/wildcard_expander.hh
index e1b5ee0d2..ff92387de 100644
--- a/paludis/util/wildcard_expander.hh
+++ b/paludis/util/wildcard_expander.hh
@@ -39,9 +39,11 @@ namespace paludis
class PALUDIS_VISIBLE WildcardExpander :
public std::iterator<std::forward_iterator_tag, const FSPath>,
- public equality_operators::HasEqualityOperators,
- private Pimp<WildcardExpander>
+ public equality_operators::HasEqualityOperators
{
+ private:
+ Pimp<WildcardExpander> _imp;
+
public:
WildcardExpander(const std::string &, const FSPath & = FSPath("/"));
WildcardExpander();
@@ -59,6 +61,8 @@ namespace paludis
bool operator== (const WildcardExpander &) const PALUDIS_ATTRIBUTE((warn_unused_result));
};
+
+ extern template class Pimp<WildcardExpander>;
}
#endif