(svn r22411) -Document: another bunch of bits

This commit is contained in:
rubidium
2011-05-02 17:42:12 +00:00
parent eb2197f4c8
commit 9fc2798baf
34 changed files with 155 additions and 19 deletions

View File

@@ -76,6 +76,10 @@ public:
return item;
}
/**
* Helper for creating a human readable output of this data.
* @param dmp The location to dump to.
*/
template <typename D> void Dump(D &dmp) const
{
dmp.WriteLine("capacity = %d", Tcapacity);

View File

@@ -14,12 +14,14 @@
#include "../core/alloc_func.hpp"
/* Enable it if you suspect binary heap doesn't work well */
/** Enable it if you suspect binary heap doesn't work well */
#define BINARYHEAP_CHECK 0
#if BINARYHEAP_CHECK
/** Check for consistency. */
#define CHECK_CONSISTY() this->CheckConsistency()
#else
/** Don't check for consistency. */
#define CHECK_CONSISTY() ;
#endif
@@ -55,6 +57,10 @@ private:
T **data; ///< The pointer to the heap item pointers
public:
/**
* Create a binary heap.
* @param max_items The limit of the heap
*/
explicit CBinaryHeapT(uint max_items)
: items(0)
, capacity(max_items)

View File

@@ -31,8 +31,8 @@ protected:
};
/* make constants visible from outside */
static const uint Tsize = sizeof(T); // size of item
static const uint HeaderSize = sizeof(ArrayHeader); // size of header
static const uint Tsize = sizeof(T); ///< size of item
static const uint HeaderSize = sizeof(ArrayHeader); ///< size of header
/**
* the only member of fixed size array is pointer to the block