added quite a few sample programs

This commit is contained in:
2015-03-11 06:12:48 +00:00
parent 3793785e7c
commit cb62c4ecd1
41 changed files with 1592 additions and 164 deletions

View File

@ -75,7 +75,6 @@ public:
INVALID_INDEX = ~(qse_size_t)0
};
private:
void init_array (int capacity)
{
if (capacity <= 0)
@ -94,19 +93,19 @@ private:
}
public:
Array (qse_size_t capacity = DEFAULT_CAPACITY): Mmged (QSE_NULL)
Array (qse_size_t capacity = DEFAULT_CAPACITY): Mmged(QSE_NULL)
{
this->init_array (capacity);
}
Array (Mmgr* mmgr, qse_size_t capacity = DEFAULT_CAPACITY): Mmged (mmgr)
Array (Mmgr* mmgr, qse_size_t capacity = DEFAULT_CAPACITY): Mmged(mmgr)
{
this->init_array (capacity);
}
Array (const SelfType& array):
Mmged (array.getMmgr()),
count (0), capacity (0), buffer (QSE_NULL)
Mmged(array.getMmgr()),
count(0), capacity(0), buffer(QSE_NULL)
{
if (array.buffer)
{

View File

@ -320,7 +320,7 @@ public:
typedef RedBlackTreeComparator<T> DefaultComparator;
private:
void init_tree (qse_size_t mpb_size)
void init_tree ()
{
#if defined(QSE_REDBLACKTREE_ALLOCATE_NIL)
// create a nil object. note it doesn't go into the memory pool.
@ -340,19 +340,19 @@ public:
RedBlackTree (qse_size_t mpb_size = 0):
Mmged(QSE_NULL), mp(QSE_NULL, QSE_SIZEOF(Node), mpb_size), node_count(0)
{
this->init_tree (mpb_size);
this->init_tree ();
}
RedBlackTree (Mmgr* mmgr, qse_size_t mpb_size = 0):
Mmged (mmgr), mp (mmgr, QSE_SIZEOF(Node), mpb_size), node_count (0)
Mmged(mmgr), mp(mmgr, QSE_SIZEOF(Node), mpb_size), node_count(0)
{
this->init_tree (mpb_size);
this->init_tree ();
}
RedBlackTree (const SelfType& rbt):
Mmged (rbt.getMmgr()),
mp (rbt.getMmgr(), rbt.mp.getDatumSize(), rbt.mp.getBlockSize()),
node_count (0)
Mmged(rbt.getMmgr()),
mp(rbt.getMmgr(), rbt.mp.getDatumSize(), rbt.mp.getBlockSize()),
node_count(0)
{
#if defined(QSE_REDBLACKTREE_ALLOCATE_NIL)
// create a nil object. note it doesn't go into the memory pool.