refs #91 Doxygen fixes in containers, predicates, and plugins.

Fixed PREDEFINED config in Doxyfile, so Doxygen only sees the variadic predicates.
This commit is contained in:
Mathew Sutcliffe
2014-02-08 14:11:15 +00:00
parent e46a883f08
commit c966d487f0
6 changed files with 30 additions and 10 deletions

View File

@@ -1621,7 +1621,7 @@ INCLUDE_FILE_PATTERNS =
# undefined via #undef or recursively expanded use the := operator # undefined via #undef or recursively expanded use the := operator
# instead of the = operator. # instead of the = operator.
PREDEFINED := Q_COMPILER_VARIADIC_TEMPLATES PREDEFINED = Q_COMPILER_VARIADIC_TEMPLATES:=1
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded. # this tag can be used to specify a list of macro names that should be expanded.

View File

@@ -1621,7 +1621,7 @@ INCLUDE_FILE_PATTERNS =
# undefined via #undef or recursively expanded use the := operator # undefined via #undef or recursively expanded use the := operator
# instead of the = operator. # instead of the = operator.
PREDEFINED := Q_COMPILER_VARIADIC_TEMPLATES PREDEFINED = Q_COMPILER_VARIADIC_TEMPLATES:=1
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded. # this tag can be used to specify a list of macro names that should be expanded.

View File

@@ -66,8 +66,8 @@ namespace BlackMisc
/*! /*!
* \brief Create a new iterator with a specific implementation type. * \brief Create a new iterator with a specific implementation type.
* \tparam C Becomes the iterator's implementation type. * \tparam I Becomes the iterator's implementation type.
* \param c Initial value for the iterator. The value is copied. * \param i Initial value for the iterator. The value is copied.
*/ */
template <class I> static ConstForwardIterator fromImpl(I i) { return ConstForwardIterator(new Pimpl<I>(std::move(i))); } template <class I> static ConstForwardIterator fromImpl(I i) { return ConstForwardIterator(new Pimpl<I>(std::move(i))); }
@@ -214,8 +214,8 @@ namespace BlackMisc
/*! /*!
* \brief Create a new iterator with a specific implementation type. * \brief Create a new iterator with a specific implementation type.
* \tparam C Becomes the iterator's implementation type. * \tparam I Becomes the iterator's implementation type.
* \param c Initial value for the iterator. The value is copied. * \param i Initial value for the iterator. The value is copied.
*/ */
template <class I> static ConstBidirectionalIterator fromImpl(I i) { return ConstBidirectionalIterator(new Pimpl<I>(std::move(i))); } template <class I> static ConstBidirectionalIterator fromImpl(I i) { return ConstBidirectionalIterator(new Pimpl<I>(std::move(i))); }
@@ -421,8 +421,8 @@ namespace BlackMisc
/*! /*!
* \brief Create a new iterator with a specific implementation type. * \brief Create a new iterator with a specific implementation type.
* \tparam C Becomes the iterator's implementation type. * \tparam I Becomes the iterator's implementation type.
* \param c Initial value for the iterator. The value is copied. * \param i Initial value for the iterator. The value is copied.
*/ */
template <class I> static BidirectionalIterator fromImpl(I i) { return BidirectionalIterator(new Pimpl<I>(std::move(i))); } template <class I> static BidirectionalIterator fromImpl(I i) { return BidirectionalIterator(new Pimpl<I>(std::move(i))); }

View File

