/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2015 Raytrix GmbH. All rights reserved.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once

#include "Rx.Interop.Runtime30/Guid.h"

#ifndef RX_STATIC
    #ifdef RXINTEROP31_EXPORTS
		#define RXINTEROP31_API __declspec(dllexport)
    #else
		#define RXINTEROP31_API __declspec(dllimport)
    #endif
#else
	#define RXINTEROP31_API
#endif

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// namespace: Rx.Interop.Runtime31
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
namespace Rx
{
	namespace Interop
	{
		namespace Runtime31
		{
			/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			/// <summary>
			/// 	Interface class of all exceptions used since RxRuntime 3.1.
			/// </summary>
			/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			class RXINTEROP31_API IException
			{
			public:

				/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				/// <summary>
				/// 	Gets message text.
				/// </summary>
				///
				/// <returns> The message text. </returns>
				/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				virtual const char* GetMessageText() const = 0;

				/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				/// <summary>
				/// 	Gets the function name.
				/// </summary>
				///
				/// <returns>	The function name. </returns>
				/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				virtual const char* GetFunction() const = 0;

				/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				/// <summary>
				/// 	Gets the file name.
				/// </summary>
				///
				/// <returns>	The file name. </returns>
				/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				virtual const char* GetFile() const = 0;

				/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				/// <summary>
				/// 	Gets the line.
				/// </summary>
				///
				/// <returns>	The line number. </returns>
				/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				virtual int GetLine() const = 0;

				/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				/// <summary>
				/// 	Gets the name of this exception.
				/// </summary>
				///
				/// <returns>	The name of this exception. </returns>
				/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				virtual const char* GetName() const = 0;

				/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				/// <summary>
				/// 	Gets the unique identifier of this exception. This is not guaranteed to be the GUID of this exception type.
				/// </summary>
				///
				/// <returns>	The unique identifier. </returns>
				/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				virtual const CGuid30& GetGUID() const = 0;

				/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				/// <summary>
				/// 	Gets the inner exception if one is available. Otherwise null is returned.
				/// </summary>
				///
				/// <returns> The inner exception. </returns>
				/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				virtual const IException* GetInnerException() const = 0;

				/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				/// <summary>
				/// 	Query if this exception or one of its inner exceptions contains an exception of the given GUID.
				/// </summary>
				///
				/// <param name="xGUID"> [in] The GUID of the exception to look for. </param>
				///
				/// <returns>
				/// 	True if this exception or one of its inner exceptions contains an exception of the given GUID, false if not.
				/// </returns>
				/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				virtual bool HasException(const CGuid30& xGUID) const = 0;

				/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				/// <summary>
				/// 	Makes a deep copy of this object.
				/// </summary>
				///
				/// <returns> Null if it fails, else a copy of this object. </returns>
				/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				virtual IException* Clone() const = 0;
			};
		}
	}

	/// <summary> Defines an alias representing the exception interface of RxRuntime 3.1. </summary>
	typedef Interop::Runtime31::IException IException31;
}

#pragma make_public(Rx::Interop::Runtime31::IException)
