Helios Engine
A modular ECS based data-oriented C++23 game engine framework
Loading...
Searching...
No Matches
helios::utils Namespace Reference

Namespaces

namespace  details

Classes

class  ChainAdapter
 Iterator adapter that chains two sequences together. More...
class  Defer
 A utility class that defers the execution of a callable until the object goes out of scope. More...
class  DynamicLibrary
 Cross-platform dynamic library loader. More...
class  EnumerateAdapter
 Iterator adapter that adds index information to each element. More...
class  FastPimpl
 Implements pimpl idiom without dynamic memory allocation. More...
class  FilterAdapter
 Iterator adapter that filters elements based on a predicate function. More...
class  FunctionalAdapterBase
 CRTP base class providing common adapter operations. More...
class  InspectAdapter
 Iterator adapter that applies a function to each element for observation. More...
class  JoinAdapter
class  MapAdapter
 Iterator adapter that transforms each element using a function. More...
class  RandomGenerator
 Random number utilities with a user-provided engine. More...
class  ReverseAdapter
 Adapter that iterates through elements in reverse order. More...
class  SkipAdapter
 Iterator adapter that skips the first N elements. More...
class  SkipWhileAdapter
 Iterator adapter that skips elements while a predicate returns true. More...
class  SlideAdapter
 Adapter that yields sliding windows of elements. More...
class  SlideView
 Adapter that flattens nested ranges into a single sequence. More...
class  StepByAdapter
 Iterator adapter that steps through elements by a specified stride. More...
class  StrideAdapter
 Adapter that yields every Nth element from the range. More...
struct  StringEqual
 Transparent equality comparator for string types. More...
struct  StringHash
 Transparent hash functor for string types. More...
class  TakeAdapter
 Iterator adapter that yields only the first N elements. More...
class  TakeWhileAdapter
 Iterator adapter that takes elements while a predicate returns true. More...
class  Timer
 High–resolution timer with configurable clock and rich elapsed API. More...
class  TypeId
class  TypeIndex
class  ZipAdapter
 Adapter that combines two ranges into pairs. More...

Concepts

concept  ActionFor
 Concept for action functions that process values.
concept  AdapterTrait
 Concept for types that are adapter traits (derived from FunctionalAdapterBase).
concept  ArithmeticTrait
 Concept for arithmetic types (integral or floating-point).
concept  BidirectionalIteratorLike
 Concept for bidirectional iterators that support decrement operations.
concept  ChainAdapterRequirements
 Concept to validate ChainAdapter requirements.
concept  Distribution
 Concept for standard-like distributions.
concept  EnumerateAdapterRequirements
 Concept to validate EnumerateAdapter requirements.
concept  ExternalRange
 Concept for types that are external ranges (not adapters).
concept  FilterAdapterRequirements
 Concept to validate FilterAdapter requirements.
concept  FolderFor
 Concept for folder functions that accumulate values.
concept  FunctorTrait
 Concept for regular functor types (named structs/classes that are not lambda closures).
concept  InspectAdapterRequirements
 Concept to validate InspectAdapter requirements.
concept  InspectorFor
 Concept for inspection functions that observe but don't modify values.
concept  IteratorLike
 Concept for types that can be used as base iterators in adapters.
concept  JoinAdapterRequirements
 Concept to validate JoinAdapter requirements.
concept  LambdaTrait
 Concept for lambda closure types.
concept  MapAdapterRequirements
 Concept to validate MapAdapter requirements.
concept  PolymorphicConvertible
 Concept to allow argument conversion with polymorphic relationships.
concept  PredicateFor
 Concept for predicate functions that can be applied to iterator values.
concept  RandomEngine
 Concept for random number engines compatible with std distributions.
concept  ReverseAdapterRequirements
 Concept to validate ReverseAdapter requirements.
concept  SkipAdapterRequirements
 Concept to validate SkipAdapter requirements.
concept  SkipWhileAdapterRequirements
 Concept to validate SkipWhileAdapter requirements.
concept  SlideAdapterRequirements
 Concept to validate SlideAdapter requirements.
concept  StepByAdapterRequirements
 Concept to validate StepByAdapter requirements.
concept  StrideAdapterRequirements
 Concept to validate StrideAdapter requirements.
concept  TakeAdapterRequirements
 Concept to validate TakeAdapter requirements.
