#include <crtdbg.h>
#include "EnumPropertyInternal.h"

namespace NDTS
{
	namespace SCO
	{
		EnumPropertyInternal::EnumPropertyInternal(char *pShortName, char *pLongName, int flags, char **ppEnumNames, int numberOfEnums, int primaryIndex, NDTS_Boolean (*pSetFunction)(unsigned long, unsigned long)) : 
	IntPropertyInternal(pShortName, pLongName, flags, 0,  0,numberOfEnums - 1, primaryIndex, pSetFunction)
	{
		this->ppEnumNames = ppEnumNames;
		this->numberOfEnums = numberOfEnums;
	}

	EnumPropertyInternal::EnumPropertyInternal(char *pShortName, char *pLongName, int flags, char **ppEnumNames, int numberOfEnums, HardwareAccessClass *pHardwareAccessObject) : 
	IntPropertyInternal(pShortName, pLongName, flags, 0,  0,numberOfEnums - 1, pHardwareAccessObject)
	{
		this->ppEnumNames = ppEnumNames;
		this->numberOfEnums = numberOfEnums;
	}


	EnumPropertyInternal::EnumPropertyInternal(char *pShortName, char *pLongName, int flags, char **ppEnumNames, int numberOfEnums, int *enumToValueMap, HardwareAccessClass *pHardwareAccessObject) : 
	IntPropertyInternal(pShortName, pLongName, flags, 0,  0,numberOfEnums - 1, enumToValueMap, numberOfEnums, pHardwareAccessObject)
	{
		this->ppEnumNames = ppEnumNames;
		this->numberOfEnums = numberOfEnums;
	}

	EnumPropertyInternal::~EnumPropertyInternal(void)
	{
	}
	const char* EnumPropertyInternal::getEnumStringByIndex(int index)
	{
		_ASSERTE(index >= 0 && index < numberOfEnums);
		return ppEnumNames[index];
	}
	int EnumPropertyInternal::getNumberOfEnumStrings()
	{
		return numberOfEnums;
	}

}};