@@ -92,6 +92,7 @@ namespace BlackMisc
*/ */
struct TPluginDeleter struct TPluginDeleter
{ {
//! Delete a plugin
static void cleanup(IPlugin *plugin) static void cleanup(IPlugin *plugin)
{ {
if (plugin) { if (plugin) {

View File

@@ -23,42 +23,58 @@ namespace BlackMisc
namespace Private namespace Private
{ {
//! \internal //! For internal use of BlackMisc::Predicates
template <class...> struct MemberEqual; template <class...> struct MemberEqual;
//! For internal use of BlackMisc::Predicates
template <class T, class M, class V> struct MemberEqual<T, M, V> template <class T, class M, class V> struct MemberEqual<T, M, V>
{ {
//! \brief
//! @{
M m; M m;
V v; V v;
MemberEqual(M m_, V v_) : m(m_), v(v_) {} MemberEqual(M m_, V v_) : m(m_), v(v_) {}
bool operator()(const T &obj) const { return (obj.*m)() == v; } bool operator()(const T &obj) const { return (obj.*m)() == v; }
//! @}
}; };
//! For internal use of BlackMisc::Predicates
template <class T, class M, class V, class... Tail> struct MemberEqual<T, M, V, Tail...> template <class T, class M, class V, class... Tail> struct MemberEqual<T, M, V, Tail...>
{ {
//! \brief
//! @{
MemberEqual<T, M, V> head; MemberEqual<T, M, V> head;
MemberEqual<T, Tail...> tail; MemberEqual<T, Tail...> tail;
MemberEqual(M m, V v, Tail... tail_) : head(m, v), tail(tail_...) {} MemberEqual(M m, V v, Tail... tail_) : head(m, v), tail(tail_...) {}
bool operator()(const T &obj) const { return head(obj) && tail(obj); } bool operator()(const T &obj) const { return head(obj) && tail(obj); }
//! @}
}; };
//! \internal //! For internal use of BlackMisc::Predicates
template <class...> struct MemberLess; template <class...> struct MemberLess;
//! For internal use of BlackMisc::Predicates
template <class T, class M> struct MemberLess<T, M> template <class T, class M> struct MemberLess<T, M>
{ {
//! \brief
//! @{
M m; M m;
MemberLess(M m_) : m(m_) {} MemberLess(M m_) : m(m_) {}
bool operator()(const T &a, const T &b) const { return (a.*m)() < (b.*m)(); } bool operator()(const T &a, const T &b) const { return (a.*m)() < (b.*m)(); }
bool isStable(const T &a, const T &b) const { return (a.*m)() != (b.*m)(); } bool isStable(const T &a, const T &b) const { return (a.*m)() != (b.*m)(); }
//! @}
}; };
//! For internal use of BlackMisc::Predicates
template <class T, class M, class... Tail> struct MemberLess<T, M, Tail...> template <class T, class M, class... Tail> struct MemberLess<T, M, Tail...>
{ {
//! \brief
//! @{
MemberLess<T, M> head; MemberLess<T, M> head;
MemberLess<T, Tail...> tail; MemberLess<T, Tail...> tail;
MemberLess(M m, Tail... tail_) : head(m), tail(tail_...) {} MemberLess(M m, Tail... tail_) : head(m), tail(tail_...) {}
bool operator()(const T &a, const T &b) const { return head.isStable(a, b) ? head(a, b) : tail(a, b); } bool operator()(const T &a, const T &b) const { return head.isStable(a, b) ? head(a, b) : tail(a, b); }
//! @}
}; };
} //namespace Private } //namespace Private

View File

@@ -243,6 +243,7 @@ namespace BlackMisc
* \brief Modify by applying a value map to each element matching a particular key/value pair. * \brief Modify by applying a value map to each element matching a particular key/value pair.
* \param key1 A pointer to a member function of T. * \param key1 A pointer to a member function of T.
* \param value1 Will be compared to the return value of key1. * \param value1 Will be compared to the return value of key1.
* \param newValues Values from this map will be put into each matching element.
*/ */
template <class K1, class V1> template <class K1, class V1>
void applyIf(K1 key1, V1 value1, const CValueMap &newValues) void applyIf(K1 key1, V1 value1, const CValueMap &newValues)
@@ -288,6 +289,7 @@ namespace BlackMisc
* \brief Replace elements matching a particular key/value pair. * \brief Replace elements matching a particular key/value pair.
* \param key1 A pointer to a member function of T. * \param key1 A pointer to a member function of T.
* \param value1 Will be compared to the return value of key1. * \param value1 Will be compared to the return value of key1.
* \param replacement All matching elements will be replaced by copies of this one.
*/ */
template <class K1, class V1> template <class K1, class V1>
void replaceIf(K1 key1, V1 value1, const T &replacement) void replaceIf(K1 key1, V1 value1, const T &replacement)
@@ -320,6 +322,7 @@ namespace BlackMisc
* \brief Replace elements matching a particular key/value pair. If there is no match, push the new element on the end. * \brief Replace elements matching a particular key/value pair. If there is no match, push the new element on the end.
* \param key1 A pointer to a member function of T. * \param key1 A pointer to a member function of T.
* \param value1 Will be compared to the return value of key1. * \param value1 Will be compared to the return value of key1.
* \param replacement All matching elements will be replaced by copies of this one, or a copy will be added.
* \pre The sequence must be initialized. * \pre The sequence must be initialized.
*/ */
template <class K1, class V1> template <class K1, class V1>