// NDTS2100Sdk.cpp : Defines the exported functions for the DLL application.
//


#include <windows.h>
#include <crtdbg.h>
#include <stdio.h>

#include "NDTSError.h"

#include "PropertiesInterface.h"
#include "PropertiesCollection.h"
#include "GroupPropertyInternal.h"
#include "TCG.h"
#include "NDTS2100Internal.h"

using namespace NDTS::NDTS2100;

FactoryInternal *Factory::pFactoryInternal = 0;

Factory::Factory()
{
}
Factory::~Factory()
{
}

void Factory::deleteAllInstances()
{
	// Call Unint to stop the SDK and free the memory - doesn't seem to work from IW when in a destructor
	delete pFactoryInternal;
	pFactoryInternal = 0;
}

// The Factory class is initially created empty and initialisation is done on the first call
// of getInstance().  This prevents the problems associated with starting the SDK in a DLL_Initialise
Factory *Factory::getInstance()
{
	if (!pFactoryInternal)
		pFactoryInternal = new FactoryInternal();
	return pFactoryInternal;
}


bool Test::runUnitTests()
{
	if (!NDTS::NDTS2100::globalState.isInitialised)
	{
		NDTS2100_HandleNDTS2100Error(NDTS2100_NotInitialised) ;
		return false ;
	}

	return true;
}
