AuROXTL/Include/auROXTLUtils.hpp
2023-03-22 23:07:03 +00:00

84 lines
2.0 KiB
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: AuroraUtils.hpp
File: auROXTLUtils.hpp
Date: 2021-6-9
Author: Reece
***/
#pragma once
#if defined(__has_include)
#if __has_include(<intrin.h>) && defined(AURORA_PLATFORM_WIN32)
#include <intrin.h>
#endif
#if __has_include(<emmintrin.h>)
#include <emmintrin.h>
#endif
#if __has_include(<xmmintrin.h>)
#include <xmmintrin.h>
#endif
#if __has_include(<immintrin.h>)
#include <immintrin.h>
#endif
#endif
#if defined(AURORA_ARCH_X64)
#include <nmmintrin.h>
#endif
#include <auROXTL/auMemoryUtils.hpp>
#include <auROXTL/auCopyMoveUtils.hpp>
#include <auROXTL/auSwapExchangeUtils.hpp>
#include <auROXTL/auContainerUtils.hpp>
#include <auROXTL/auListUtils.hpp>
#include <auROXTL/auStringUtils.hpp>
#include <auROXTL/auTupleUtils.hpp>
#include <auROXTL/auNumberUtils.hpp>
#include <auROXTL/auEndianness.hpp>
#include <auROXTL/auAtomic.hpp>
#include <auROXTL/auBitsUtils.hpp>
#include <auROXTL/auMagicUtils.hpp>
#include <auROXTL/auWin32Utils.hpp>
#include <auROXTL/auCastUtils.hpp>
#include <auROXTL/auTypeUtils.hpp>
#include <auROXTL/auNumericLimits.hpp>
#include <auROXTL/auUnitUtils.hpp>
#include <auROXTL/auFNV1Utils.hpp>
#include <auROXTL/auHashUtils.hpp>
#include <auROXTL/auTryConstructUtils.hpp>
#include <auROXTL/auTryCallUtils.hpp>
#include <auROXTL/Objects/SafeDestroy.hpp>
#include <auROXTL/Objects/ResetMember.hpp>
#include <auROXTL/auBuildTime.hpp>
#include <auROXTL/Objects/SOO.hpp>
struct IAuNullDelegate
{
virtual void OnCall() = 0;
};
struct AuNullCallback
{
const AuVoidFunc voidFunc;
const AuSPtr<IAuNullDelegate> callbackFunc;
AU_DEFINE_CTOR_ONE(AuNullCallback, (AuVoidFunc, voidFunc));
AU_DEFINE_CTOR_ONE(AuNullCallback, (AuSPtr<IAuNullDelegate>, callbackFunc));
inline void operator()()
{
if (voidFunc)
{
voidFunc();
}
else if (callbackFunc)
{
callbackFunc->OnCall();
}
}
};