diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-26 13:44:38 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-26 13:47:32 +0100 |
| commit | 66e4f909bd1a495d3f1c34d2e1b5cd71099ab1ae (patch) | |
| tree | d64cc867d352d190dfd5693262a42b31e28b9239 /Public/Developer/System.Core/Headers/Defines.hxx | |
| parent | dbe4573f61ae059c9dafb8e7623370121d443451 (diff) | |
Kernel and System.Core: kernel related fixes and :boom: on User API.
- UserHeap.cxx: Document code and fix issue in ke_free_heap_internal.
- Scheduler: Rename ProcessManager to ProcessScheduler.
- The System API has been reworked to improve it's design, such as no
more C++ to improve it's portability.
- Moved containers into it's own API.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Public/Developer/System.Core/Headers/Defines.hxx')
| -rw-r--r-- | Public/Developer/System.Core/Headers/Defines.hxx | 84 |
1 files changed, 9 insertions, 75 deletions
diff --git a/Public/Developer/System.Core/Headers/Defines.hxx b/Public/Developer/System.Core/Headers/Defines.hxx index 867dac76..9d6d84ee 100644 --- a/Public/Developer/System.Core/Headers/Defines.hxx +++ b/Public/Developer/System.Core/Headers/Defines.hxx @@ -136,77 +136,6 @@ enum HcProcessCall { #include <System.Core/Headers/Hint.hxx> -class SystemException { - public: - explicit SystemException() = default; - virtual ~SystemException() = default; - - public: - CA_COPY_DEFAULT(SystemException); - - public: - virtual const char *Name() = 0; - virtual const char *Reason() = 0; - -}; - -/// @brief Object exception -/// Throws when the object isn't found. -class ObjectNotFoundException : public SystemException { - public: - explicit ObjectNotFoundException() = default; - virtual ~ObjectNotFoundException() = default; - - public: - CA_COPY_DEFAULT(ObjectNotFoundException); - - public: - const char *Name() override { return "ObjectNotFoundException"; } - const char *Reason() override { return mReason; } - - private: - const char *mReason{ - "System.Core: ObjectNotFoundException: Catastrophic failure!"}; -}; - -/// @brief pointer exception -/// Throws when the object isn't found. -class PointerException : public SystemException { - public: - explicit PointerException() = default; - virtual ~PointerException() = default; - - public: - CA_COPY_DEFAULT(PointerException); - - public: - const char *Name() override { return "PointerException"; } - const char *Reason() override { return mReason; } - - private: - const char *mReason{ - "System.Core: PointerException: Catastrophic failure!"}; -}; - -/// @brief pointer exception -/// Throws when the object isn't found. -class NullPointerException : public SystemException { - public: - explicit NullPointerException() = default; - virtual ~NullPointerException() = default; - - public: - CA_COPY_DEFAULT(NullPointerException); - - public: - const char *Name() override { return "NullPointerException"; } - const char *Reason() override { return mReason; } - - private: - const char *mReason{ - "System.Core: NullPointerException: Catastrophic failure!"}; -}; - #define kObjectGlobalNamespaceSystem "HCORE_ROOT\\" #define kObjectGlobalNamespaceUser "HCORE_USER_ROOT\\" @@ -241,10 +170,15 @@ typedef struct Object final { VoidType(*Release)(struct Object* Self); IntPtrType(*Invoke)(struct Object* Self, DWordType Sel, ...); VoidType(*Query)(struct Object* Self, PtrVoidType* Dst, SizeType SzDst, struct GUID* GuidOf); -} Object, *ObjectPtr; +} *ObjectRef; + +#define object_cast reinterpret_cast<ObjectRef> + +CA_EXTERN_C ObjectRef HcGetAppObject(VoidType); -#define object_cast reinterpret_cast<ObjectPtr> +CA_INLINE ObjectRef kApplicationObject; -CA_EXTERN_C ObjectPtr HcGetInstanceObject(void); +typedef CharacterTypeUTF8 Str255Type[255]; -CA_INLINE ObjectPtr kApplicationObject; +template <SizeType N> +using StrType = CharacterTypeUTF8[N]; |
