aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-29 16:14:38 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-29 16:14:38 +0000
commit916c8f389622ff378016506d907d8cbf5f14cec2 (patch)
tree1c077b611872cf226917477cff3b4c8fa7bff43b
parenta4e09dccf5628a84a84c90868692b150ba9958b5 (diff)
downloadpaludis-916c8f389622ff378016506d907d8cbf5f14cec2.tar.gz
paludis-916c8f389622ff378016506d907d8cbf5f14cec2.tar.xz
Documentation updates
-rw-r--r--doc/Makefile.am4
-rw-r--r--paludis/compare.hh35
-rw-r--r--paludis/dep_atom_flattener.hh22
-rw-r--r--paludis/dep_list.cc3
-rw-r--r--paludis/dep_list.hh3
-rw-r--r--paludis/dep_list_TEST.cc202
-rw-r--r--paludis/destringify.hh29
-rw-r--r--paludis/destringify_TEST.cc15
-rw-r--r--paludis/repository.hh5
9 files changed, 269 insertions, 49 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 482c840..655216d 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -7,7 +7,9 @@ docfiles = \
doc_coding_standards.doxygen \
doc_namespaces.doxygen \
doc_directories.doxygen \
- doc_references.doxygen
+ doc_references.doxygen \
+ doc_licence.doxygen \
+ doc_authors.doxygen
EXTRA_DIST = doxygen.conf.in $(docfiles)
diff --git a/paludis/compare.hh b/paludis/compare.hh
index b44bfc2..32cb363 100644
--- a/paludis/compare.hh
+++ b/paludis/compare.hh
@@ -9,6 +9,11 @@
namespace paludis
{
+ /**
+ * Compare t1 and t2.
+ *
+ * \retval -1 if t1 < t2, 1 if t1 > t2, 0 otherwise.
+ */
inline int compare(int t1, int t2) PALUDIS_ATTRIBUTE((always_inline));
inline int compare(int t1, int t2)
@@ -21,6 +26,11 @@ namespace paludis
return 0;
}
+ /**
+ * Compare t1 and t2.
+ *
+ * \retval -1 if t1 < t2, 1 if t1 > t2, 0 otherwise.
+ */
inline int compare(unsigned t1, unsigned t2) PALUDIS_ATTRIBUTE((always_inline));
inline int compare(unsigned t1, unsigned t2)
@@ -33,6 +43,11 @@ namespace paludis
return 0;
}
+ /**
+ * Compare t1 and t2.
+ *
+ * \retval -1 if t1 < t2, 1 if t1 > t2, 0 otherwise.
+ */
inline int long compare(unsigned long t1, unsigned long t2) PALUDIS_ATTRIBUTE((always_inline));
inline int long compare(unsigned long t1, unsigned long t2)
@@ -45,6 +60,11 @@ namespace paludis
return 0;
}
+ /**
+ * Compare t1 and t2.
+ *
+ * \retval -1 if t1 < t2, 1 if t1 > t2, 0 otherwise.
+ */
inline int compare(long t1, long t2) PALUDIS_ATTRIBUTE((always_inline));
inline int compare(long t1, long t2)
@@ -57,6 +77,11 @@ namespace paludis
return 0;
}
+ /**
+ * Compare t1 and t2.
+ *
+ * \retval -1 if t1 < t2, 1 if t1 > t2, 0 otherwise.
+ */
template <typename T_>
inline int compare(
const std::basic_string<T_> & t1,
@@ -77,6 +102,11 @@ namespace paludis
return 0;
}
+ /**
+ * Compare t1 and t2.
+ *
+ * \retval -1 if t1 < t2, 1 if t1 > t2, 0 otherwise.
+ */
template <typename T_, typename U_>
inline int compare(
const Validated<T_, U_> & t1,
@@ -85,6 +115,11 @@ namespace paludis
return compare(t1.data(), t2.data());
}
+ /**
+ * Compare t1 and t2.
+ *
+ * \retval -1 if t1 < t2, 1 if t1 > t2, 0 otherwise.
+ */
template <typename T_>
int compare(
const T_ & t1,
diff --git a/paludis/dep_atom_flattener.hh b/paludis/dep_atom_flattener.hh
index 90836fd..eb3c24b 100644
--- a/paludis/dep_atom_flattener.hh
+++ b/paludis/dep_atom_flattener.hh
@@ -31,6 +31,10 @@
namespace paludis
{
+ /**
+ * Extract the enabled components of a dep heirarchy for a particular
+ * package.
+ */
class DepAtomFlattener :
private InstantiationPolicy<DepAtomFlattener, instantiation_method::NonCopyableTag>,
protected DepAtomVisitorTypes::ConstVisitor
@@ -47,23 +51,41 @@ namespace paludis
mutable bool _done;
protected:
+ ///\name Visit methods
+ ///{
void visit(const AllDepAtom *);
void visit(const AnyDepAtom *) PALUDIS_ATTRIBUTE((noreturn));
void visit(const UseDepAtom *);
void visit(const BlockDepAtom *) PALUDIS_ATTRIBUTE((noreturn));
void visit(const PackageDepAtom *);
+ ///}
public:
+ /**
+ * Constructor.
+ */
DepAtomFlattener(const Environment * const,
const PackageDatabaseEntry * const,
const DepAtom::ConstPointer);
+ /**
+ * Destructor.
+ */
~DepAtomFlattener();
+ /**
+ * Iterate over our dep atoms.
+ */
typedef std::list<const PackageDepAtom *>::const_iterator Iterator;
+ /**
+ * Iterator to the start of our dep atoms.
+ */
Iterator begin();
+ /**
+ * Iterator to past the end of our dep atoms.
+ */
Iterator end() const
{
return _atoms.end();
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index bdc5fce..4ab23a4 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -83,6 +83,9 @@ BlockError::BlockError(const std::string & msg) throw () :
namespace paludis
{
+ /**
+ * Implementation data for DepList.
+ */
template<>
struct Implementation<DepList> :
InstantiationPolicy<Implementation<DepList>, instantiation_method::NonCopyableTag>,
diff --git a/paludis/dep_list.hh b/paludis/dep_list.hh
index 5cb6cf5..89f243d 100644
--- a/paludis/dep_list.hh
+++ b/paludis/dep_list.hh
@@ -165,6 +165,9 @@ namespace paludis
{
}
+ /**
+ * How large is our circular dependency cycle?
+ */
unsigned cycle_size() const
{
return _cycle_size;
diff --git a/paludis/dep_list_TEST.cc b/paludis/dep_list_TEST.cc
index d93e11d..ab855e3 100644
--- a/paludis/dep_list_TEST.cc
+++ b/paludis/dep_list_TEST.cc
@@ -28,71 +28,103 @@ using namespace test;
namespace test_cases
{
- struct DepListTestCaseBase : TestCase
+ /**
+ * Convenience base class used by many of the DepList tests.
+ *
+ * \ingroup Test
+ */
+ class DepListTestCaseBase : TestCase
{
- TestEnvironment env;
- FakeRepository::Pointer repo;
- std::deque<std::string> expected;
- std::string merge_target;
- bool done_populate;
-
- DepListTestCaseBase(const int i) :
- TestCase("dep list " + stringify(i)),
- env(),
- repo(new FakeRepository(RepositoryName("repo"))),
- done_populate(false)
- {
- env.package_database()->add_repository(repo);
- }
+ protected:
+ TestEnvironment env;
+ FakeRepository::Pointer repo;
+ std::deque<std::string> expected;
+ std::string merge_target;
+ bool done_populate;
+
+ /**
+ * Constructor.
+ */
+ DepListTestCaseBase(const int i) :
+ TestCase("dep list " + stringify(i)),
+ env(),
+ repo(new FakeRepository(RepositoryName("repo"))),
+ done_populate(false)
+ {
+ env.package_database()->add_repository(repo);
+ }
- virtual void populate_repo() = 0;
+ /**
+ * Populate our repo member.
+ */
+ virtual void populate_repo() = 0;
- virtual void populate_expected() = 0;
+ /**
+ * Populate our expected member.
+ */
+ virtual void populate_expected() = 0;
- void run()
- {
- if (! done_populate)
+ /**
+ * Check expected is what we got.
+ */
+ virtual void check_lists()
{
- populate_repo();
- populate_expected();
- done_populate = true;
+ TEST_CHECK(true);
+ DepList d(&env);
+ d.add(DepParser::parse(merge_target));
+ TEST_CHECK(true);
+
+ unsigned n(0);
+ std::deque<std::string>::const_iterator exp(expected.begin());
+ DepList::Iterator got(d.begin());
+ while (true)
+ {
+ TestMessageSuffix s(stringify(n++), true);
+
+ TEST_CHECK((exp == expected.end()) == (got == d.end()));
+ if (got == d.end())
+ break;
+ TEST_CHECK_STRINGIFY_EQUAL(*got, *exp);
+ ++exp;
+ ++got;
+ }
}
- check_lists();
- }
-
- virtual void check_lists()
- {
- TEST_CHECK(true);
- DepList d(&env);
- d.add(DepParser::parse(merge_target));
- TEST_CHECK(true);
- unsigned n(0);
- std::deque<std::string>::const_iterator exp(expected.begin());
- DepList::Iterator got(d.begin());
- while (true)
+ public:
+ void run()
{
- TestMessageSuffix s(stringify(n++), true);
-
- TEST_CHECK((exp == expected.end()) == (got == d.end()));
- if (got == d.end())
- break;
- TEST_CHECK_STRINGIFY_EQUAL(*got, *exp);
- ++exp;
- ++got;
+ if (! done_populate)
+ {
+ populate_repo();
+ populate_expected();
+ done_populate = true;
+ }
+ check_lists();
}
- }
};
+ /**
+ * Convenience sub base class used by the numbered DepList tests.
+ *
+ * \ingroup Test
+ */
template <int i_>
struct DepListTestCase : DepListTestCaseBase
{
+ /**
+ * Constructor.
+ */
DepListTestCase() :
DepListTestCaseBase(i_)
{
}
};
+ /**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
struct DepListTestCase1 : DepListTestCase<1>
{
void populate_repo()
@@ -107,6 +139,11 @@ namespace test_cases
}
} test_dep_list_1;
+ /**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
struct DepListTestCase2 : DepListTestCase<2>
{
void populate_repo()
@@ -123,6 +160,11 @@ namespace test_cases
}
} test_dep_list_2;
+ /**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
struct DepListTestCase3 : DepListTestCase<3>
{
void populate_repo()
@@ -141,6 +183,11 @@ namespace test_cases
}
} test_dep_list_3;
+ /**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
struct DepListTestCase4 : DepListTestCase<4>
{
void populate_repo()
@@ -159,6 +206,11 @@ namespace test_cases
}
} test_dep_list_4;
+ /**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
struct DepListTestCase5 : DepListTestCase<5>
{
void populate_repo()
@@ -177,6 +229,11 @@ namespace test_cases
}
} test_dep_list_5;
+ /**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
struct DepListTestCase6 : DepListTestCase<6>
{
void populate_repo()
@@ -195,6 +252,11 @@ namespace test_cases
}
} test_dep_list_6;
+ /**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
struct DepListTestCase7 : DepListTestCase<7>
{
void populate_repo()
@@ -215,6 +277,11 @@ namespace test_cases
}
} test_dep_list_7;
+ /**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
struct DepListTestCase8 : DepListTestCase<8>
{
void populate_repo()
@@ -235,6 +302,11 @@ namespace test_cases
}
} test_dep_list_8;
+ /**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
struct DepListTestCase9 : DepListTestCase<9>
{
void populate_repo()
@@ -255,6 +327,11 @@ namespace test_cases
}
} test_dep_list_9;
+ /**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
struct DepListTestCase10 : DepListTestCase<10>
{
void populate_repo()
@@ -272,6 +349,11 @@ namespace test_cases
}
} test_dep_list_10;
+ /**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
struct DepListTestCase11 : DepListTestCase<11>
{
void populate_repo()
@@ -291,6 +373,11 @@ namespace test_cases
}
} test_dep_list_11;
+ /**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
struct DepListTestCase12 : DepListTestCase<12>
{
void populate_repo()
@@ -310,6 +397,11 @@ namespace test_cases
}
} test_dep_list_12;
+ /**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
struct DepListTestCase13 : DepListTestCase<13>
{
void populate_repo()
@@ -330,6 +422,11 @@ namespace test_cases
}
} test_dep_list_13;
+ /**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
struct DepListTestCase14 : DepListTestCase<14>
{
void populate_repo()
@@ -346,6 +443,11 @@ namespace test_cases
}
} test_dep_list_14;
+ /**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
struct DepListTestCase15 : DepListTestCase<15>
{
void populate_repo()
@@ -363,6 +465,11 @@ namespace test_cases
}
} test_dep_list_15;
+ /**
+ * \test Test DepList transactional add behaviour.
+ *
+ * \ingroup Test
+ */
struct DepListTestCaseTransactionalAdd : TestCase
{
DepListTestCaseTransactionalAdd() : TestCase("dep list transactional add") { }
@@ -393,6 +500,11 @@ namespace test_cases
}
} test_dep_list_transactional_add;
+ /**
+ * \test Test DepList transactional add behaviour on PDEPENDs.
+ *
+ * \ingroup Test
+ */
struct DepListTestCaseTransactionalAddPost : TestCase
{
DepListTestCaseTransactionalAddPost() : TestCase("dep list transactional add post") { }
diff --git a/paludis/destringify.hh b/paludis/destringify.hh
index dc85685..a8df9cd 100644
--- a/paludis/destringify.hh
+++ b/paludis/destringify.hh
@@ -43,11 +43,20 @@ namespace paludis
DestringifyError(const std::string & str) throw ();
};
+ /**
+ * For internal use by destringify.
+ */
namespace destringify_internals
{
+ /**
+ * Basic destringifier.
+ */
template <typename Type_, typename Exception_>
struct Destringifier
{
+ /**
+ * Do the destringification.
+ */
static Type_ do_destringify(const std::string & s)
{
std::istringstream ss(s);
@@ -59,18 +68,30 @@ namespace paludis
}
};
+ /**
+ * Specialised destringify for std::string.
+ */
template <typename Exception_>
struct Destringifier<std::string, Exception_>
{
+ /**
+ * Do the destringification.
+ */
static std::string do_destringify(const std::string & s)
{
return s;
}
};
+ /**
+ * Specialised destringify for bool.
+ */
template <typename Exception_>
struct Destringifier<bool, Exception_>
{
+ /**
+ * Do the destringification.
+ */
static bool do_destringify(const std::string & s)
{
int i;
@@ -79,12 +100,12 @@ namespace paludis
i = Destringifier<int, Exception_>::do_destringify(s);
return i > 0;
}
- catch(DestringifyError &)
+ catch (DestringifyError &)
{
bool b;
std::istringstream ss(s);
ss >> std::boolalpha >> b;
- if(!ss.eof() || ss.bad())
+ if (! ss.eof() || ss.bad())
throw Exception_(s);
return b;
}
@@ -104,6 +125,10 @@ namespace paludis
return destringify_internals::Destringifier<Type_, Exception_>::do_destringify(s);
}
+ /**
+ * Extract a value of some type from a string (overload with a default
+ * exception of DestringifyError).
+ */
template <typename Type_>
Type_ destringify(const std::string & s)
{
diff --git a/paludis/destringify_TEST.cc b/paludis/destringify_TEST.cc
index be543a0..ec1e936 100644
--- a/paludis/destringify_TEST.cc
+++ b/paludis/destringify_TEST.cc
@@ -54,6 +54,11 @@ namespace test_cases
}
} test_case_destringify_int;
+ /** \test
+ * Test destringify for floats.
+ *
+ * \ingroup Test
+ */
struct DestringifyFloatTests : TestCase
{
DestringifyFloatTests() : TestCase("destringify float") { }
@@ -68,6 +73,11 @@ namespace test_cases
}
} test_case_destringify_float;
+ /** \test
+ * Test destringify for strings.
+ *
+ * \ingroup Test
+ */
struct DestringifyStringTests : TestCase
{
DestringifyStringTests() : TestCase("destringify string") { }
@@ -79,6 +89,11 @@ namespace test_cases
}
} test_case_destringify_string;
+ /** \test
+ * Test destringify for bool.
+ *
+ * \ingroup Test
+ */
struct DestringifyBoolTests : TestCase
{
DestringifyBoolTests() : TestCase("destringify bool") { }
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 18c3973..62ecec3 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -322,8 +322,11 @@ namespace paludis
class PackageDatabase;
+ /**
+ * Virtual constructor for repositories.
+ */
typedef VirtualConstructor<std::string,
- CountedPtr<Repository> (*) (const PackageDatabase * const, const std::map<std::string, std::string> &),
+ Repository::Pointer (*) (const PackageDatabase * const, const std::map<std::string, std::string> &),
virtual_constructor_not_found::ThrowException<NoSuchRepositoryTypeError> > RepositoryMaker;
}