/****************************************************************************************


		MCArrayTypes.h


		Copyright: (c) 2001 Eovia Corp. All rights reserved.

		Author:	Ian
		Date:	6/3/99

		Revision History

		when		who			what & why
		==========	==========	======================================================
		10/18/99	Nba			changed default grow size to be 1 instead of 32

*****************************************************************************************/

#if CP_PRAGMA_ONCE
#pragma once
#endif

#ifndef __MCArrayTypes__
#define __MCArrayTypes__

#define	kBeginIndex		0
#define	kEndIndex		0xFFFFFFFD
#define	kUnusedIndex	0xFFFFFFFF

enum MCArrayFlags
{
	eFirstAttributeBit	= 27,	//Decrement this if you need to add another attribute bit.
	eDefaultGrowSize	= 1,
	eGrowMask			=  ((1 << eFirstAttributeBit)-1),	//Bits 0 - eFirstAttributeBit contain the grow size OR the maximum grow if eSmartGrow is set
	eNotGrowMask		= ~((1 << eFirstAttributeBit)-1),	//Bits eFirstAttributeBit - 31 are the attributes bits.
	eExternalMem		=	(1 << eFirstAttributeBit),
	eZeroMem			=   (1 << (eFirstAttributeBit + 1)),
	eValid				=   (1 << (eFirstAttributeBit + 2)),
	eArrayAlias			=   (1 << (eFirstAttributeBit + 3)),
	eSmartGrow			=   (1 << (eFirstAttributeBit + 4))
};

enum MCArrayConstants
{
	kStructureCopyThreshold = 9,	//Anything below the size in bytes will be coppied
									//with = otherwise we use MCmemcpy().	
	kMaxMemoryForGrow = 0x20000		//Maximum memory to add to the array when it grows (in eSmartGrow mode)
};

#define kSmartGrowPercentage 0.20f

#endif