concept  TakeWhileAdapterRequirements
 Concept to validate TakeWhileAdapter requirements.
concept  TransformFor
 Concept for transformation functions that can be applied to iterator values.
concept  UniqueTypes
 Concept that checks if all types in a pack are unique (after removing cv/ref qualifiers).
concept  ZipAdapterRequirements
 Concept to validate ZipAdapter requirements.

Typedefs

using HashType = size_t
using DefaultRandomEngine = std::mt19937_64
 Default engine type used by random utilities.
using FastRandomEngine = std::minstd_rand
 Fast but lower-quality engine type used by random utilities.
using DefaultRandomGenerator = RandomGenerator<DefaultRandomEngine>
 Convenience alias for a generator using the default-quality engine.
using FastRandomGeneratorType = RandomGenerator<FastRandomEngine>
 Convenience alias for a generator using the fast engine.

Enumerations

enum class  DynamicLibraryError : uint8_t {
  FileNotFound , LoadFailed , SymbolNotFound , InvalidHandle ,
  AlreadyLoaded , NotLoaded , PlatformError
}
 Error codes for dynamic library operations. More...
enum class  FileError : uint8_t { kCouldNotOpen , kReadError }

Functions

constexpr std::string_view DynamicLibraryErrorToString (DynamicLibraryError error) noexcept
 Gets a human-readable description for a DynamicLibraryError.
auto FromPath (const std::filesystem::path &path) -> std::expected< DynamicLibrary, DynamicLibraryError >
constexpr std::string_view FileErrorToString (FileError error) noexcept
 Converts FileError to a human-readable string.
auto ReadFileToString (std::string_view filepath) -> std::expected< std::string, FileError >
 Reads the entire contents of a file into a string.
auto ReadFileToString (const std::filesystem::path &filepath) -> std::expected< std::string, FileError >
 Reads the entire contents of a file into a string.
constexpr std::string_view GetFileName (std::string_view path)
 Extracts the file name from a given path.
static constexpr std::string_view GetFileExtension (std::string_view path)
 Extracts the file extension from a given path.
template<ExternalRange R, typename Pred>
 FilterAdapter (R &, Pred) -> FilterAdapter< std::ranges::iterator_t< R >, Pred >
template<ExternalRange R, typename Pred>
 FilterAdapter (const R &, Pred) -> FilterAdapter< std::ranges::iterator_t< const R >, Pred >
template<ExternalRange R, typename Func>
 MapAdapter (R &, Func) -> MapAdapter< std::ranges::iterator_t< R >, Func >
template<ExternalRange R, typename Func>
 MapAdapter (const R &, Func) -> MapAdapter< std::ranges::iterator_t< const R >, Func >
template<ExternalRange R>
 TakeAdapter (R &, size_t) -> TakeAdapter< std::ranges::iterator_t< R > >
template<ExternalRange R>
 TakeAdapter (const R &, size_t) -> TakeAdapter< std::ranges::iterator_t< const R > >
template<ExternalRange R>
 SkipAdapter (R &, size_t) -> SkipAdapter< std::ranges::iterator_t< R > >
template<ExternalRange R>
 SkipAdapter (const R &, size_t) -> SkipAdapter< std::ranges::iterator_t< const R > >
template<ExternalRange R, typename Pred>
 TakeWhileAdapter (R &, Pred) -> TakeWhileAdapter< std::ranges::iterator_t< R >, Pred >
template<ExternalRange R, typename Pred>
 TakeWhileAdapter (const R &, Pred) -> TakeWhileAdapter< std::ranges::iterator_t< const R >, Pred >
template<ExternalRange R, typename Pred>
 SkipWhileAdapter (R &, Pred) -> SkipWhileAdapter< std::ranges::iterator_t< R >, Pred >
template<ExternalRange R, typename Pred>
 SkipWhileAdapter (const R &, Pred) -> SkipWhileAdapter< std::ranges::iterator_t< const R >, Pred >
template<ExternalRange R>
 EnumerateAdapter (R &) -> EnumerateAdapter< std::ranges::iterator_t< R > >
template<ExternalRange R>
 EnumerateAdapter (const R &) -> EnumerateAdapter< std::ranges::iterator_t< const R > >
template<ExternalRange R, typename Func>
 InspectAdapter (R &, Func) -> InspectAdapter< std::ranges::iterator_t< R >, Func >
