diff --git a/Include/Aurora/Console/Commands/Commands.hpp b/Include/Aurora/Console/Commands/Commands.hpp index 1b4f9953..ebf03c58 100644 --- a/Include/Aurora/Console/Commands/Commands.hpp +++ b/Include/Aurora/Console/Commands/Commands.hpp @@ -14,16 +14,11 @@ namespace Aurora::Async struct WorkerId_t; } +#include "ICommandSubscriber.hpp" +#include "ITextLineSubscriber.hpp" + namespace Aurora::Console::Commands { - AUKN_INTERFACE(ICommandSubscriber, - AUI_METHOD(void, OnCommand, (const Parse::ParsedObject &, parseList)) - ); - - AUKN_INTERFACE(ITextLineSubscriber, - AUI_METHOD(void, OnProcessedLineUTF8, (const AuString &, line)) - ); - AUKN_SYM void AddCommand(const AuString &tag, const Parse::ParseObject &commandStructure, const AuSPtr &subscriber); /** diff --git a/Include/Aurora/Console/Commands/ICommandSubscriber.hpp b/Include/Aurora/Console/Commands/ICommandSubscriber.hpp new file mode 100644 index 00000000..e4af65e9 --- /dev/null +++ b/Include/Aurora/Console/Commands/ICommandSubscriber.hpp @@ -0,0 +1,15 @@ +/*** + Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved. + + File: ICommandSubscriber.hpp + Date: 2021-10-23 + Author: Reece +***/ +#pragma once + +namespace Aurora::Console::Commands +{ + AUKN_INTERFACE(ICommandSubscriber, + AUI_METHOD(void, OnCommand, (const Parse::ParsedObject &, parseList)) + ); +} \ No newline at end of file diff --git a/Include/Aurora/Console/Commands/ITextLineSubscriber.hpp b/Include/Aurora/Console/Commands/ITextLineSubscriber.hpp new file mode 100644 index 00000000..96760f10 --- /dev/null +++ b/Include/Aurora/Console/Commands/ITextLineSubscriber.hpp @@ -0,0 +1,15 @@ +/*** + Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved. + + File: ITextLineSubscriber.hpp + Date: 2021-10-23 + Author: Reece +***/ +#pragma once + +namespace Aurora::Console::Commands +{ + AUKN_INTERFACE(ITextLineSubscriber, + AUI_METHOD(void, OnProcessedLineUTF8, (const AuString &, line)) + ); +} \ No newline at end of file diff --git a/Include/Aurora/Console/Hooks/Hooks.hpp b/Include/Aurora/Console/Hooks/Hooks.hpp index ca99668d..43d60a55 100644 --- a/Include/Aurora/Console/Hooks/Hooks.hpp +++ b/Include/Aurora/Console/Hooks/Hooks.hpp @@ -7,12 +7,10 @@ ***/ #pragma once +#include "IConsoleSubscriber.hpp" + namespace Aurora::Console::Hooks { - AUKN_INTERFACE(IConsoleSubscriber, - AUI_METHOD(void, OnMessage, (const ConsoleMessage &, message)) - ); - AUKN_SYM void AddSubscription(const AuSPtr &subscriber); AUKN_SYM void RemoveSubscription(const AuSPtr &subscriber); diff --git a/Include/Aurora/Console/Hooks/IConsoleSubscriber.hpp b/Include/Aurora/Console/Hooks/IConsoleSubscriber.hpp new file mode 100644 index 00000000..f2e3f8d6 --- /dev/null +++ b/Include/Aurora/Console/Hooks/IConsoleSubscriber.hpp @@ -0,0 +1,15 @@ +/*** + Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved. + + File: IConsoleSubscriber.hpp + Date: 2021-10-23 + Author: Reece +***/ +#pragma once + +namespace Aurora::Console::Hooks +{ + AUKN_INTERFACE(IConsoleSubscriber, + AUI_METHOD(void, OnMessage, (const ConsoleMessage &, message)) + ); +} \ No newline at end of file diff --git a/Include/Aurora/Debug/SysPanic.hpp b/Include/Aurora/Debug/SysPanic.hpp index f800e3d8..0195cbc8 100644 --- a/Include/Aurora/Debug/SysPanic.hpp +++ b/Include/Aurora/Debug/SysPanic.hpp @@ -11,7 +11,7 @@ template static inline void __declspec(noreturn) SysPanic(T... args) { - Aurora::Console::Logging::WriteLinef(Aurora::Console::EAnsiColor::eBoldRed, "Fatal", args...); + Aurora::Console::Logging::WriteLinef(Aurora::Console::EAnsiColor::eBoldRed, "Fatal", std::forward(args)...); Aurora::Debug::Panic(); } #endif \ No newline at end of file diff --git a/Include/Aurora/Hashing/CE/fnv1.hpp b/Include/Aurora/Hashing/CE/fnv1.hpp index ff903710..a5fe450e 100644 --- a/Include/Aurora/Hashing/CE/fnv1.hpp +++ b/Include/Aurora/Hashing/CE/fnv1.hpp @@ -19,15 +19,15 @@ namespace Aurora::Hashing return (str[0] == '\0') ? value : fnv1a(&str[1], (value ^ AuUInt64(str[0])) * kFnv1MagicPrime64); } - inline constexpr uint32_t fnv1a_trunc(const char *const str) noexcept + inline constexpr AuUInt32 fnv1a_trunc(const char *const str) noexcept { - return static_cast(fnv1a(str)); + return static_cast(fnv1a(str)); } constexpr AuUInt32 kFnv1MagicVal32 = 0x811c9dc5; constexpr AuUInt32 kFnv1MagicPrime32 = 0x01000193; - inline constexpr uint32_t fnv1a_32(const char *const str, const AuUInt32 value = kFnv1MagicVal32) noexcept + inline constexpr AuUInt32 fnv1a_32(const char *const str, const AuUInt32 value = kFnv1MagicVal32) noexcept { return (str[0] == '\0') ? value : fnv1a_32(&str[1], (value ^ AuUInt32(str[0])) * kFnv1MagicPrime32); } diff --git a/Include/Aurora/Hashing/CommonDigests.hpp b/Include/Aurora/Hashing/Digests.hpp similarity index 98% rename from Include/Aurora/Hashing/CommonDigests.hpp rename to Include/Aurora/Hashing/Digests.hpp index 5511fc3d..5b0463bf 100644 --- a/Include/Aurora/Hashing/CommonDigests.hpp +++ b/Include/Aurora/Hashing/Digests.hpp @@ -1,7 +1,7 @@ /*** Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved. - File: CommonDigests.hpp + File: Digests.hpp Date: 2021-6-10 Author: Reece ***/ diff --git a/Include/Aurora/Hashing/Hashing.hpp b/Include/Aurora/Hashing/Hashing.hpp index 0fbdefda..14f3b299 100644 --- a/Include/Aurora/Hashing/Hashing.hpp +++ b/Include/Aurora/Hashing/Hashing.hpp @@ -9,6 +9,6 @@ #include "EHashType.hpp" #include "HashStream.hpp" -#include "CommonDigests.hpp" +#include "Digests.hpp" #include "CE/fnv1.hpp" \ No newline at end of file diff --git a/Include/Aurora/IO/FS/FS.hpp b/Include/Aurora/IO/FS/FS.hpp index 3777a8db..8669277c 100644 --- a/Include/Aurora/IO/FS/FS.hpp +++ b/Include/Aurora/IO/FS/FS.hpp @@ -39,6 +39,7 @@ namespace Aurora::IO::FS AUKN_SYM bool Copy(const AuString &src, const AuString &dest); } +#include "IFileStream.hpp" #include "FileStream.hpp" #include "FileArbitraryReader.hpp" #include "FileReader.hpp" diff --git a/Include/Aurora/IO/FS/FileStream.hpp b/Include/Aurora/IO/FS/FileStream.hpp index ea5c64f8..489e38d3 100644 --- a/Include/Aurora/IO/FS/FileStream.hpp +++ b/Include/Aurora/IO/FS/FileStream.hpp @@ -9,18 +9,6 @@ namespace Aurora::IO::FS { - class IFileStream - { - public: - virtual AuUInt64 GetOffset() = 0; - virtual bool SetOffset(AuUInt64 offset) = 0; - virtual AuUInt64 GetLength() = 0; - virtual bool Read(const Memory::MemoryViewStreamWrite ¶meters) = 0; - virtual bool Write(const Memory::MemoryViewStreamRead ¶meters) = 0; - virtual void Close() = 0; - virtual void Flush() = 0; - }; - AUKN_SHARED_API(OpenRead, IFileStream, const AuString &path); AUKN_SHARED_API(OpenWrite, IFileStream, const AuString &path); } \ No newline at end of file diff --git a/Include/Aurora/IO/FS/IFileStream.hpp b/Include/Aurora/IO/FS/IFileStream.hpp new file mode 100644 index 00000000..22d042ab --- /dev/null +++ b/Include/Aurora/IO/FS/IFileStream.hpp @@ -0,0 +1,16 @@ +#pragma once + +namespace Aurora::IO::FS +{ + class IFileStream + { + public: + virtual AuUInt64 GetOffset() = 0; + virtual bool SetOffset(AuUInt64 offset) = 0; + virtual AuUInt64 GetLength() = 0; + virtual bool Read(const Memory::MemoryViewStreamWrite ¶meters) = 0; + virtual bool Write(const Memory::MemoryViewStreamRead ¶meters) = 0; + virtual void Close() = 0; + virtual void Flush() = 0; + }; +} \ No newline at end of file diff --git a/readme.md b/readme.md index 8fc82c3d..11c69f3a 100644 --- a/readme.md +++ b/readme.md @@ -100,7 +100,7 @@ Bonus point UNIX (4):
No wait multiple mechanism -1, 2, 4: Use the high performance AuThreadPrimitives objects
+1, 2, 3: Use the high performance AuThreadPrimitives objects
4: Consider using loop sources, perhaps with the async subsystem, in your async application.
Performance of loop sources will vary wildly between platforms, always being generally worse than
the high performance primitives. They should be used to observe kernel-level signalable resources.