71 lines
1.7 KiB
C++
71 lines
1.7 KiB
C++
|
/***
|
||
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
||
|
|
||
|
File: AuroraTypedefs.hpp
|
||
|
Date: 2021-6-10
|
||
|
Author: Reece
|
||
|
***/
|
||
|
#pragma once
|
||
|
|
||
|
#include <vector>
|
||
|
#include <utility>
|
||
|
#include <map>
|
||
|
#include <string>
|
||
|
#include <array>
|
||
|
#include <algorithm>
|
||
|
#include <unordered_map>
|
||
|
#include <memory>
|
||
|
|
||
|
namespace Aurora::Memory
|
||
|
{
|
||
|
template <class T>
|
||
|
struct SpeedyArrayAllocator;
|
||
|
}
|
||
|
|
||
|
|
||
|
template<typename T>
|
||
|
using AuList = typename std::conditional<std::is_class<T>::value, std::vector<T>, std::vector<T, Aurora::Memory::SpeedyArrayAllocator<T>>>::type;
|
||
|
|
||
|
template<class T, class Z>
|
||
|
using AuHashMap = std::unordered_map<T, Z>;
|
||
|
|
||
|
template<class T, class Z, class Utility>
|
||
|
using AuHashMapEx = std::unordered_map<T, Z, Utility, Utility>;
|
||
|
|
||
|
template<class T, class Z>
|
||
|
using AuBST = std::map<T, Z>;
|
||
|
|
||
|
template<class T, class Z, class Utility>
|
||
|
using AuBSTEx = std::map<T, Z, Utility>;
|
||
|
|
||
|
template<class T>
|
||
|
using AuSPtr = std::shared_ptr<T>;
|
||
|
|
||
|
template<class T>
|
||
|
using AuWPtr = std::weak_ptr<T>;
|
||
|
|
||
|
#if defined(AURORA_COMPILER_MSVC)
|
||
|
using AuAtomicInt = long;
|
||
|
#else
|
||
|
using AuAtomicInt = int;
|
||
|
#endif
|
||
|
|
||
|
//#include "tinyutf8.h"
|
||
|
|
||
|
using AuString = std::string;// tiny_utf8::utf8_string;
|
||
|
|
||
|
using AuUInt64 = Aurora::Types::uint64_t;
|
||
|
using AuUInt32 = Aurora::Types::uint32_t;
|
||
|
using AuUInt16 = Aurora::Types::uint16_t;
|
||
|
using AuUInt8 = Aurora::Types::uint8_t;
|
||
|
using AuInt64 = Aurora::Types::int64_t;
|
||
|
using AuInt32 = Aurora::Types::int32_t;
|
||
|
using AuInt16 = Aurora::Types::int16_t;
|
||
|
using AuInt8 = Aurora::Types::int8_t;
|
||
|
using AuMach = Aurora::Types::size_t;
|
||
|
using AuSMach = Aurora::Types::ssize_t;
|
||
|
using AuSInt = AuSMach;
|
||
|
using AuUInt = AuMach;
|
||
|
|
||
|
using AuThreadId_t = AuUInt64;
|
||
|
static const AuThreadId_t kThreadIdSpecialMask = AuThreadId_t(1) << AuThreadId_t(63);
|