template<ExternalRange R, typename Func>
 InspectAdapter (const R &, Func) -> InspectAdapter< std::ranges::iterator_t< const R >, Func >
template<ExternalRange R>
 StepByAdapter (R &, size_t) -> StepByAdapter< std::ranges::iterator_t< R > >
template<ExternalRange R>
 StepByAdapter (const R &, size_t) -> StepByAdapter< std::ranges::iterator_t< const R > >
template<ExternalRange R1, ExternalRange R2>
requires ChainAdapterRequirements<std::ranges::iterator_t<R1>, std::ranges::iterator_t<R2>>
 ChainAdapter (R1 &, R2 &) -> ChainAdapter< std::ranges::iterator_t< R1 >, std::ranges::iterator_t< R2 > >
template<ExternalRange R1, ExternalRange R2>
requires ChainAdapterRequirements<std::ranges::iterator_t<const R1>, std::ranges::iterator_t<const R2>>
 ChainAdapter (const R1 &, const R2 &) -> ChainAdapter< std::ranges::iterator_t< const R1 >, std::ranges::iterator_t< const R2 > >
template<ExternalRange R>
 ReverseAdapter (R &) -> ReverseAdapter< std::ranges::iterator_t< R > >
template<ExternalRange R>
 ReverseAdapter (const R &) -> ReverseAdapter< std::ranges::iterator_t< const R > >
template<ExternalRange R>
requires SlideAdapterRequirements<std::ranges::iterator_t<R>>
 SlideAdapter (R &, size_t) -> SlideAdapter< std::ranges::iterator_t< R > >
template<ExternalRange R>
requires SlideAdapterRequirements<std::ranges::iterator_t<const R>>
 SlideAdapter (const R &, size_t) -> SlideAdapter< std::ranges::iterator_t< const R > >
template<ExternalRange R>
requires StrideAdapterRequirements<std::ranges::iterator_t<R>>
 StrideAdapter (R &, size_t) -> StrideAdapter< std::ranges::iterator_t< R > >
template<ExternalRange R>
requires StrideAdapterRequirements<std::ranges::iterator_t<const R>>
 StrideAdapter (const R &, size_t) -> StrideAdapter< std::ranges::iterator_t< const R > >
template<ExternalRange R1, ExternalRange R2>
requires ZipAdapterRequirements<std::ranges::iterator_t<R1>, std::ranges::iterator_t<R2>>
 ZipAdapter (R1 &, R2 &) -> ZipAdapter< std::ranges::iterator_t< R1 >, std::ranges::iterator_t< R2 > >
template<ExternalRange R1, ExternalRange R2>
requires ZipAdapterRequirements<std::ranges::iterator_t<const R1>, std::ranges::iterator_t<const R2>>
 ZipAdapter (const R1 &, const R2 &) -> ZipAdapter< std::ranges::iterator_t< const R1 >, std::ranges::iterator_t< const R2 > >
constexpr HashType Fnv1aHash (std::string_view str, HashType hash=kFnvBasis) noexcept
 Computes the FNV-1a hash of a string.
template<size_t N>
constexpr HashType Fnv1aHash (const char(&array)[N]) noexcept
 Computes the FNV-1a hash of a string literal.
uint64_t RandomDeviceSeed ()
 Internal helper to obtain seed from std::random_device.
DefaultRandomEngine MakeDefaultEngine ()
 Creates a default-quality random engine seeded with std::random_device.
FastRandomEngine MakeFastEngine ()
 Creates a fast linear random engine seeded with std::random_device.
DefaultRandomEngineDefaultEngine ()
 Thread-local default-quality engine.
FastRandomEngineFastEngineInstance ()
 Thread-local fast engine.
DefaultRandomGeneratorRandomDefault ()
 Provides access to a thread-local default-quality random generator.
FastRandomGeneratorTypeRandomFast ()
 Provides access to a thread-local fast random generator.
template<utils::ArithmeticTrait T>
RandomValue ()
 Convenience function to generate a default-distribution value using the default engine.
template<utils::ArithmeticTrait T, utils::ArithmeticTrait U>
auto RandomValueFromRange (T min, U max) -> std::common_type_t< T, U >
 Convenience function to generate a value in range using the default engine.
