<commit_before>/*
 *   CrissCross
 *   A multi-purpose cross-platform library.
 *
 *   A product of Uplink Laboratories.
 *
 *   (c) 2006-2010 <NAME>.
 *   Licensed under the New BSD License.
 *
 */

#ifndef __included_cc_darray_h
#define __included_cc_darray_h

#include <cstring>

#include <crisscross/cc_attr.h>
#include <crisscross/deprecate.h>
#include <crisscross/debug.h>
#include <crisscross/dstack.h>
#include <crisscross/sort.h>

namespace CrissCross
{
	namespace Data
	{
		template <class Key, class Data> class RedBlackTree;

		/*! \brief A dynamic array implementation. */
		template <class T> class DArray
		{
			private:
				/*! \brief A DStack containing indices of empty nodes in the array. */
				/*!
				 *  Vastly speeds up insertions by keeping track of where empty spaces are.
				 */
				DStack<size_t> *m_emptyNodes;

			protected:
				/*! \brief The size by which to increase the size of the array when there are no more empty nodes. */
				/*!
				 * If set to -1, it will double the size of the array each time the array grows.
				 * \sa setStepSize
				 * \sa setStepDouble
				 */
				int m_stepSize;

				/*! \brief The current size of the array. */
				/*!
				 * \sa setSize
				 */
				size_t m_arraySize;

				/*! \brief The number of used items in the array. */
				size_t m_numUsed;

				/*! \brief The actual array which stores our data. */
				T *m_array;<commit_msg>darray: remove unneeded forward declaration of RedBlackTree<commit_after>/*
 *   CrissCross
 *   A multi-purpose cross-platform library.
 *
 *   A product of Uplink Laboratories.
 *
 *   (c) 2006-2010 <NAME>.
 *   Licensed under the New BSD License.
 *
 */

#ifndef __included_cc_darray_h
#define __included_cc_darray_h

#include <cstring>

#include <crisscross/cc_attr.h>
#include <crisscross/deprecate.h>
#include <crisscross/debug.h>
#include <crisscross/dstack.h>
#include <crisscross/sort.h>

namespace CrissCross
{
	namespace Data
	{
		/*! \brief A dynamic array implementation. */
		template <class T> class DArray
		{
			private:
				/*! \brief A DStack containing indices of empty nodes in the array. */
				/*!
				 *  Vastly speeds up insertions by keeping track of where empty spaces are.
				 */
				DStack<size_t> *m_emptyNodes;

			protected:
				/*! \brief The size by which to increase the size of the array when there are no more empty nodes. */
				/*!
				 * If set to -1, it will double the size of the array each time the array grows.
				 * \sa setStepSize
				 * \sa setStepDouble
				 */
				int m_stepSize;

				/*! \brief The current size of the array. */
				/*!
				 * \sa setSize
				 */
				size_t m_arraySize;

				/*! \brief The number of used items in the array. */
				size_t m_numUsed;

				/*! \brief The actual array which stores our data. */
				T *m_array;
{'fraction_non_alphanumeric': 0.10242683797287652, 'fraction_numerical': 0.006423982869379015, 'mean_word_length': 2.664052287581699, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '743766', 'n_tokens_mistral': 1070, 'n_tokens_neox': 877, 'n_words': 314}