aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-08 16:00:02 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-08 16:00:02 +0000
commite3d0e0c946d7201019b6a0cef44f69dac3ec5124 (patch)
tree87da14d06b35fb214d2247f45f4fbce5561b3657
parent1b07feaec5964415963b18e5e31e45f706ebda90 (diff)
downloadpaludis-e3d0e0c946d7201019b6a0cef44f69dac3ec5124.tar.gz
paludis-e3d0e0c946d7201019b6a0cef44f69dac3ec5124.tar.xz
Remove some unnecessary inlining
-rw-r--r--paludis/config_file.cc7
-rw-r--r--paludis/config_file.hh5
-rw-r--r--paludis/default_config.cc10
-rw-r--r--paludis/default_environment.cc55
-rw-r--r--paludis/dep_atom.cc5
-rw-r--r--paludis/dep_atom.hh5
-rw-r--r--paludis/fake_repository.cc10
-rw-r--r--paludis/name.cc26
-rw-r--r--paludis/name.hh26
-rw-r--r--paludis/util/counted_ptr.hh15
-rw-r--r--paludis/util/smart_record.hh.m4106
-rw-r--r--paludis/util/validated.hh46
-rw-r--r--paludis/util/visitor.hh36
13 files changed, 223 insertions, 129 deletions
diff --git a/paludis/config_file.cc b/paludis/config_file.cc
index c7e1334..57c7445 100644
--- a/paludis/config_file.cc
+++ b/paludis/config_file.cc
@@ -471,3 +471,10 @@ NewsFile::accept_line(const std::string & line) const
}
}
}
+
+std::string
+KeyValueConfigFile::get(const std::string & key) const
+{
+ return _entries[key];
+}
+
diff --git a/paludis/config_file.hh b/paludis/config_file.hh
index 04c306c..72a946b 100644
--- a/paludis/config_file.hh
+++ b/paludis/config_file.hh
@@ -286,10 +286,7 @@ namespace paludis
/**
* Fetch the specified key, or a blank string.
*/
- std::string get(const std::string & key) const
- {
- return _entries[key];
- }
+ std::string get(const std::string & key) const;
};
/**
diff --git a/paludis/default_config.cc b/paludis/default_config.cc
index 885b29d..c2488a1 100644
--- a/paludis/default_config.cc
+++ b/paludis/default_config.cc
@@ -92,13 +92,15 @@ namespace paludis
std::multimap<std::string, std::string> mirrors;
- Implementation() :
- paludis_command("paludis")
- {
- }
+ Implementation();
};
}
+Implementation<DefaultConfig>::Implementation() :
+ paludis_command("paludis")
+{
+}
+
DefaultConfigError::DefaultConfigError(const std::string & msg) throw () :
ConfigurationError("Default configuration error: " + msg)
{
diff --git a/paludis/default_environment.cc b/paludis/default_environment.cc
index 6d2d32f..1639990 100644
--- a/paludis/default_environment.cc
+++ b/paludis/default_environment.cc
@@ -383,33 +383,36 @@ namespace
{
}
- void operator() (const FSEntry & f) const
- {
- Context context("When running hook script '" + stringify(f) +
- "' for hook '" + hook.name() + "':");
- Log::get_instance()->message(ll_debug, lc_no_context, "Starting hook script '" +
- stringify(f) + "' for '" + hook.name() + "'");
-
- MakeEnvCommand cmd(make_env_command("bash '" + stringify(f) + "'")
- ("ROOT", DefaultConfig::get_instance()->root())
- ("HOOK", hook.name())
- ("HOOK_LOG_LEVEL", Log::get_instance()->log_level_string())
- ("HOOK_CONFIG_SUFFIX", DefaultConfig::config_suffix())
- ("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))
- ("PALUDIS_COMMAND", paludis_command));
-
- for (Hook::Iterator h(hook.begin()), h_end(hook.end()) ; h != h_end ; ++h)
- cmd = cmd(h->first, h->second);
-
- int exit_status(run_command(cmd));
- if (0 == exit_status)
- Log::get_instance()->message(ll_debug, lc_no_context, "Hook '" + stringify(f)
- + "' returned success '" + stringify(exit_status) + "'");
- else
- Log::get_instance()->message(ll_warning, lc_no_context, "Hook '" + stringify(f)
- + "' returned failure '" + stringify(exit_status) + "'");
- }
+ void operator() (const FSEntry & f) const;
};
+
+ void
+ Hooker::operator() (const FSEntry & f) const
+ {
+ Context context("When running hook script '" + stringify(f) +
+ "' for hook '" + hook.name() + "':");
+ Log::get_instance()->message(ll_debug, lc_no_context, "Starting hook script '" +
+ stringify(f) + "' for '" + hook.name() + "'");
+
+ MakeEnvCommand cmd(make_env_command("bash '" + stringify(f) + "'")
+ ("ROOT", DefaultConfig::get_instance()->root())
+ ("HOOK", hook.name())
+ ("HOOK_LOG_LEVEL", Log::get_instance()->log_level_string())
+ ("HOOK_CONFIG_SUFFIX", DefaultConfig::config_suffix())
+ ("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))
+ ("PALUDIS_COMMAND", paludis_command));
+
+ for (Hook::Iterator h(hook.begin()), h_end(hook.end()) ; h != h_end ; ++h)
+ cmd = cmd(h->first, h->second);
+
+ int exit_status(run_command(cmd));
+ if (0 == exit_status)
+ Log::get_instance()->message(ll_debug, lc_no_context, "Hook '" + stringify(f)
+ + "' returned success '" + stringify(exit_status) + "'");
+ else
+ Log::get_instance()->message(ll_warning, lc_no_context, "Hook '" + stringify(f)
+ + "' returned failure '" + stringify(exit_status) + "'");
+ }
}
void
diff --git a/paludis/dep_atom.cc b/paludis/dep_atom.cc
index 86a0dd0..5098176 100644
--- a/paludis/dep_atom.cc
+++ b/paludis/dep_atom.cc
@@ -264,6 +264,11 @@ StringDepAtom::StringDepAtom(const std::string & s) :
{
}
+StringDepAtom::~StringDepAtom()
+{
+}
+
+
PlainTextDepAtom::PlainTextDepAtom(const std::string & s) :
StringDepAtom(s)
{
diff --git a/paludis/dep_atom.hh b/paludis/dep_atom.hh
index 830ac11..3942e5b 100644
--- a/paludis/dep_atom.hh
+++ b/paludis/dep_atom.hh
@@ -230,6 +230,11 @@ namespace paludis
*/
StringDepAtom(const std::string &);
+ /**
+ * Destructor.
+ */
+ ~StringDepAtom();
+
public:
/**
* Fetch our text.
diff --git a/paludis/fake_repository.cc b/paludis/fake_repository.cc
index 208ebd9..7263340 100644
--- a/paludis/fake_repository.cc
+++ b/paludis/fake_repository.cc
@@ -59,13 +59,15 @@ namespace paludis
const std::map<QualifiedPackageName, QualifiedPackageName> provide_map;
/// Constructor.
- Implementation() :
- category_names(new CategoryNamePartCollection)
- {
- }
+ Implementation();
};
}
+Implementation<FakeRepository>::Implementation() :
+ category_names(new CategoryNamePartCollection)
+{
+}
+
FakeRepository::FakeRepository(const RepositoryName & name) :
Repository(name, RepositoryCapabilities::create((
param<repo_installable>(static_cast<InstallableInterface *>(0)),
diff --git a/paludis/name.cc b/paludis/name.cc
index 7ee2328..10c8ff3 100644
--- a/paludis/name.cc
+++ b/paludis/name.cc
@@ -271,3 +271,29 @@ KeywordNameValidator::validate(const std::string & s)
throw KeywordNameError(s);
}
+QualifiedPackageName::QualifiedPackageName(const CategoryNamePart & c, const PackageNamePart & p) :
+ MakeSmartRecord<QualifiedPackageNameTag>::Type(c, p)
+{
+}
+
+QualifiedPackageName::QualifiedPackageName(const QualifiedPackageName & other) :
+ MakeSmartRecord<QualifiedPackageNameTag>::Type(other)
+{
+}
+
+QualifiedPackageName::QualifiedPackageName(const std::string & s) :
+ MakeSmartRecord<QualifiedPackageNameTag>::Type(_make_parent(s))
+{
+}
+
+QualifiedPackageName::~QualifiedPackageName()
+{
+}
+
+const QualifiedPackageName &
+QualifiedPackageName::operator= (const QualifiedPackageName & other)
+{
+ MakeSmartRecord<QualifiedPackageNameTag>::Type::operator= (other);
+ return *this;
+}
+
diff --git a/paludis/name.hh b/paludis/name.hh
index 03f7fcf..838cf62 100644
--- a/paludis/name.hh
+++ b/paludis/name.hh
@@ -177,35 +177,27 @@ namespace paludis
/**
* Constructor.
*/
- QualifiedPackageName(const CategoryNamePart & c, const PackageNamePart & p) :
- MakeSmartRecord<QualifiedPackageNameTag>::Type(c, p)
- {
- }
+ QualifiedPackageName(const CategoryNamePart & c, const PackageNamePart & p);
/**
* Copy constructor.
*/
- QualifiedPackageName(const QualifiedPackageName & other) :
- MakeSmartRecord<QualifiedPackageNameTag>::Type(other)
- {
- }
+ QualifiedPackageName(const QualifiedPackageName & other);
/**
* Constructor, from a raw string.
*/
- explicit QualifiedPackageName(const std::string & s) :
- MakeSmartRecord<QualifiedPackageNameTag>::Type(_make_parent(s))
- {
- }
+ explicit QualifiedPackageName(const std::string & s);
/**
* Assignment.
*/
- const QualifiedPackageName & operator= (const QualifiedPackageName & other)
- {
- MakeSmartRecord<QualifiedPackageNameTag>::Type::operator= (other);
- return *this;
- }
+ const QualifiedPackageName & operator= (const QualifiedPackageName & other);
+
+ /**
+ * Destructor.
+ */
+ ~QualifiedPackageName();
};
/**
diff --git a/paludis/util/counted_ptr.hh b/paludis/util/counted_ptr.hh
index 177d1b8..cb816f2 100644
--- a/paludis/util/counted_ptr.hh
+++ b/paludis/util/counted_ptr.hh
@@ -494,12 +494,7 @@ namespace paludis
/**
* Destructor.
*/
- ~CountedPtr()
- {
- if (0 != this->_ptr)
- if (0 == --(*this->_ptr->reference_count_pointer()))
- delete this->_ptr;
- }
+ ~CountedPtr();
/**
* Assignment, from another CountedPtr.
@@ -546,6 +541,14 @@ namespace paludis
return 0;
}
};
+
+ template <typename T_, typename DereferencePolicy_>
+ CountedPtr<T_, count_policy::InternalCountTag, DereferencePolicy_>::~CountedPtr()
+ {
+ if (0 != this->_ptr)
+ if (0 == --(*this->_ptr->reference_count_pointer()))
+ delete this->_ptr;
+ }
}
#include <paludis/util/instantiation_policy.hh>
diff --git a/paludis/util/smart_record.hh.m4 b/paludis/util/smart_record.hh.m4
index 7718f44..8c68b55 100644
--- a/paludis/util/smart_record.hh.m4
+++ b/paludis/util/smart_record.hh.m4
@@ -627,15 +627,7 @@ ifelse(idx, `1', `', `forloop(`idy', `0', decr(decr(idx)), `
}
/// Copy constructor.
- RecordBase(const RecordBase<Tag_, `'idx`'> & other) :
- RecordComparisonBase<Tag_, `'idx`', typename Tag_::ComparisonModeTag,
- typename Tag_::ComparisonMethodTag>(other),
-ifelse(idx, `1', `', `forloop(`idy', `0', decr(decr(idx)), `
- _v`'idy`'(other._v`'idy`'),
-') ')
- _v`'decr(idx)`'(other._v`'decr(idx)`')
- {
- }
+ RecordBase(const RecordBase<Tag_, `'idx`'> & other);
/// Assignment.
const RecordBase & operator= (const RecordBase<Tag_, `'idx`'> & other)
@@ -678,16 +670,32 @@ forloop(`idy', `0', decr(idx), `
/// Named parameters constructor.
template <typename List_>
static RecordBase
- create(const List_ & list)
- {
- return RecordBase(
+ create(const List_ & list);
+ };
+
+ template<typename Tag_>
+ RecordBase<Tag_, `'idx`'>::RecordBase(const RecordBase<Tag_, `'idx`'> & other) :
+ RecordComparisonBase<Tag_, `'idx`', typename Tag_::ComparisonModeTag,
+ typename Tag_::ComparisonMethodTag>(other),
ifelse(idx, `1', `', `forloop(`idy', `0', decr(decr(idx)), `
- find_list_entry<`'idy`', typename Tag_::KeyType`'idy`'>(list),
+ _v`'idy`'(other._v`'idy`'),
') ')
- find_list_entry<`'decr(idx)`', typename Tag_::KeyType`'decr(idx)`'>(list)
- );
- }
- };
+ _v`'decr(idx)`'(other._v`'decr(idx)`')
+ {
+ }
+
+ template<typename Tag_>
+ template<typename List_>
+ RecordBase<Tag_, `'idx`'>
+ RecordBase<Tag_, `'idx`'>::create(const List_ & list)
+ {
+ return RecordBase(
+ifelse(idx, `1', `', `forloop(`idy', `0', decr(decr(idx)), `
+ find_list_entry<`'idy`', typename Tag_::KeyType`'idy`'>(list),
+') ')
+ find_list_entry<`'decr(idx)`', typename Tag_::KeyType`'decr(idx)`'>(list)
+ );
+ }
template<typename Tag_>
RecordBase<Tag_, `'idx`'>::~RecordBase()
@@ -766,26 +774,32 @@ forloop(`idx', `1', max_record_size, `
{
/// Do the comparison.
static int do_compare(const RecordBase<Tag_, `'idx`'> * const a,
- const RecordBase<Tag_, `'idx`'> * const b)
- {
+ const RecordBase<Tag_, `'idx`'> * const b);
+ };
+
+ template <typename Tag_>
+ int
+ DoFullCompareByAll<Tag_, `'idx`'>::do_compare(
+ const RecordBase<Tag_, `'idx`'> * const a,
+ const RecordBase<Tag_, `'idx`'> * const b)
+ {
forloop(`idy', `0', decr(`'idx`'), `
- switch (compare(
- RecordKeyGetter<Tag_, `'idx`', `'idy`'>::do_get(*a),
- RecordKeyGetter<Tag_, `'idx`', `'idy`'>::do_get(*b)))
- {
- case -1:
- return -1;
- case 1:
- return 1;
- case 0:
- break;
- default:
- throw InternalError(PALUDIS_HERE, "Bad value from compare");
- }
-')
- return 0;
+ switch (compare(
+ RecordKeyGetter<Tag_, `'idx`', `'idy`'>::do_get(*a),
+ RecordKeyGetter<Tag_, `'idx`', `'idy`'>::do_get(*b)))
+ {
+ case -1:
+ return -1;
+ case 1:
+ return 1;
+ case 0:
+ break;
+ default:
+ throw InternalError(PALUDIS_HERE, "Bad value from compare");
}
- };
+')
+ return 0;
+ }
')
template <typename Tag_, unsigned key_count_>
@@ -802,16 +816,22 @@ forloop(`idx', `1', max_record_size, `
struct DoEqualCompareByAll<Tag_, `'idx`'>
{
static bool do_compare(const RecordBase<Tag_, `'idx`'> * const a,
- const RecordBase<Tag_, `'idx`'> * const b)
- {
+ const RecordBase<Tag_, `'idx`'> * const b);
+ };
+
+ template <typename Tag_>
+ bool
+ DoEqualCompareByAll<Tag_, `'idx`'>::do_compare(
+ const RecordBase<Tag_, `'idx`'> * const a,
+ const RecordBase<Tag_, `'idx`'> * const b)
+ {
forloop(`idy', `0', decr(`'idx`'), `
- if (RecordKeyGetter<Tag_, `'idx`', `'idy`'>::do_get(*a) !=
- RecordKeyGetter<Tag_, `'idx`', `'idy`'>::do_get(*b))
- return false;
+ if (RecordKeyGetter<Tag_, `'idx`', `'idy`'>::do_get(*a) !=
+ RecordKeyGetter<Tag_, `'idx`', `'idy`'>::do_get(*b))
+ return false;
')
- return true;
- }
- };
+ return true;
+ }
')
template <typename Tag_, unsigned key_count_>
diff --git a/paludis/util/validated.hh b/paludis/util/validated.hh
index b6f72fc..01b2433 100644
--- a/paludis/util/validated.hh
+++ b/paludis/util/validated.hh
@@ -50,29 +50,12 @@ namespace paludis
/**
* Copy constructor (no validation needed).
*/
- Validated(const Validated<ValidatedDataType_, Validator_> & other) :
- ComparisonPolicy<
- Validated<ValidatedDataType_, Validator_>,
- comparison_mode::FullComparisonTag,
- comparison_method::CompareByMemberTag<ValidatedDataType_> >
- (other),
- _value(other._value)
- {
- }
+ Validated(const Validated<ValidatedDataType_, Validator_> & other);
/**
* Constructor (validation needed).
*/
- explicit Validated(const ValidatedDataType_ & value) :
- ComparisonPolicy<
- Validated<ValidatedDataType_, Validator_>,
- comparison_mode::FullComparisonTag,
- comparison_method::CompareByMemberTag<ValidatedDataType_> >
- (&Validated<ValidatedDataType_, Validator_>::_value),
- _value(value)
- {
- Validator_::validate(_value);
- }
+ explicit Validated(const ValidatedDataType_ & value);
/**
* Assignment (no validation needed).
@@ -94,6 +77,31 @@ namespace paludis
}
};
+
+ template <typename ValidatedDataType_, typename Validator_>
+ Validated<ValidatedDataType_, Validator_>::Validated(
+ const Validated<ValidatedDataType_, Validator_> & other) :
+ ComparisonPolicy<
+ Validated<ValidatedDataType_, Validator_>,
+ comparison_mode::FullComparisonTag,
+ comparison_method::CompareByMemberTag<ValidatedDataType_> >
+ (other),
+ _value(other._value)
+ {
+ }
+
+ template <typename ValidatedDataType_, typename Validator_>
+ Validated<ValidatedDataType_, Validator_>::Validated(const ValidatedDataType_ & value) :
+ ComparisonPolicy<
+ Validated<ValidatedDataType_, Validator_>,
+ comparison_mode::FullComparisonTag,
+ comparison_method::CompareByMemberTag<ValidatedDataType_> >
+ (&Validated<ValidatedDataType_, Validator_>::_value),
+ _value(value)
+ {
+ Validator_::validate(_value);
+ }
+
/**
* Writing a Validated instance to a stream is done by its data.
*
diff --git a/paludis/util/visitor.hh b/paludis/util/visitor.hh
index 33a4d6e..882f99d 100644
--- a/paludis/util/visitor.hh
+++ b/paludis/util/visitor.hh
@@ -225,9 +225,7 @@ namespace paludis
public visitor_internals::Visits<typename visitor_internals::MakePointerToConst<N9_>::Type>
{
protected:
- ~ConstVisitor()
- {
- }
+ ~ConstVisitor();
};
/**
@@ -245,12 +243,38 @@ namespace paludis
public visitor_internals::Visits<N9_>
{
protected:
- ~Visitor()
- {
- }
+ ~Visitor();
};
};
+ template <
+ typename N1_,
+ typename N2_,
+ typename N3_,
+ typename N4_,
+ typename N5_,
+ typename N6_,
+ typename N7_,
+ typename N8_,
+ typename N9_>
+ VisitorTypes<N1_, N2_, N3_, N4_, N5_, N6_, N7_, N8_, N9_>::ConstVisitor::~ConstVisitor()
+ {
+ }
+
+ template <
+ typename N1_,
+ typename N2_,
+ typename N3_,
+ typename N4_,
+ typename N5_,
+ typename N6_,
+ typename N7_,
+ typename N8_,
+ typename N9_>
+ VisitorTypes<N1_, N2_, N3_, N4_, N5_, N6_, N7_, N8_, N9_>::Visitor::~Visitor()
+ {
+ }
+
/**
* Functor: simplify calling accept on a visitor when we have a container of
* pointers to nodes.