EHS/include/ehs/BaseObj.h

74 lines
1.8 KiB
C
Raw Permalink Normal View History

2024-02-05 22:25:30 -08:00
#pragma once
#include "Types.h"
#include "Type.h"
namespace ehs
{
2024-07-24 01:36:20 -07:00
class EHS_LIB_IO BaseObj
2024-02-05 22:25:30 -08:00
{
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);
};
}