template<utils::ArithmeticTrait T>
RandomFastValue ()
 Convenience function to generate a default-distribution value using the fast engine.
template<utils::ArithmeticTrait T, utils::ArithmeticTrait U>
auto RandomFastValueFromRange (T min, U max) -> std::common_type_t< T, U >
 Convenience function to generate a value in range using the fast engine.
constexpr bool operator== (const TypeId &lhs, TypeIndex rhs) noexcept
 Compares a TypeId with a TypeIndex for equality.
constexpr std::strong_ordering operator<=> (const TypeId &lhs, TypeIndex rhs) noexcept
 Compares a TypeId with a TypeIndex for ordering.
constexpr bool operator== (TypeIndex lhs, const TypeId &rhs) noexcept
 Compares a TypeIndex with a TypeId for equality.
constexpr std::strong_ordering operator<=> (TypeIndex lhs, const TypeId &rhs) noexcept
 Compares a TypeIndex with a TypeId for ordering.
template<typename T>
constexpr std::string_view TypeNameOf () noexcept
 Retrieves the unqualified type name of T.
template<typename T>
constexpr std::string_view TypeNameOf (const T &) noexcept
 Retrieves the unqualified type name of the type of the given instance.
template<typename T>
constexpr std::string_view QualifiedTypeNameOf () noexcept
 Retrieves the fully qualified type name of T.
template<typename T>
constexpr std::string_view QualifiedTypeNameOf (const T &) noexcept
 Retrieves the fully qualified type name of the type of the given instance.

Variables

constexpr HashType kFnvBasis = 14695981039346656037ULL
constexpr HashType kFnvPrime = 1099511628211ULL

Typedef Documentation

◆ DefaultRandomEngine

using helios::utils::DefaultRandomEngine = std::mt19937_64

Default engine type used by random utilities.

Uses a 64-bit Mersenne Twister for quality pseudorandom numbers.

Definition at line 47 of file random.hpp.

◆ DefaultRandomGenerator

Convenience alias for a generator using the default-quality engine.

Uses thread-local DefaultEngine() as the underlying engine.

Definition at line 248 of file random.hpp.

◆ FastRandomEngine

using helios::utils::FastRandomEngine = std::minstd_rand

Fast but lower-quality engine type used by random utilities.

Uses a 32-bit linear congruential engine suitable for non-cryptographic, performance-critical scenarios.

Definition at line 54 of file random.hpp.

◆ FastRandomGeneratorType

Convenience alias for a generator using the fast engine.

Uses thread-local FastEngineInstance() as the underlying engine.

Definition at line 254 of file random.hpp.

◆ HashType

using helios::utils::HashType = size_t

Definition at line 8 of file hash.hpp.

Enumeration Type Documentation

◆ DynamicLibraryError

enum class helios::utils::DynamicLibraryError : uint8_t
strong

Error codes for dynamic library operations.

Enumerator
FileNotFound 

Library file not found.

LoadFailed 

Failed to load library.

SymbolNotFound 

Symbol not found in library.

InvalidHandle 

Invalid library handle.

AlreadyLoaded 

Library is already loaded.

NotLoaded 

Library is not loaded.

PlatformError 

Platform-specific error.

Definition at line 15 of file dynamic_library.hpp.

◆ FileError

enum class helios::utils::FileError : uint8_t
strong
Enumerator
kCouldNotOpen 
kReadError 

Definition at line 14 of file filesystem.hpp.

Function Documentation

◆ ChainAdapter() [1/2]

template<ExternalRange R1, ExternalRange R2>
requires ChainAdapterRequirements<std::ranges::iterator_t<const R1>, std::ranges::iterator_t<const R2>>
helios::utils::ChainAdapter ( const R1 & ,
const R2 &  ) -> ChainAdapter< std::ranges::iterator_t< const R1 >, std::ranges::iterator_t< const R2 > >

◆ ChainAdapter() [2/2]

template<ExternalRange R1, ExternalRange R2>
requires ChainAdapterRequirements<std::ranges::iterator_t<R1>, std::ranges::iterator_t<R2>>
helios::utils::ChainAdapter ( R1 & ,
R2 &  ) -> ChainAdapter< std::ranges::iterator_t< R1 >, std::ranges::iterator_t< R2 > >

◆ DefaultEngine()

DefaultRandomEngine & helios::utils::DefaultEngine ( )
inlinenodiscard

