Games Task Scheduler (GTS)
A multi-processor scheduling framework for games engines
|
Classes | |
struct | gts::numericLimits< T > |
The root template for numeric limits. More... | |
struct | gts::numericLimits< uint32_t > |
The numeric limits for uint32_t. More... | |
struct | gts::numericLimits< uint64_t > |
The numeric limits for uint64_t. More... | |
struct | gts::numericLimits< int32_t > |
The numeric limits for int32_t. More... | |
struct | gts::numericLimits< int64_t > |
The numeric limits for int64_t. More... | |
struct | gts::IsPow2< T, val > |
A power of 2 type trait. More... | |
class | gts::OwnedId |
An ID for owned objects. It indicates the owner's ID, an ID local to the owner, and an overall unique ID. More... | |
struct | gts::MurmurHash< TKey > |
The base murmur hash functor. More... | |
struct | gts::MurmurHash< float > |
The float specialized murmur hash functor. More... | |
struct | gts::MurmurHash< double > |
The double specialized murmur hash functor. More... | |
struct | gts::MurmurHash< char * > |
The c-string specialized murmur hash functor. More... | |
struct | gts::MurmurHash< TKey * > |
The pointer specialized murmur hash functor. More... | |
Typedefs | |
using | gts::IdType = uint32_t |
The type used to identify an object. | |
using | gts::SubIdType = uint16_t |
The sub type stored in IdType. | |
Functions | |
template<typename T > | |
constexpr T | gts::gtsMax (T const &lhs, T const &rhs) |
Calculates the max of lhs and rhs. More... | |
template<typename T > | |
constexpr T | gts::gtsMin (T const &lhs, T const &rhs) |
Calculates the min of lhs and rhs. More... | |
template<typename T > | |
constexpr bool | gts::isPow2 (T value) |
Checks if value is a power of 2. More... | |
constexpr GTS_INLINE uint16_t | gts::nextPow2 (uint16_t value) |
Calculates the next 16-bit power of 2 if value is not a power of 2. More... | |
constexpr GTS_INLINE uint32_t | gts::nextPow2 (uint32_t value) |
Calculates the next 32-bit power of 2 if value is not a power of 2. More... | |
constexpr GTS_INLINE uint64_t | gts::nextPow2 (uint64_t value) |
Calculates the next 64-bit power of 2 if value is not a power of 2. More... | |
template<typename TInt > | |
GTS_INLINE TInt | gts::log2i (TInt const &integral) |
Calculates log2 a integer. More... | |
template<> | |
GTS_INLINE int64_t | gts::log2i (int64_t const &integral) |
Specialization to calculate the log2 a signed 64-bit integer. More... | |
template<> | |
GTS_INLINE uint64_t | gts::log2i (uint64_t const &integral) |
Specialization to calculate the log2 a unsigned 64-bit integer. More... | |
GTS_INLINE uint32_t | gts::fastRand (uint32_t &state) |
Generates a pseudo random number using xor shift algorithm on 'state'. More... | |
GTS_INLINE bool | gts::isAligned (void *ptr, size_t alignmentPow2) |
Checks if ptr is aligned to the boundary alignmentPow2. More... | |
GTS_INLINE uintptr_t | gts::alignDownTo (uintptr_t ptr, size_t alignment) |
Aligns ptr down to the next alignment boundary. More... | |
GTS_INLINE uintptr_t | gts::alignUpTo (uintptr_t ptr, size_t alignment) |
Aligns ptr up to the next alignment boundary. More... | |
GTS_INLINE uint32_t | gts::murmur_hash3 (uint32_t key) |
GTS_INLINE uint64_t | gts::murmur_hash3 (uint64_t key) |
GTS_INLINE uint32_t | gts::murmur_hash3 (const void *key, uint32_t len, uint32_t seed=12345) |
template<typename TResult , typename TFunc , typename... TArgs> | |
GTS_INLINE TResult | gts::invoke (TFunc &&func, TArgs &&... args) |
A simple function invoker. | |
template<typename Value , typename TCompareFunc > | |
GTS_INLINE void | gts::insertionSort (Value *values, size_t numValues, TCompareFunc fcnComp) |
Simple insertion sort implementation. | |
Variables | |
constexpr IdType | gts::UNKNOWN_UID = UINT32_MAX |
The value of an unknown IdType. | |
constexpr SubIdType | gts::UNKNOWN_SUBID = UINT16_MAX |
The value of an unknown SubIdType. | |
A set of utility functions.
GTS_INLINE uintptr_t gts::alignDownTo | ( | uintptr_t | ptr, |
size_t | alignment | ||
) |
Aligns ptr down to the next alignment boundary.
GTS_INLINE uintptr_t gts::alignUpTo | ( | uintptr_t | ptr, |
size_t | alignment | ||
) |
Aligns ptr up to the next alignment boundary.
GTS_INLINE uint32_t gts::fastRand | ( | uint32_t & | state | ) |
Generates a pseudo random number using xor shift algorithm on 'state'.
|
constexpr |
Calculates the max of lhs and rhs.
|
constexpr |
Calculates the min of lhs and rhs.
GTS_INLINE bool gts::isAligned | ( | void * | ptr, |
size_t | alignmentPow2 | ||
) |
Checks if ptr is aligned to the boundary alignmentPow2.
|
constexpr |
Checks if value is a power of 2.
GTS_INLINE int64_t gts::log2i | ( | int64_t const & | integral | ) |
Specialization to calculate the log2 a signed 64-bit integer.
GTS_INLINE TInt gts::log2i | ( | TInt const & | integral | ) |
Calculates log2 a integer.
GTS_INLINE uint64_t gts::log2i | ( | uint64_t const & | integral | ) |
Specialization to calculate the log2 a unsigned 64-bit integer.
GTS_INLINE uint32_t gts::murmur_hash3 | ( | const void * | key, |
uint32_t | len, | ||
uint32_t | seed = 12345 |
||
) |
GTS_INLINE uint32_t gts::murmur_hash3 | ( | uint32_t | key | ) |
GTS_INLINE uint64_t gts::murmur_hash3 | ( | uint64_t | key | ) |
|
constexpr |
Calculates the next 16-bit power of 2 if value is not a power of 2.
|
constexpr |
Calculates the next 32-bit power of 2 if value is not a power of 2.
|
constexpr |
Calculates the next 64-bit power of 2 if value is not a power of 2.