/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2013 Raytrix GmbH. All rights reserved.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once

#include "RxException.h"

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// namespace: Rx
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
namespace Rx
{
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	/// <summary>
	/// 	Exception for signaling file not found errors.
	/// </summary>
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	class RXCORE_API CRxFileNotFoundException : public CRxException
	{
		RX_EXCEPTION_IMPLEMENTATION(CRxFileNotFoundException, "Rx.FileNotFoundException", RX_EXCEPTION_FILE_NOT_FOUND);

		virtual void SetExceptionData() { }
		virtual void SetExceptionData(const CRxString& sxFile);
		CRxString m_sxFile;
	};

	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	/// <summary>
	/// 	Exception for signaling out of memory errors.
	/// </summary>
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	class RXCORE_API CRxOutOfMemoryException : public CRxException
	{
		RX_EXCEPTION_IMPLEMENTATION(CRxOutOfMemoryException, "Rx.OutOfMemoryException", RX_EXCEPTION_OUT_OF_MEMORY);
	};

	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	/// <summary>
	/// 	Exception for signaling operating system errors.
	/// </summary>
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	class RXCORE_API CRxOperatingSystemException : public CRxException
	{
		RX_EXCEPTION_IMPLEMENTATION(CRxOperatingSystemException, "Rx.OperatingSystemException", RX_EXCEPTION_OPERATING_SYSTEM);

		virtual void SetExceptionData();
		uint32_t m_ulError = 0;
		Rx::CRxString m_sxError;
	};

	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	/// <summary>
	/// 	Exception for signaling errno errors.
	/// </summary>
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	class RXCORE_API CRxErrnoException : public CRxException
	{
		RX_EXCEPTION_IMPLEMENTATION(CRxErrnoException, "Rx.ErrnoException", RX_EXCEPTION_ERRNO);

		virtual void SetExceptionData() { };
		virtual void SetExceptionData(int iErrNo);
		int m_iErrNo;
		CRxString m_sxError;
	};

	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	/// <summary>
	/// 	Exception for signaling a missing calibration database.
	/// </summary>
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	class RXCORE_API CRxCalibrationDatabaseMissingException : public CRxException
	{
		RX_EXCEPTION_IMPLEMENTATION(CRxCalibrationDatabaseMissingException, "Rx.CalibrationDatabaseMissingException", RX_EXCEPTION_CALIBRATION_DATABASE_MISSING);
	};
}