Thread-local default-quality engine.

Uses Meyer's singleton pattern per thread to avoid global static initialization order issues while providing a convenient default.

Returns
Reference to thread-local DefaultRandomEngine instance

Definition at line 109 of file random.hpp.

◆ DynamicLibraryErrorToString()

std::string_view helios::utils::DynamicLibraryErrorToString ( DynamicLibraryError error)
nodiscardconstexprnoexcept

Gets a human-readable description for a DynamicLibraryError.

Parameters
errorThe error code
Returns
String description of the error

Definition at line 30 of file dynamic_library.hpp.

◆ EnumerateAdapter() [1/2]

template<ExternalRange R>
helios::utils::EnumerateAdapter ( const R & ) -> EnumerateAdapter< std::ranges::iterator_t< const R > >

◆ EnumerateAdapter() [2/2]

template<ExternalRange R>
helios::utils::EnumerateAdapter ( R & ) -> EnumerateAdapter< std::ranges::iterator_t< R > >

◆ FastEngineInstance()

FastRandomEngine & helios::utils::FastEngineInstance ( )
inlinenodiscard

Thread-local fast engine.

Uses Meyer's singleton pattern per thread to avoid global static initialization order issues while providing a fast default.

Returns
Reference to thread-local FastRandomEngine instance

Definition at line 120 of file random.hpp.

◆ FileErrorToString()

std::string_view helios::utils::FileErrorToString ( FileError error)
nodiscardconstexprnoexcept

Converts FileError to a human-readable string.

Parameters
errorThe FileError to convert
Returns
A string view representing the error

Definition at line 21 of file filesystem.hpp.

◆ FilterAdapter() [1/2]

template<ExternalRange R, typename Pred>
helios::utils::FilterAdapter ( const R & ,
Pred  ) -> FilterAdapter< std::ranges::iterator_t< const R >, Pred >

◆ FilterAdapter() [2/2]

template<ExternalRange R, typename Pred>
helios::utils::FilterAdapter ( R & ,
Pred  ) -> FilterAdapter< std::ranges::iterator_t< R >, Pred >

◆ Fnv1aHash() [1/2]

template<size_t N>
HashType helios::utils::Fnv1aHash ( const char(&) array[N])
nodiscardconstexprnoexcept

Computes the FNV-1a hash of a string literal.

Template Parameters
NThe size of the string literal (including null terminator).
Parameters
arrayThe string literal to hash.
Returns
The computed FNV-1a hash of the input string literal.

Definition at line 41 of file hash.hpp.

◆ Fnv1aHash() [2/2]

HashType helios::utils::Fnv1aHash ( std::string_view str,
HashType hash = kFnvBasis )
nodiscardconstexprnoexcept

Computes the FNV-1a hash of a string.

Parameters
strThe input string to hash.
hashThe initial hash value (default is the FNV basis).
Returns
The computed FNV-1a hash of the input string.

Definition at line 26 of file hash.hpp.

◆ FromPath()

auto helios::utils::FromPath ( const std::filesystem::path & path) -> std::expected< DynamicLibrary, DynamicLibraryError >
inline

Definition at line 216 of file dynamic_library.hpp.

◆ GetFileExtension()

constexpr std::string_view helios::utils::GetFileExtension ( std::string_view path)
staticnodiscardconstexpr

Extracts the file extension from a given path.

Parameters
pathThe full file path
Returns
The file extension, including the dot (e.g., ".txt"), or an empty string if none exists

Definition at line 121 of file filesystem.hpp.

◆ GetFileName()

std::string_view helios::utils::GetFileName ( std::string_view path)
nodiscardconstexpr

Extracts the file name from a given path.

Parameters
pathThe full file path
Returns
The file name

Definition at line 109 of file filesystem.hpp.

◆ InspectAdapter() [1/2]

template<ExternalRange R, typename Func>
helios::utils::InspectAdapter ( const R & ,
Func  ) -> InspectAdapter< std::ranges::iterator_t< const R >, Func >

◆ InspectAdapter() [2/2]

template<ExternalRange R, typename Func>
helios::utils::InspectAdapter ( R & ,
Func  ) -> InspectAdapter< std::ranges::iterator_t< R >, Func >

◆ MakeDefaultEngine()

DefaultRandomEngine helios::utils::MakeDefaultEngine ( )
inlinenodiscard

Creates a default-quality random engine seeded with std::random_device.

Useful when the caller wants an engine instance but does not care a specific engine type beyond the default choice.

Returns
DefaultRandomEngine instance seeded with std::random_device

Definition at line 88 of file random.hpp.

◆ MakeFastEngine()

FastRandomEngine helios::utils::MakeFastEngine ( )
inlinenodiscard

Creates a fast linear random engine seeded with std::random_device.

Intended for performance-critical code where statistical quality is less important. Not suitable for cryptographic purposes.

Returns
FastRandomEngine instance seeded with std::random_device

Definition at line 98 of file random.hpp.

◆ MapAdapter() [1/2]

template<ExternalRange R, typename Func>
helios::utils::MapAdapter ( const R & ,
Func  ) -> MapAdapter< std::ranges::iterator_t< const R >, Func >

◆ MapAdapter() [2/2]

template<ExternalRange R, typename Func>
helios::utils::MapAdapter ( R & ,
Func  ) -> MapAdapter< std::ranges::iterator_t< R >, Func >

◆ operator<=>() [1/2]

std::strong_ordering helios::utils::operator<=> ( const TypeId & lhs,
TypeIndex rhs )
constexprnoexcept

Compares a TypeId with a TypeIndex for ordering.

Parameters
lhsThe TypeId to compare
rhsThe TypeIndex to compare
Returns
std::strong_ordering result of the comparison

Definition at line 435 of file type_info.hpp.

◆ operator<=>() [2/2]

std::strong_ordering helios::utils::operator<=> ( TypeIndex lhs,
const TypeId & rhs )
constexprnoexcept

Compares a TypeIndex with a TypeId for ordering.

Parameters
lhsThe TypeIndex to compare
rhsThe TypeId to compare
Returns
std::strong_ordering result of the comparison

Definition at line 457 of file type_info.hpp.

◆ operator==() [1/2]

bool helios::utils::operator== ( const TypeId & lhs,
TypeIndex rhs )
constexprnoexcept

Compares a TypeId with a TypeIndex for equality.

Parameters
lhsThe TypeId to compare
rhsThe TypeIndex to compare
Returns
true if the TypeId and TypeIndex refer to the same type, false otherwise

Definition at line 425 of file type_info.hpp.

◆ operator==() [2/2]

bool helios::utils::operator== ( TypeIndex lhs,
const TypeId & rhs )
constexprnoexcept

Compares a TypeIndex with a TypeId for equality.

Parameters
lhsThe TypeIndex to compare
rhsThe TypeId to compare
Returns
true if the TypeIndex and TypeId refer to the same type, false otherwise

Definition at line 447 of file type_info.hpp.

◆ QualifiedTypeNameOf() [1/2]

template<typename T>
std::string_view helios::utils::QualifiedTypeNameOf ( )
nodiscardconstexprnoexcept

Retrieves the fully qualified type name of T.

Template Parameters
TThe type to retrieve the name for
Returns
Fully qualified type name

Definition at line 490 of file type_info.hpp.

◆ QualifiedTypeNameOf() [2/2]

template<typename T>
std::string_view helios::utils::QualifiedTypeNameOf ( const T & )
nodiscardconstexprnoexcept

Retrieves the fully qualified type name of the type of the given instance.

Template Parameters
TThe type of the instance
Parameters
instanceThe instance to retrieve the type name for (unused)
Returns
Fully qualified type name

Definition at line 502 of file type_info.hpp.

◆ RandomDefault()

DefaultRandomGenerator & helios::utils::RandomDefault ( )
inlinenodiscard

Provides access to a thread-local default-quality random generator.

Uses Meyer's singleton pattern per thread and avoids any static engine objects other than thread-local instances that are lazily initialized on first use.

Returns
Reference to DefaultRandomGenerator bound to DefaultEngine()

Definition at line 263 of file random.hpp.

◆ RandomDeviceSeed()

uint64_t helios::utils::RandomDeviceSeed ( )
inlinenodiscard

Internal helper to obtain seed from std::random_device.

This function is intentionally small and header-only to avoid static initialization of engines in user code.

Returns
64-bit seed value from std::random_device

Definition at line 62 of file random.hpp.

◆ RandomFast()

FastRandomGeneratorType & helios::utils::RandomFast ( )
inlinenodiscard

Provides access to a thread-local fast random generator.

Uses Meyer's singleton pattern per thread and avoids any static engine objects other than thread-local instances that are lazily initialized on first use.

Returns
Reference to FastRandomGeneratorType bound to FastEngineInstance()

Definition at line 276 of file random.hpp.

◆ RandomFastValue()

template<utils::ArithmeticTrait T>
T helios::utils::RandomFastValue ( )
inlinenodiscard

Convenience function to generate a default-distribution value using the fast engine.

Equivalent to RandomFast().Value<T>(), but shorter to call.

Template Parameters
TArithmetic type to generate
Returns
Randomly generated value of type T using the fast engine

Definition at line 318 of file random.hpp.

◆ RandomFastValueFromRange()

template<utils::ArithmeticTrait T, utils::ArithmeticTrait U>
auto helios::utils::RandomFastValueFromRange ( T min,
U max ) -> std::common_type_t< T, U >
inlinenodiscard

Convenience function to generate a value in range using the fast engine.

Equivalent to RandomFast().ValueFromRange(min, max).

Template Parameters
TArithmetic type
UArithmetic type
Parameters
minLower bound of the range
maxUpper bound of the range
Returns
Random value of std::common_type_t<T, U> in [min, max] or [min, max)

Definition at line 334 of file random.hpp.

◆ RandomValue()

template<utils::ArithmeticTrait T>
T helios::utils::RandomValue ( )
inlinenodiscard

Convenience function to generate a default-distribution value using the default engine.

Equivalent to RandomDefault().Value<T>(), but shorter to call.

Template Parameters
TArithmetic type to generate
Returns
Randomly generated value of type T

Definition at line 289 of file random.hpp.

◆ RandomValueFromRange()

template<utils::ArithmeticTrait T, utils::ArithmeticTrait U>
auto helios::utils::RandomValueFromRange ( T min,
U max ) -> std::common_type_t< T, U >
inlinenodiscard

Convenience function to generate a value in range using the default engine.

Equivalent to RandomDefault().ValueFromRange(min, max).

Template Parameters
TArithmetic type
UArithmetic type
Parameters
minLower bound of the range
maxUpper bound of the range
Returns
Random value of std::common_type_t<T, U> in [min, max] or [min, max)

Definition at line 305 of file random.hpp.

◆ ReadFileToString() [1/2]

auto helios::utils::ReadFileToString ( const std::filesystem::path & filepath) -> std::expected< std::string, FileError >
inlinenodiscard

Reads the entire contents of a file into a string.

Parameters
filepathThe path to the file
Returns
An expected containing the file contents or a FileError

Definition at line 73 of file filesystem.hpp.

◆ ReadFileToString() [2/2]

auto helios::utils::ReadFileToString ( std::string_view filepath) -> std::expected< std::string, FileError >
inlinenodiscard

Reads the entire contents of a file into a string.

Parameters
filepathThe path to the file
Returns
An expected containing the file contents or a FileError

Definition at line 38 of file filesystem.hpp.

◆ ReverseAdapter() [1/2]

template<ExternalRange R>
helios::utils::ReverseAdapter ( const R & ) -> ReverseAdapter< std::ranges::iterator_t< const R > >

◆ ReverseAdapter() [2/2]

template<ExternalRange R>
helios::utils::ReverseAdapter ( R & ) -> ReverseAdapter< std::ranges::iterator_t< R > >

◆ SkipAdapter() [1/2]

template<ExternalRange R>
helios::utils::SkipAdapter ( const R & ,
size_t  ) -> SkipAdapter< std::ranges::iterator_t< const R > >

◆ SkipAdapter() [2/2]

template<ExternalRange R>
helios::utils::SkipAdapter ( R & ,
size_t  ) -> SkipAdapter< std::ranges::iterator_t< R > >

◆ SkipWhileAdapter() [1/2]

template<ExternalRange R, typename Pred>
helios::utils::SkipWhileAdapter ( const R & ,
Pred  ) -> SkipWhileAdapter< std::ranges::iterator_t< const R >, Pred >

◆ SkipWhileAdapter() [2/2]

template<ExternalRange R, typename Pred>
helios::utils::SkipWhileAdapter ( R & ,
Pred  ) -> SkipWhileAdapter< std::ranges::iterator_t< R >, Pred >

◆ SlideAdapter() [1/2]

template<ExternalRange R>
requires SlideAdapterRequirements<std::ranges::iterator_t<const R>>
helios::utils::SlideAdapter ( const R & ,
size_t  ) -> SlideAdapter< std::ranges::iterator_t< const R > >

◆ SlideAdapter() [2/2]

template<ExternalRange R>
requires SlideAdapterRequirements<std::ranges::iterator_t<R>>
helios::utils::SlideAdapter ( R & ,
size_t  ) -> SlideAdapter< std::ranges::iterator_t< R > >

◆ StepByAdapter() [1/2]

template<ExternalRange R>
helios::utils::StepByAdapter ( const R & ,
size_t  ) -> StepByAdapter< std::ranges::iterator_t< const R > >

◆ StepByAdapter() [2/2]

template<ExternalRange R>
helios::utils::StepByAdapter ( R & ,
size_t  ) -> StepByAdapter< std::ranges::iterator_t< R > >

◆ StrideAdapter() [1/2]

template<ExternalRange R>
requires StrideAdapterRequirements<std::ranges::iterator_t<const R>>
helios::utils::StrideAdapter ( const R & ,
size_t  ) -> StrideAdapter< std::ranges::iterator_t< const R > >

◆ StrideAdapter() [2/2]

template<ExternalRange R>
requires StrideAdapterRequirements<std::ranges::iterator_t<R>>
helios::utils::StrideAdapter ( R & ,
size_t  ) -> StrideAdapter< std::ranges::iterator_t< R > >

◆ TakeAdapter() [1/2]

template<ExternalRange R>
helios::utils::TakeAdapter ( const R & ,
size_t  ) -> TakeAdapter< std::ranges::iterator_t< const R > >

◆ TakeAdapter() [2/2]

template<ExternalRange R>
helios::utils::TakeAdapter ( R & ,
size_t  ) -> TakeAdapter< std::ranges::iterator_t< R > >

◆ TakeWhileAdapter() [1/2]

template<ExternalRange R, typename Pred>
helios::utils::TakeWhileAdapter ( const R & ,
Pred  ) -> TakeWhileAdapter< std::ranges::iterator_t< const R >, Pred >

◆ TakeWhileAdapter() [2/2]

template<ExternalRange R, typename Pred>
helios::utils::TakeWhileAdapter ( R & ,
Pred  ) -> TakeWhileAdapter< std::ranges::iterator_t< R >, Pred >

◆ TypeNameOf() [1/2]

template<typename T>
std::string_view helios::utils::TypeNameOf ( )
nodiscardconstexprnoexcept

Retrieves the unqualified type name of T.

Template Parameters
TThe type to retrieve the name for
Returns
Unqualified type name

Definition at line 468 of file type_info.hpp.

◆ TypeNameOf() [2/2]

template<typename T>
std::string_view helios::utils::TypeNameOf ( const T & )
nodiscardconstexprnoexcept

Retrieves the unqualified type name of the type of the given instance.

Template Parameters
TThe type of the instance
Parameters
instanceThe instance to retrieve the type name for (unused)
Returns
Unqualified type name

Definition at line 479 of file type_info.hpp.

◆ ZipAdapter() [1/2]

template<ExternalRange R1, ExternalRange R2>
requires ZipAdapterRequirements<std::ranges::iterator_t<const R1>, std::ranges::iterator_t<const R2>>
helios::utils::ZipAdapter ( const R1 & ,
const R2 &  ) -> ZipAdapter< std::ranges::iterator_t< const R1 >, std::ranges::iterator_t< const R2 > >

◆ ZipAdapter() [2/2]

template<ExternalRange R1, ExternalRange R2>
requires ZipAdapterRequirements<std::ranges::iterator_t<R1>, std::ranges::iterator_t<R2>>
helios::utils::ZipAdapter ( R1 & ,
R2 &  ) -> ZipAdapter< std::ranges::iterator_t< R1 >, std::ranges::iterator_t< R2 > >

Variable Documentation

◆ kFnvBasis

HashType helios::utils::kFnvBasis = 14695981039346656037ULL
inlineconstexpr

Definition at line 11 of file hash.hpp.

◆ kFnvPrime

HashType helios::utils::kFnvPrime = 1099511628211ULL
inlineconstexpr

Definition at line 12 of file hash.hpp.