aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-10-10 11:36:28 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-10-10 11:36:28 +0000
commitf0c21206dd97b56364baa3bc35d9835c3a528d1f (patch)
treed7ffd8735f4e335518f53e883e140b81ac2cb977
parent459d56df81bb189a7536920b9724e2fa10be7e4a (diff)
downloadpaludis-f0c21206dd97b56364baa3bc35d9835c3a528d1f.tar.gz
paludis-f0c21206dd97b56364baa3bc35d9835c3a528d1f.tar.xz
More doxygen work
-rw-r--r--doc/doc_main.doxygen12
-rw-r--r--paludis/args/checks_arg.hh25
-rw-r--r--paludis/args/debug_build_arg.hh25
-rw-r--r--paludis/args/dep_list_args_group.hh22
-rw-r--r--paludis/args/deps_option_arg.hh25
-rw-r--r--paludis/args/do_help.hh23
-rw-r--r--paludis/args/install_args_group.hh40
-rw-r--r--paludis/args/log_level_arg.hh25
-rw-r--r--paludis/dep_spec_flattener.hh35
-rw-r--r--paludis/util/action_queue.hh29
-rw-r--r--paludis/util/condition_variable.hh38
-rw-r--r--paludis/util/future-impl.hh6
-rw-r--r--paludis/util/future.hh61
-rw-r--r--paludis/util/idle_action_pool.hh23
-rw-r--r--paludis/util/map-impl.hh11
-rw-r--r--paludis/util/mutex.hh52
-rw-r--r--paludis/util/parallel_for_each.hh28
-rw-r--r--paludis/util/sequence-impl.hh6
-rw-r--r--paludis/util/set-impl.hh12
-rw-r--r--paludis/util/sr.hh10
-rw-r--r--paludis/util/thread.hh28
-rw-r--r--paludis/util/thread_pool.hh28
22 files changed, 564 insertions, 0 deletions
diff --git a/doc/doc_main.doxygen b/doc/doc_main.doxygen
index ed9d7ff..0b4c2ae 100644
--- a/doc/doc_main.doxygen
+++ b/doc/doc_main.doxygen
@@ -356,3 +356,15 @@ using namespace paludis;
* - None at this time.
*/
+/** \defgroup g_threads "Threads"
+ *
+ * \ingroup g_utils
+ *
+ * Paludis includes some basic thread classes. Most users will not have threads
+ * enabled at the moment.
+ *
+ * \section Examples
+ *
+ * - None at this time.
+ */
+
diff --git a/paludis/args/checks_arg.hh b/paludis/args/checks_arg.hh
index b3a820d..b785437 100644
--- a/paludis/args/checks_arg.hh
+++ b/paludis/args/checks_arg.hh
@@ -23,17 +23,42 @@
#include <paludis/args/args_option.hh>
#include <paludis/action-fwd.hh>
+/** \file
+ * Declarations for the Checks class.
+ *
+ * \ingroup g_args
+ *
+ * \section Examples
+ *
+ * - None at this time.
+ */
+
namespace paludis
{
namespace args
{
+ /**
+ * The '--checks' standard command line argument.
+ *
+ * \since 0.26
+ * \ingroup g_args
+ * \nosubgrouping
+ */
class PALUDIS_VISIBLE ChecksArg :
public EnumArg
{
public:
+ ///\name Basic operations
+ ///\{
+
ChecksArg(ArgsGroup * const, const std::string &, char);
~ChecksArg();
+ ///\}
+
+ /**
+ * Our selected value, as an InstallActionChecksOption.
+ */
InstallActionChecksOption option() const;
};
}
diff --git a/paludis/args/debug_build_arg.hh b/paludis/args/debug_build_arg.hh
index d35904b..d4f83da 100644
--- a/paludis/args/debug_build_arg.hh
+++ b/paludis/args/debug_build_arg.hh
@@ -23,17 +23,42 @@
#include <paludis/args/args_option.hh>
#include <paludis/repository.hh>
+/** \file
+ * Declarations for the DebugBuildArg class.
+ *
+ * \ingroup g_args
+ *
+ * \section Examples
+ *
+ * - None at this time.
+ */
+
namespace paludis
{
namespace args
{
+ /**
+ * The '--debug-build' standard command line argument.
+ *
+ * \since 0.26
+ * \ingroup g_args
+ * \nosubgrouping
+ */
class PALUDIS_VISIBLE DebugBuildArg :
public EnumArg
{
public:
+ ///\name Basic operations
+ ///\{
+
DebugBuildArg(ArgsGroup * const, const std::string &, char);
~DebugBuildArg();
+ ///\}
+
+ /**
+ * Our selected value, as an InstallActionDebugOption.
+ */
InstallActionDebugOption option() const;
};
}
diff --git a/paludis/args/dep_list_args_group.hh b/paludis/args/dep_list_args_group.hh
index 7346615..d20427f 100644
--- a/paludis/args/dep_list_args_group.hh
+++ b/paludis/args/dep_list_args_group.hh
@@ -30,6 +30,13 @@ namespace paludis
{
namespace args
{
+ /**
+ * The standard dep command line arguments.
+ *
+ * \since 0.26
+ * \ingroup g_args
+ * \nosubgrouping
+ */
class PALUDIS_VISIBLE DepListArgsGroup : public ArgsGroup
{
public:
@@ -69,10 +76,25 @@ namespace paludis
/// }
+ /**
+ * Populate a DepListOptions from our values.
+ */
void populate_dep_list_options(const paludis::Environment *, DepListOptions &) const;
+
+ /**
+ * Populate an InstallTask from our values.
+ */
void populate_install_task(const paludis::Environment *, InstallTask &) const;
+ /**
+ * Fetch a fragment for Environment::paludis_command for our
+ * values.
+ */
std::string paludis_command_fragment() const;
+
+ /**
+ * Fetch a fragment for a resume command for our values.
+ */
std::string resume_command_fragment(const InstallTask &) const;
};
}
diff --git a/paludis/args/deps_option_arg.hh b/paludis/args/deps_option_arg.hh
index 938d02c..881346d 100644
--- a/paludis/args/deps_option_arg.hh
+++ b/paludis/args/deps_option_arg.hh
@@ -23,18 +23,43 @@
#include <paludis/args/args_option.hh>
#include <paludis/dep_list.hh>
+/** \file
+ * Declarations for the DepsOptionArg class.
+ *
+ * \ingroup g_args
+ *
+ * \section Examples
+ *
+ * - None at this time.
+ */
+
namespace paludis
{
namespace args
{
+ /**
+ * A '--dl-deps-' standard command line argument.
+ *
+ * \since 0.26
+ * \ingroup g_args
+ * \nosubgrouping
+ */
class PALUDIS_VISIBLE DepsOptionArg :
public EnumArg
{
public:
+ ///\name Basic operations
+ ///\{
+
DepsOptionArg(ArgsGroup * const, const std::string &, char,
const std::string &, const DepListDepsOption);
~DepsOptionArg();
+ ///\}
+
+ /**
+ * Our selected value, as a DepListDepsOption.
+ */
DepListDepsOption option() const;
};
diff --git a/paludis/args/do_help.hh b/paludis/args/do_help.hh
index a5fa03f..f2be677 100644
--- a/paludis/args/do_help.hh
+++ b/paludis/args/do_help.hh
@@ -20,18 +20,41 @@
#ifndef PALUDIS_GUARD_SRC_COMMON_ARGS_DO_HELP_HH
#define PALUDIS_GUARD_SRC_COMMON_ARGS_DO_HELP_HH 1
+/** \file
+ * Declarations for the DoHelp class.
+ *
+ * \ingroup g_args
+ *
+ * \section Examples
+ *
+ * - None at this time.
+ */
+
namespace paludis
{
namespace args
{
+ /**
+ * Convenience struct for --help handling.
+ *
+ * \ingroup g_args
+ */
struct PALUDIS_VISIBLE DoHelp
{
+ /**
+ * Our message, if one is necessary.
+ */
const std::string message;
+ ///\name Basic operations
+ ///\{
+
DoHelp(const std::string & m = "") :
message(m)
{
}
+
+ ///\}
};
}
}
diff --git a/paludis/args/install_args_group.hh b/paludis/args/install_args_group.hh
index bdf7d43..7f44bf3 100644
--- a/paludis/args/install_args_group.hh
+++ b/paludis/args/install_args_group.hh
@@ -29,10 +29,27 @@
#include <paludis/dep_list-fwd.hh>
#include <paludis/install_task.hh>
+/** \file
+ * Declarations for the InstallArgsGroup class.
+ *
+ * \ingroup g_args
+ *
+ * \section Examples
+ *
+ * - None at this time.
+ */
+
namespace paludis
{
namespace args
{
+ /**
+ * Standard install arguments.
+ *
+ * \ingroup g_args
+ * \since 0.26
+ * \nosubgrouping
+ */
class PALUDIS_VISIBLE InstallArgsGroup : public ArgsGroup
{
public:
@@ -83,10 +100,24 @@ namespace paludis
/// }
+ /**
+ * Populate a DepListOptions from our values.
+ */
void populate_dep_list_options(const Environment *, DepListOptions &) const;
+
+ /**
+ * Fetch our specified destinations set.
+ */
tr1::shared_ptr<const DestinationsSet> destinations(Environment *) const;
+
+ /**
+ * Populate an InstallTask from our values.
+ */
void populate_install_task(const Environment *, InstallTask &) const;
+ ///\name Assorted options
+ ///\{
+
bool want_full_install_reasons() const;
bool want_install_reasons() const;
bool want_tags_summary() const;
@@ -96,7 +127,16 @@ namespace paludis
bool want_changed_use_flags() const;
bool want_new_use_flags() const;
+ ///\}
+
+ /**
+ * Create a fragment for Environment::paludis_command.
+ */
std::string paludis_command_fragment() const;
+
+ /**
+ * Create a fragment for a resume command.
+ */
std::string resume_command_fragment(const InstallTask &) const;
};
}
diff --git a/paludis/args/log_level_arg.hh b/paludis/args/log_level_arg.hh
index c2efbc3..34e8c6a 100644
--- a/paludis/args/log_level_arg.hh
+++ b/paludis/args/log_level_arg.hh
@@ -23,17 +23,42 @@
#include <paludis/args/args_option.hh>
#include <paludis/util/log.hh>
+/** \file
+ * Declarations for the LogLevelArg class.
+ *
+ * \ingroup g_args
+ *
+ * \section Examples
+ *
+ * - None at this time.
+ */
+
namespace paludis
{
namespace args
{
+ /**
+ * The '--log-level' standard command line argument.
+ *
+ * \since 0.26
+ * \ingroup g_args
+ * \nosubgrouping
+ */
class PALUDIS_VISIBLE LogLevelArg :
public EnumArg
{
public:
+ ///\name Basic operations
+ ///\{
+
LogLevelArg(ArgsGroup * const, const std::string &, char);
~LogLevelArg();
+ ///\}
+
+ /**
+ * Our selected value, as a LogLevel.
+ */
LogLevel option() const;
};
diff --git a/paludis/dep_spec_flattener.hh b/paludis/dep_spec_flattener.hh
index 2e797e8..9756342 100644
--- a/paludis/dep_spec_flattener.hh
+++ b/paludis/dep_spec_flattener.hh
@@ -45,14 +45,35 @@
namespace paludis
{
+ /** \namespace dep_spec_flattener_internals
+ *
+ * For internal use by DepSpecFlattener.
+ *
+ * \ingroup g_dep_spec
+ * \since 0.26
+ */
namespace dep_spec_flattener_internals
{
+ /**
+ * Implement visit for NamedSetDepSpec, if necessary.
+ *
+ * \ingroup g_dep_spec
+ * \since 0.26
+ * \nosubgrouping
+ */
template <typename H_, typename I_, bool b_>
struct VisitNamedSetDepSpec
{
void visit_leaf(const NoType<0u> &);
};
+ /**
+ * Implement visit for NamedSetDepSpec, if necessary.
+ *
+ * \ingroup g_dep_spec
+ * \since 0.26
+ * \nosubgrouping
+ */
template <typename H_, typename I_>
class VisitNamedSetDepSpec<H_, I_, true> :
public virtual visitor_internals::Visits<const TreeLeaf<H_, NamedSetDepSpec> >,
@@ -69,12 +90,26 @@ namespace paludis
void visit_leaf(const NamedSetDepSpec &);
};
+ /**
+ * Implement visit for UseDepSpec, if necessary.
+ *
+ * \ingroup g_dep_spec
+ * \since 0.26
+ * \nosubgrouping
+ */
template <typename H_, typename I_, bool b_>
struct VisitUseDepSpec
{
void visit_sequence(const NoType<0u> &);
};
+ /**
+ * Implement visit for UseDepSpec, if necessary.
+ *
+ * \ingroup g_dep_spec
+ * \since 0.26
+ * \nosubgrouping
+ */
template <typename H_, typename I_>
struct VisitUseDepSpec<H_, I_, true> :
virtual visitor_internals::Visits<const ConstTreeSequence<H_, UseDepSpec> >
diff --git a/paludis/util/action_queue.hh b/paludis/util/action_queue.hh
index 56571e3..0593d56 100644
--- a/paludis/util/action_queue.hh
+++ b/paludis/util/action_queue.hh
@@ -25,17 +25,46 @@
namespace paludis
{
+ /**
+ * An ActionQueue consists of a number of threads that take tasks from a
+ * queue.
+ *
+ * If threads are disabled, enqueueing an item executes it immediately.
+ *
+ * \ingroup g_threads
+ * \since 0.26
+ * \nosubgrouping
+ */
class PALUDIS_VISIBLE ActionQueue :
private PrivateImplementationPattern<ActionQueue>
{
public:
+ ///\name Basic operations
+ ///\{
+
ActionQueue(const unsigned n_threads = 1, const bool nice = false);
~ActionQueue();
+ ///\}
+
+ /**
+ * Enqueue an item.
+ */
void enqueue(const tr1::function<void () throw ()> &);
+
+ /**
+ * Complete any pending tasks.
+ */
void complete_pending();
+
+ /**
+ * Forget any pending tasks.
+ */
void forget_pending();
+ /**
+ * How many threads do we have?
+ */
unsigned number_of_threads() const;
};
}
diff --git a/paludis/util/condition_variable.hh b/paludis/util/condition_variable.hh
index 93751ba..0e89d69 100644
--- a/paludis/util/condition_variable.hh
+++ b/paludis/util/condition_variable.hh
@@ -27,8 +27,27 @@
# include <pthread.h>
#endif
+/** \file
+ * Declarations for the ConditionVariable class.
+ *
+ * \ingroup g_threads
+ *
+ * \section Examples
+ *
+ * - None at this time.
+ */
+
namespace paludis
{
+ /**
+ * A basic condition variable.
+ *
+ * If threading is disabled, waiting and signalling are no-ops.
+ *
+ * \ingroup g_threads
+ * \since 0.26
+ * \nosubgrouping
+ */
class PALUDIS_VISIBLE ConditionVariable
{
private:
@@ -40,13 +59,32 @@ namespace paludis
#endif
public:
+ ///\name Basic operations
+ ///\{
+
ConditionVariable();
~ConditionVariable();
+ ///\}
+
+ /**
+ * Broadcast to all waiting threads.
+ */
void broadcast();
+
+ /**
+ * Signal one waiting thread.
+ */
void signal();
+
+ /**
+ * Acquire the specified Mutex, then signal.
+ */
void acquire_then_signal(Mutex &);
+ /**
+ * Wait, using the specified Mutex for synchronisation.
+ */
void wait(Mutex &);
};
}
diff --git a/paludis/util/future-impl.hh b/paludis/util/future-impl.hh
index 52b97e4..49872e7 100644
--- a/paludis/util/future-impl.hh
+++ b/paludis/util/future-impl.hh
@@ -36,6 +36,12 @@ namespace paludis
tr1::shared_ptr<Mutex> mutex,
tr1::shared_ptr<ConditionVariable> condition);
+ /**
+ * Implementation data for a Future.
+ *
+ * \ingroup g_threads
+ * \nosubgrouping
+ */
template <>
template <typename T_>
struct Implementation<Future<T_> >
diff --git a/paludis/util/future.hh b/paludis/util/future.hh
index d6887f9..543785d 100644
--- a/paludis/util/future.hh
+++ b/paludis/util/future.hh
@@ -26,8 +26,25 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/action_queue.hh>
+/** \file
+ * Declarations for the Future class.
+ *
+ * \ingroup g_threads
+ *
+ * \section Examples
+ *
+ * - None at this time.
+ */
+
namespace paludis
{
+ /**
+ * Internal use by Future.
+ *
+ * \ingroup g_threads
+ * \since 0.26
+ * \nosubgrouping
+ */
class PALUDIS_VISIBLE FutureActionQueue :
public ActionQueue,
public InstantiationPolicy<FutureActionQueue, instantiation_method::SingletonTag>
@@ -35,10 +52,30 @@ namespace paludis
friend class InstantiationPolicy<FutureActionQueue, instantiation_method::SingletonTag>;
public:
+ ///\name Basic operations
+ ///\{
+
FutureActionQueue();
~FutureActionQueue();
+
+ ///\}
};
+ /**
+ * A Future<T_> holds an expression whose result will be needed sometime in the
+ * future.
+ *
+ * If threading is disabled, the result is calculated when it is needed.
+ *
+ * If threading is enabled, the expression is queued in FutureActionQueue,
+ * where it will be executed at some point in the future. If it is needed
+ * before FutureActionQueue has executed, it is executed at that point in
+ * the active thread.
+ *
+ * \ingroup g_threads
+ * \since 0.26
+ * \nosubgrouping
+ */
template <typename T_>
class PALUDIS_VISIBLE Future :
private PrivateImplementationPattern<Future<T_> >
@@ -47,12 +84,28 @@ namespace paludis
using PrivateImplementationPattern<Future<T_> >::_imp;
public:
+ ///\name Basic operations
+ ///\{
+
Future(const tr1::function<T_ () throw ()> &);
~Future();
+ ///\}
+
+ /**
+ * Fetch a copy of our result. If our result has not yet been
+ * calculated, calculate it first.
+ */
T_ operator() () const PALUDIS_ATTRIBUTE((warn_unused_result));
};
+ /**
+ * Specialisation of Future for expressions with no result.
+ *
+ * \ingroup g_threads
+ * \since 0.26
+ * \nosubgrouping
+ */
template <>
class PALUDIS_VISIBLE Future<void> :
private PrivateImplementationPattern<Future<void> >
@@ -61,9 +114,17 @@ namespace paludis
using PrivateImplementationPattern<Future<void> >::_imp;
public:
+ ///\name Basic operations
+ ///\{
+
Future(const tr1::function<void () throw ()> &);
~Future();
+ ///\}
+
+ /**
+ * Evaluate our expression, if it has not already been evaluated.
+ */
void operator() () const;
};
}
diff --git a/paludis/util/idle_action_pool.hh b/paludis/util/idle_action_pool.hh
index 70bae7a..e8c5fd0 100644
--- a/paludis/util/idle_action_pool.hh
+++ b/paludis/util/idle_action_pool.hh
@@ -27,6 +27,14 @@
namespace paludis
{
+ /**
+ * An IdleActionPool is an ActionQueue holding actions that can be executed
+ * if there is idle CPU time available.
+ *
+ * \ingroup g_threads
+ * \since 0.26
+ * \nosubgrouping
+ */
class PALUDIS_VISIBLE IdleActionPool :
public InstantiationPolicy<IdleActionPool, instantiation_method::SingletonTag>,
private PrivateImplementationPattern<IdleActionPool>
@@ -40,10 +48,25 @@ namespace paludis
void _count_result(const tr1::function<IdleActionResult () throw ()> &);
public:
+ /**
+ * The specified function must be executed at some point, but it
+ * doesn't matter when.
+ */
void required_idle_action(const tr1::function<IdleActionResult () throw ()> &);
+
+ /**
+ * The specified function can be executed at some point.
+ */
void optional_idle_action(const tr1::function<IdleActionResult () throw ()> &);
+ /**
+ * Increment the 'unused' stat.
+ */
void increase_used_stat();
+
+ /**
+ * Increment the 'unprepared' stat.
+ */
void increase_unprepared_stat();
};
}
diff --git a/paludis/util/map-impl.hh b/paludis/util/map-impl.hh
index 00b5767..688b0ba 100644
--- a/paludis/util/map-impl.hh
+++ b/paludis/util/map-impl.hh
@@ -36,12 +36,23 @@
namespace paludis
{
+ /**
+ * The default comparator for a Map is std::less<>.
+ *
+ * \ingroup g_data_structures
+ */
template <typename T_>
struct PALUDIS_VISIBLE DefaultMapComparator :
std::less<T_>
{
};
+ /**
+ * Implementation data for a Map.
+ *
+ * \ingroup g_data_structures
+ * \nosubgrouping
+ */
template <>
template <typename K_, typename V_, typename C_>
struct Implementation<Map<K_, V_, C_> >
diff --git a/paludis/util/mutex.hh b/paludis/util/mutex.hh
index bae7fa9..fa1af2c 100644
--- a/paludis/util/mutex.hh
+++ b/paludis/util/mutex.hh
@@ -26,8 +26,24 @@
# include <pthread.h>
#endif
+/**
+ * Declarations for Mutex, Lock and TryLock.
+ *
+ * \ingroup g_threads
+ *
+ * \section Examples
+ *
+ * - None at this time.
+ */
+
namespace paludis
{
+ /**
+ * A simple mutex class, which can be locked using Lock and TryLock.
+ *
+ * \ingroup g_threads
+ * \since 0.26
+ */
class PALUDIS_VISIBLE Mutex
{
private:
@@ -40,14 +56,28 @@ namespace paludis
#endif
public:
+ ///\name Basic operations
+ ///\{
+
explicit Mutex();
~Mutex();
+ ///\}
+
#ifdef PALUDIS_ENABLE_THREADS
pthread_mutex_t * const posix_mutex() PALUDIS_ATTRIBUTE((warn_unused_result));
#endif
};
+ /**
+ * A RAII lock for a Mutex.
+ *
+ * If threading is disabled, locking is a no-op.
+ *
+ * \ingroup g_threads
+ * \nosubgrouping
+ * \since 0.26
+ */
class PALUDIS_VISIBLE Lock
{
private:
@@ -59,10 +89,24 @@ namespace paludis
#endif
public:
+ ///\name Basic operations
+ ///\{
+
explicit Lock(Mutex &);
~Lock();
+
+ ///\}
};
+ /**
+ * A RAII trylock for a Mutex.
+ *
+ * If threading is disabled, locking is a no-op and the try always succeeds.
+ *
+ * \ingroup g_threads
+ * \since 0.26
+ * \nosubgrouping
+ */
class PALUDIS_VISIBLE TryLock
{
private:
@@ -74,9 +118,17 @@ namespace paludis
#endif
public:
+ ///\name Basic operations
+ ///\{
+
explicit TryLock(Mutex &);
~TryLock();
+ ///\}
+
+ /**
+ * Did the lock succeed?
+ */
bool operator() () const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
diff --git a/paludis/util/parallel_for_each.hh b/paludis/util/parallel_for_each.hh
index 980b42d..ab22ebb 100644
--- a/paludis/util/parallel_for_each.hh
+++ b/paludis/util/parallel_for_each.hh
@@ -32,6 +32,14 @@
namespace paludis
{
+ /**
+ * Advance an iterator by up to the specified amount, not going past another
+ * iterator.
+ *
+ * \ingroup g_iterator
+ * \since 0.26
+ * \nosubgrouping
+ */
template <typename I_, bool is_random_access_>
struct CappedAdvance
{
@@ -44,6 +52,14 @@ namespace paludis
}
};
+ /**
+ * Advance an iterator by up to the specified amount, not going past another
+ * iterator.
+ *
+ * \ingroup g_iterator
+ * \since 0.26
+ * \nosubgrouping
+ */
template <typename I_>
struct CappedAdvance<I_, true>
{
@@ -57,6 +73,12 @@ namespace paludis
}
};
+ /**
+ * Used by parallel_for_each to do one thread's work.
+ *
+ * \ingroup g_threads
+ * \since 0.26
+ */
template <typename I_, typename P_>
void parallel_for_each_worker(I_ cur, const I_ & end, const unsigned partition_size, const P_ & op)
{
@@ -68,6 +90,12 @@ namespace paludis
}
}
+ /**
+ * Execute op on every item in the provided range, possibly in parallel.
+ *
+ * \ingroup g_threads
+ * \since 0.26
+ */
template <typename I_, typename P_>
void parallel_for_each(I_ cur, const I_ & end, const P_ & op,
#ifdef PALUDIS_ENABLE_THREADS
diff --git a/paludis/util/sequence-impl.hh b/paludis/util/sequence-impl.hh
index 98f5da0..308d225 100644
--- a/paludis/util/sequence-impl.hh
+++ b/paludis/util/sequence-impl.hh
@@ -35,6 +35,12 @@
namespace paludis
{
+ /**
+ * Implementation data for a Sequence.
+ *
+ * \ingroup g_data_structures
+ * \nosubgrouping
+ */
template <>
template <typename T_>
struct Implementation<Sequence<T_> >
diff --git a/paludis/util/set-impl.hh b/paludis/util/set-impl.hh
index c660e79..1c98dab 100644
--- a/paludis/util/set-impl.hh
+++ b/paludis/util/set-impl.hh
@@ -35,12 +35,24 @@
namespace paludis
{
+ /**
+ * The default comparator for a Set is std::less<>.
+ *
+ * \ingroup g_data_structures
+ * \nosubgrouping
+ */
template <typename T_>
struct PALUDIS_VISIBLE DefaultSetComparator :
std::less<T_>
{
};
+ /**
+ * Implementation data for a Set.
+ *
+ * \ingroup g_data_structures
+ * \nosubgrouping
+ */
template <>
template <typename T_, typename C_>
struct Implementation<Set<T_, C_> >
diff --git a/paludis/util/sr.hh b/paludis/util/sr.hh
index 7d905af..68da8eb 100644
--- a/paludis/util/sr.hh
+++ b/paludis/util/sr.hh
@@ -75,6 +75,11 @@ namespace paludis
template <bool value_>
struct SelectValue;
+ /**
+ * Metaprogramming: select a value based upon a condition.
+ *
+ * \ingroup g_oo
+ */
template <>
struct SelectValue<true>
{
@@ -85,6 +90,11 @@ namespace paludis
}
};
+ /**
+ * Metaprogramming: select a value based upon a condition.
+ *
+ * \ingroup g_oo
+ */
template <>
struct SelectValue<false>
{
diff --git a/paludis/util/thread.hh b/paludis/util/thread.hh
index efc9df4..a565417 100644
--- a/paludis/util/thread.hh
+++ b/paludis/util/thread.hh
@@ -27,8 +27,28 @@
# include <pthread.h>
#endif
+/** \file
+ * Declarations for the Thread class.
+ *
+ * \ingroup g_threads
+ *
+ * \section Examples
+ *
+ * - None at this time.
+ */
+
namespace paludis
{
+ /**
+ * A basic thread class.
+ *
+ * If threading is disabled, the threaded function is executed immediately
+ * in the current context.
+ *
+ * \ingroup g_threads
+ * \since 0.26
+ * \nosubgrouping
+ */
class PALUDIS_VISIBLE Thread
{
private:
@@ -40,9 +60,17 @@ namespace paludis
#endif
public:
+ ///\name Basic operations
+ ///\{
+
Thread(const tr1::function<void () throw ()> &);
~Thread();
+ ///\}
+
+ /**
+ * Adapt a function for use in IdleActionPool.
+ */
static void idle_adapter(const tr1::function<void () throw ()> &);
};
}
diff --git a/paludis/util/thread_pool.hh b/paludis/util/thread_pool.hh
index a4e9e9e..6f013bd 100644
--- a/paludis/util/thread_pool.hh
+++ b/paludis/util/thread_pool.hh
@@ -24,16 +24,44 @@
#include <paludis/util/attributes.hh>
#include <paludis/util/private_implementation_pattern.hh>
+/** \file
+ * Declarations for the ThreadPool class.
+ *
+ * \ingroup g_threads
+ *
+ * \section Examples
+ *
+ * - None at this time.
+ */
namespace paludis
{
+ /**
+ * A thread pool holds a number of related threads.
+ *
+ * \ingroup g_threads
+ * \nosubgrouping
+ * \since 0.26
+ */
class PALUDIS_VISIBLE ThreadPool :
private PrivateImplementationPattern<ThreadPool>
{
public:
+ ///\name Basic operations
+ ///\{
+
ThreadPool();
~ThreadPool();
+ ///\}
+
+ /**
+ * Create a new thread in our pool.
+ */
void create_thread(const tr1::function<void () throw ()> &);
+
+ /**
+ * How many threads does our pool contain?
+ */
unsigned number_of_threads() const;
};
}