#pragma once

#include "Types.h"
#include "Type.h"

namespace ehs
{
    class EHS_LIB_IO BaseObj
    {
    private:
		Type* hierarchy;
		UInt_64 hierarchySize;

    public:
		virtual ~BaseObj();

        BaseObj();

		BaseObj(BaseObj&& base) noexcept;

        BaseObj(const BaseObj& base);

		BaseObj& operator=(BaseObj&& base) noexcept;

        BaseObj& operator=(const BaseObj& base);

        bool operator==(const BaseObj& base) const;

        bool operator!=(const BaseObj& base) const;

		/// Retrieves the class hierarchy.
		/// @returns The hierarchy array.
		const Type* GetHierarchy() const;

		/// Retrieves the class hierarchy size.
		/// @returns The hierarchy size.
		UInt_64 GetHierarchySize() const;

		/// Checks if this class derives from another.
		/// @param [in] typeHashId The type hash id to look for.
		/// @returns True if found.
		bool HasType(UInt_64 typeHashId) const;

		/// Checks if this class derives from another.
		/// @param [in] typeId The type id to look for.
		/// @returns True if found.
		bool HasType(const Char_8* typeId) const;

		/// Retrieves the top class' information.
		/// @returns The Type object containing the class information.
        Type GetType() const;

		/// Retrieves the top class' string name, size.
		/// @returns The name size.
		UInt_64 GetTypeIdSize() const;

		/// Retrieves the top class' string name.
		/// @returns The name.
        const Char_8* GetTypeId() const;

		/// Retrieves the top class' hashed name.
		/// @returns The hashed name.
		UInt_64 GetTypeHashId() const;

		/// Clones the object onto the heap.
		/// @returns The cloned object.
        virtual BaseObj* Clone() const;

	protected:
		/// Adds the class name to the class hierarchy.
		/// @param [in] id The name of the class to add.
		void AddType(const Char_8* id);
    };
}