JPL Spatial
Sound spatialization and propagation library
Loading...
Searching...
No Matches
JPL::ScratchHashSet32< T, HashFunction, Equals > Class Template Reference

#include <JPLSpatial/Containers/ScratchHashSet.h>

Public Member Functions

 ScratchHashSet32 ()=default
 
 ScratchHashSet32 (void *memory, std::size_t memoryBytes, uint32 expectedCount, const HashFunction &hash={}, const Equals &equals={})
 
void Init (void *memory, std::size_t memoryBytes, uint32 expectedCount)
 
bool Insert (const T &key)
 
bool Contains (const T &key) const
 
JPL_INLINE void Clear ()
 
JPL_INLINE uint32 size () const
 
JPL_INLINE uint32 capacity () const
 

Static Public Member Functions

static JPL_INLINE std::size_t GetRequiredMemorySize (uint32 expectedCount)
 

Detailed Description

template<class T, class HashFunction, class Equals>
requires (std::is_trivial<T>::value and std::is_copy_constructible_v<T>)
class JPL::ScratchHashSet32< T, HashFunction, Equals >

Simple utility mainly for ensuring uniqueness of ranges of elements. HasFunction must return uint32_t hash of T. Uses provided memory buffer, no allocations/deallocations internally.

Constructor & Destructor Documentation

◆ ScratchHashSet32() [1/2]

template<class T , class HashFunction , class Equals >
JPL::ScratchHashSet32< T, HashFunction, Equals >::ScratchHashSet32 ( )
default

◆ ScratchHashSet32() [2/2]

template<class T , class HashFunction , class Equals >
requires (std::is_trivial<T>::value and std::is_copy_constructible_v<T>)
JPL::ScratchHashSet32< T, HashFunction, Equals >::ScratchHashSet32 ( void memory,
std::size_t  memoryBytes,
uint32  expectedCount,
const HashFunction hash = {},
const Equals equals = {} 
)
inline

Member Function Documentation

◆ capacity()

template<class T , class HashFunction , class Equals >
JPL_INLINE uint32 JPL::ScratchHashSet32< T, HashFunction, Equals >::capacity ( ) const
inline

◆ Clear()

template<class T , class HashFunction , class Equals >
requires (std::is_trivial<T>::value and std::is_copy_constructible_v<T>)
JPL_INLINE void JPL::ScratchHashSet32< T, HashFunction, Equals >::Clear ( )

◆ Contains()

template<class T , class HashFunction , class Equals >
requires (std::is_trivial<T>::value and std::is_copy_constructible_v<T>)
bool JPL::ScratchHashSet32< T, HashFunction, Equals >::Contains ( const T &  key) const
inline

◆ GetRequiredMemorySize()

template<class T , class HashFunction , class Equals >
requires (std::is_trivial<T>::value and std::is_copy_constructible_v<T>)
JPL_INLINE std::size_t JPL::ScratchHashSet32< T, HashFunction, Equals >::GetRequiredMemorySize ( uint32  expectedCount)
static

◆ Init()

template<class T , class HashFunction , class Equals >
requires (std::is_trivial<T>::value and std::is_copy_constructible_v<T>)
void JPL::ScratchHashSet32< T, HashFunction, Equals >::Init ( void memory,
std::size_t  memoryBytes,
uint32  expectedCount 
)
inline

◆ Insert()

template<class T , class HashFunction , class Equals >
requires (std::is_trivial<T>::value and std::is_copy_constructible_v<T>)
bool JPL::ScratchHashSet32< T, HashFunction, Equals >::Insert ( const T &  key)
inline

◆ size()


The documentation for this class was generated from the following file: