AuroraRuntime/Include/auROXTL/auTemplateMeta.hpp
Reece cf70f0d45c [*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.

[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
        ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
        Catch,
        Submission,
        LockError,
        NoAccess,
        ResourceMissing,
        ResourceLocked,
        MalformedData,
        InSandboxContext,
        ParseError

[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
        Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
    Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors

et al
2022-02-17 00:11:40 +00:00

215 lines
4.2 KiB
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: auTemplateMeta.hpp
Date: 2022-2-1
Author: Reece
***/
#pragma once
template<bool v>
struct AuBoolType
{
static constexpr bool value = v;
using value_type = bool;
using type = AuBoolType;
constexpr operator value_type() const noexcept
{
return value;
}
constexpr value_type operator()() const noexcept
{
return value;
}
};
using AuFalseType = AuBoolType<false>;
using AuTrueType = AuBoolType<true>;
template<class T>
using AuToValueType_t = typename T::value_type;
template<class T>
using AuToElementType_t = typename T::yelement_type;
template<class T, class U>
struct AuIsSame : AuFalseType
{};
template<class T>
struct AuIsSame<T, T> : AuTrueType
{};
template<class T, class U>
inline constexpr bool AuIsSame_v = AuIsSame<T, U>::value;
namespace _audetail
{
template<class T>
AuBoolType<!std::is_union<T>::value> IsClass(int T:: *);
template<class>
AuFalseType IsClass(...);
template<typename B>
AuTrueType TestIsPtrConvertible(const volatile B *);
template<typename>
AuFalseType TestIsPtrConvertible(const volatile void *);
template<typename, typename>
auto TestIsBaseOf(...)->AuTrueType;
template<typename B, typename D>
auto TestIsBaseOf(int) -> decltype(TestIsPtrConvertible<B>(static_cast<D *>(nullptr)));
}
template<class T>
struct AuIsClass : decltype(_audetail::IsClass<T>(nullptr))
{};
template<class T>
inline constexpr bool AuIsClass_v = AuIsClass<T>::value;
template<typename Base, typename Derived>
struct AuIsBaseOf :
AuBoolType<
AuIsClass_v<Base> &&
AuIsClass_v<Derived> &&
decltype(_audetail::TestIsBaseOf<Base, Derived>(0))::value
>
{};
template<typename Base, typename Derived>
inline constexpr bool AuIsBaseOf_v = AuIsBaseOf<Base, Derived>::value;
template<class>
inline constexpr bool AuIsPointer_v = false;
template<class T>
inline constexpr bool AuIsPointer_v<T *> = true;
template<class T>
inline constexpr bool AuIsPointer_v<T *const> = true;
template<class T>
inline constexpr bool AuIsPointer_v<T *volatile> = true;
template<class T>
inline constexpr bool AuIsPointer_v<T *const volatile> = true;
template<class T>
struct AuRemovePointer
{
typedef T type;
};
template<class T>
struct AuRemovePointer<T *>
{
typedef T type;
};
template<class T>
struct AuRemovePointer<T *const>
{
typedef T type;
};
template<class T>
struct AuRemovePointer<T *volatile>
{
typedef T type;
};
template<class T>
struct AuRemovePointer<T *const volatile>
{
typedef T type;
};
template<class T>
using AuRemovePointer_t = typename AuRemovePointer<T>::type;
template<class T>
using AuIsVoid = AuIsSame<void, T>;
template<class T>
inline constexpr bool AuIsVoid_v = AuIsVoid<T>::value;
template<class T>
struct AuRemoveReference
{
using type = T;
};
template<class T>
struct AuRemoveReference<T &>
{
using type = T;
};
template<class T>
struct AuRemoveReference<T &&>
{
using type = T;
};
template<class T>
using AuRemoveReference_t = typename AuRemoveReference<T>::type;
template<class T>
struct AuRemoveConst
{
typedef T type;
};
template<class T>
struct AuRemoveConst<const T>
{
typedef T type;
};
template<class T>
using AuRemoveConst_t = typename AuRemoveConst<T>::type;
template<bool Test, class T = void>
struct AuEnableIf
{};
template<class T>
struct AuEnableIf<true, T>
{
using type = T;
};
template<bool Test, class T = void>
using AuEnableIf_t = typename AuEnableIf<Test, T>::type;
template<bool Test, class T, class T2>
struct AuConditional
{
using type = T;
};
template<class T, class T2>
struct AuConditional<false, T, T2>
{
using type = T2;
};
template<bool Test, class T, class T2>
using AuConditional_t = typename AuConditional<Test, T, T2>::type;
template<template<typename...> class base, typename derived>
struct is_base_of_template_impl_au
{
template<typename... Ts>
static constexpr AuTrueType test(const base<Ts...> *);
static constexpr AuFalseType test(...);
using type = decltype(test(std::declval<derived *>()));
};
template<template <typename...> class base, typename derived>
using AuIsBaseOfTemplate = typename is_base_of_template_impl_au<base, derived>::type;