aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-03-04 12:56:09 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-03-04 12:56:09 +0000
commit53af984ffe39e834325c90c44b341d38698a1c3c (patch)
tree3279417b5cf05a2b1479bdee07b556996b1a4f29
parent0b7747c4f5df3f1e4968f443fb2044f8f1192498 (diff)
downloadpaludis-53af984ffe39e834325c90c44b341d38698a1c3c.tar.gz
paludis-53af984ffe39e834325c90c44b341d38698a1c3c.tar.xz
Doxygenation
-rw-r--r--paludis/name.hh11
-rw-r--r--paludis/ndbam.hh30
-rw-r--r--paludis/ndbam_merger.hh6
-rw-r--r--paludis/ndbam_unmerger.hh11
-rw-r--r--paludis/repositories/fake/fake_package_id.hh22
-rw-r--r--paludis/util/kc.hh81
-rw-r--r--paludis/util/validated.hh8
7 files changed, 165 insertions, 4 deletions
diff --git a/paludis/name.hh b/paludis/name.hh
index e76fa3e..d5ac975 100644
--- a/paludis/name.hh
+++ b/paludis/name.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, 2008 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
@@ -298,9 +298,18 @@ namespace paludis
KeywordNameError(const std::string & name) throw ();
};
+ /**
+ * Comparator for a KeywordName.
+ *
+ * \ingroup g_names
+ * \since 0.26
+ */
class PALUDIS_VISIBLE KeywordNameComparator
{
public:
+ /**
+ * Perform a less-than comparison.
+ */
bool operator() (const std::string &, const std::string &) const;
};
diff --git a/paludis/ndbam.hh b/paludis/ndbam.hh
index 4e3358a..010958c 100644
--- a/paludis/ndbam.hh
+++ b/paludis/ndbam.hh
@@ -37,15 +37,32 @@ namespace paludis
#include <paludis/ndbam-sr.hh>
+ /**
+ * NDBAM provides a partial implementation of a Repository for installed packages using
+ * a Paludis-defined on-disk format. It is used by unpackaged repositories and exndbam,
+ * where the format can be defined by us. NDBAM is designed to reduce unnecessary disk
+ * access and to reduce the need for global locking.
+ *
+ * \ingroup g_ndbam
+ * \since 0.26
+ */
class PALUDIS_VISIBLE NDBAM :
private PrivateImplementationPattern<NDBAM>
{
public:
+ ///\name Basic operations
+ ///\{
+
NDBAM(const FSEntry &,
const tr1::function<bool (const std::string &)> & check_format,
const std::string & preferred_format);
~NDBAM();
+ ///\}
+
+ ///\name Repository method implementations
+ ///\{
+
tr1::shared_ptr<const CategoryNamePartSet> category_names()
PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -66,13 +83,26 @@ namespace paludis
tr1::shared_ptr<NDBAMEntrySequence> entries(const QualifiedPackageName &)
PALUDIS_ATTRIBUTE((warn_unused_result));
+ ///\}
+
+ /**
+ * Parse the contents file for a given ID, using the provided callbacks.
+ */
void parse_contents(const PackageID &,
const tr1::function<void (const FSEntry &, const std::string & md5, const time_t mtime)> & on_file,
const tr1::function<void (const FSEntry &)> & on_dir,
const tr1::function<void (const FSEntry &, const std::string & target, const time_t mtime)> & on_sym
) const;
+ /**
+ * Index a newly added QualifiedPackageName, using the provided data directory
+ * name part.
+ */
void index(const QualifiedPackageName &, const std::string &) const;
+
+ /**
+ * Deindex a QualifiedPackageName that no longer has any versions installed.
+ */
void deindex(const QualifiedPackageName &) const;
};
}
diff --git a/paludis/ndbam_merger.hh b/paludis/ndbam_merger.hh
index 2ef824e..6cd6e0c 100644
--- a/paludis/ndbam_merger.hh
+++ b/paludis/ndbam_merger.hh
@@ -27,6 +27,12 @@ namespace paludis
{
#include <paludis/ndbam_merger-sr.hh>
+ /**
+ * Merger subclass for NDBAM.
+ *
+ * \ingroup g_ndbam
+ * \since 0.26
+ */
class PALUDIS_VISIBLE NDBAMMerger :
public Merger,
private PrivateImplementationPattern<NDBAMMerger>
diff --git a/paludis/ndbam_unmerger.hh b/paludis/ndbam_unmerger.hh
index a8c5f44..1fb3f30 100644
--- a/paludis/ndbam_unmerger.hh
+++ b/paludis/ndbam_unmerger.hh
@@ -41,6 +41,12 @@ namespace paludis
NDBAMUnmergerError(const std::string &) throw ();
};
+ /**
+ * Unmerger implementation for NDBAM.
+ *
+ * \ingroup g_ndbam
+ * \since 0.26
+ */
class PALUDIS_VISIBLE NDBAMUnmerger :
public Unmerger,
private PrivateImplementationPattern<NDBAMUnmerger>
@@ -68,9 +74,14 @@ namespace paludis
bool check_misc(const FSEntry &, tr1::shared_ptr<ExtraInfo>) const;
public:
+ ///\name Basic operations
+ ///\{
+
NDBAMUnmerger(const NDBAMUnmergerOptions &);
~NDBAMUnmerger();
+ ///\}
+
virtual Hook extend_hook(const Hook &) const;
};
}
diff --git a/paludis/repositories/fake/fake_package_id.hh b/paludis/repositories/fake/fake_package_id.hh
index b6fa457..880a01d 100644
--- a/paludis/repositories/fake/fake_package_id.hh
+++ b/paludis/repositories/fake/fake_package_id.hh
@@ -177,6 +177,14 @@ namespace paludis
const tr1::shared_ptr<const MetadataKey> unaccepted_key() const;
};
+ /**
+ * A PackageID in a FakeRepository or a FakeInstalledRepository.
+ *
+ * Various keys can be modified.
+ *
+ * \ingroup g_fake_repository
+ * \since 0.26
+ */
class PALUDIS_VISIBLE FakePackageID :
public PackageID,
private PrivateImplementationPattern<FakePackageID>,
@@ -190,11 +198,16 @@ namespace paludis
virtual void need_masks_added() const;
public:
+ ///\name Basic operations
+ ///\{
+
FakePackageID(const Environment * const e,
const tr1::shared_ptr<const FakeRepositoryBase> &,
const QualifiedPackageName &, const VersionSpec &, const std::string & eapi);
~FakePackageID();
+ ///\}
+
virtual const std::string canonical_form(const PackageIDCanonicalForm) const;
virtual const QualifiedPackageName name() const;
@@ -229,6 +242,9 @@ namespace paludis
const tr1::shared_ptr<FakeMetadataKeywordSetKey> keywords_key();
const tr1::shared_ptr<FakeMetadataIUseSetKey> iuse_key();
+ ///\name Modifiable keys
+ ///\{
+
const tr1::shared_ptr<FakeMetadataSpecTreeKey<ProvideSpecTree> > provide_key();
const tr1::shared_ptr<FakeMetadataSpecTreeKey<DependencySpecTree> > build_dependencies_key();
const tr1::shared_ptr<FakeMetadataSpecTreeKey<DependencySpecTree> > run_dependencies_key();
@@ -237,10 +253,12 @@ namespace paludis
const tr1::shared_ptr<FakeMetadataSpecTreeKey<FetchableURISpecTree> > fetches_key();
const tr1::shared_ptr<FakeMetadataSpecTreeKey<SimpleURISpecTree> > homepage_key();
- char use_expand_separator() const;
-
void set_slot(const SlotName &);
+ ///\}
+
+ char use_expand_separator() const;
+
virtual bool arbitrary_less_than_comparison(const PackageID &) const;
virtual std::size_t extra_hash_value() const;
diff --git a/paludis/util/kc.hh b/paludis/util/kc.hh
index 60bac08..44f0b5a 100644
--- a/paludis/util/kc.hh
+++ b/paludis/util/kc.hh
@@ -137,6 +137,45 @@ namespace paludis
}
};
+ /**
+ * A KeyedClass is used to avoid huge amounts of boilerplate code for classes that merely
+ * contain a few member variables. It provides type safe, compile-time checked constructors
+ * using arbitrarily ordered named arguments that ensures that all members are initialised
+ * exactly once.
+ *
+ * A typical KeyedClass is constructed like this:
+ *
+ * \code
+ * MyKeyedClass foo(MyKeyedClass::named_create()
+ * (k::first_param(), "first")
+ * (k::second_param(), second())
+ * (k::third_param(), 3)
+ * );
+ * \endcode
+ *
+ * Member access is:
+ *
+ * \code
+ * std::cout << foo[k::first_param()];
+ * foo[k::second_param()] = another_value();
+ * \endcode
+ *
+ * A KeyedClass can be declared through a typedef, or through subclassing if additional
+ * functionality is required:
+ *
+ * \code
+ * typedef kc::KeyedClass<
+ * kc::Field<k::first_param, std::string>,
+ * kc::Field<k::second_param, std::string>,
+ * kc::Field<k::third_param, int>
+ * > MyKeyedClass;
+ * \endcode
+ *
+ * All keys are in the paludis::k:: namespace.
+ *
+ * \since 0.26
+ * \ingroup g_data_structures
+ */
template <
typename T1_,
typename T2_,
@@ -181,8 +220,17 @@ namespace paludis
public Part<T20_>
{
public:
+ /**
+ * Convenience access to our own type.
+ */
typedef KeyedClass BaseType;
+ ///\name Basic operations
+ ///\{
+
+ /**
+ * Constructor, using ordered literal parameters.
+ */
KeyedClass
(
const typename T1_::ConstructorType & v1 = typename T1_::DefaultConstructorValueType(),
@@ -229,6 +277,9 @@ namespace paludis
{
}
+ /**
+ * Copy constructor.
+ */
KeyedClass(const KeyedClass & other) :
Part<T1_>(other),
Part<T2_>(other),
@@ -274,6 +325,12 @@ namespace paludis
using Part<T19_>::operator[];
using Part<T20_>::operator[];
+ /**
+ * Named arguments class helper for KeyedClass.
+ *
+ * \ingroup g_data_structures
+ * \since 0.26
+ */
template <
bool b1_,
bool b2_,
@@ -298,6 +355,9 @@ namespace paludis
>
struct Named
{
+ ///\name Members
+ ///\{
+
NamedField<b1_, T1_> v1;
NamedField<b2_, T2_> v2;
NamedField<b3_, T3_> v3;
@@ -319,10 +379,18 @@ namespace paludis
NamedField<b19_, T19_> v19;
NamedField<b20_, T20_> v20;
+ ///\}
+
+ /**
+ * Empty constructor.
+ */
Named()
{
}
+ /**
+ * Copy constructor.
+ */
Named(
NamedField<b1_, T1_> p1,
NamedField<b2_, T2_> p2,
@@ -368,6 +436,11 @@ namespace paludis
{
}
+ /**
+ * Set a member.
+ *
+ * The member must not have already been set.
+ */
template <typename K_, typename V_>
Named<
tr1::is_same<K_, typename T1_::NamedFirstParamType>::value ? (true && ! b1_) : b1_,
@@ -441,6 +514,9 @@ namespace paludis
}
};
+ /**
+ * Create an empty set of named arguments.
+ */
static Named<
false, false, false, false, false,
false, false, false, false, false,
@@ -454,6 +530,9 @@ namespace paludis
false, false, false, false, false>();
}
+ /**
+ * Create using a fully constructed set of named arguments.
+ */
template <
bool b1_,
bool b2_,
@@ -502,6 +581,8 @@ namespace paludis
Part<T20_>(named.v20)
{
}
+
+ ///\}
};
}
diff --git a/paludis/util/validated.hh b/paludis/util/validated.hh
index a691314..1eb1eaf 100644
--- a/paludis/util/validated.hh
+++ b/paludis/util/validated.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, 2008 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,6 +39,12 @@
namespace paludis
{
+ /**
+ * Default comparator for Validated, used to avoid having to include
+ * huge standard library headers in a -fwd.
+ *
+ * \ingroup g_data_structures
+ */
template <typename T_>
struct PALUDIS_VISIBLE DefaultValidatedComparator :
std::less<T_>