libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gbl::HashSetBase< CRTP, K > Class Template Reference
Inheritance diagram for gbl::HashSetBase< CRTP, K >:
gbl::tags::HashSet gbl::HashSet< std::pair< const K, T >, impl::HashMapHasherAdapter< K, T, std::hash< K > >, impl::HashMapEqualToAdapter< K, T, std::equal_to< K > > >

Public Types

using HashSetBaseType = HashSetBase< CRTP, K >
 
using DerivedType = CRTP
 
using KeyType = K
 
using key_type = KeyType
 
using value_type = KeyType
 
using reference = value_type &
 
using const_reference = const value_type &
 
using pointer = value_type *
 
using const_pointer = const value_type *
 
using const_iterator = HashSetIterator< std::add_const_t< HashSetBase< CRTP, K > >, K >
 
using allocator_type = Context *
 
using size_type = Size
 
using difference_type = ptrdiff_t
 

Public Member Functions

 operator const GblHashSet * () const
 
decltype(autogetSet (void) const
 
decltype(autogetSet (void)
 
size_type size (void) const noexcept
 
size_type bucket_count (void) const noexcept
 
size_type bucket_size (void) const noexcept
 
bool empty (void) const noexcept
 
GblContextcontext (void) const noexcept
 
const_pointer get (const key_type &key) const noexcept
 
const_reference at (const key_type &key) const
 
size_type count (const key_type &key) const noexcept
 
bool contains (const key_type &key) const noexcept
 
const_pointer probe (size_type position) const noexcept
 
const_iterator find (const key_type &key) const noexcept
 
template<typename F >
requires std::is_invocable_r_v<bool, F, const K&>
bool for_each (F &&fn) const noexcept
 
const_iterator next (const_iterator *pPrev) const
 
const_iterator cbegin (void) const
 
auto begin (void) const
 
const_iterator cend (void) const
 
auto end (void) const
 

Detailed Description

template<typename CRTP, typename K = void*>
class gbl::HashSetBase< CRTP, K >

Definition at line 36 of file gimbal_hash_set.hpp.

Member Typedef Documentation

◆ HashSetBaseType

template<typename CRTP , typename K = void*>
using gbl::HashSetBase< CRTP, K >::HashSetBaseType = HashSetBase<CRTP, K>

Definition at line 40 of file gimbal_hash_set.hpp.

◆ DerivedType

template<typename CRTP , typename K = void*>
using gbl::HashSetBase< CRTP, K >::DerivedType = CRTP

Definition at line 41 of file gimbal_hash_set.hpp.

◆ KeyType

template<typename CRTP , typename K = void*>
using gbl::HashSetBase< CRTP, K >::KeyType = K

Definition at line 42 of file gimbal_hash_set.hpp.

◆ key_type

template<typename CRTP , typename K = void*>
using gbl::HashSetBase< CRTP, K >::key_type = KeyType

Definition at line 43 of file gimbal_hash_set.hpp.

◆ value_type

template<typename CRTP , typename K = void*>
using gbl::HashSetBase< CRTP, K >::value_type = KeyType

Definition at line 44 of file gimbal_hash_set.hpp.

◆ reference

template<typename CRTP , typename K = void*>
using gbl::HashSetBase< CRTP, K >::reference = value_type&

Definition at line 45 of file gimbal_hash_set.hpp.

◆ const_reference

template<typename CRTP , typename K = void*>
using gbl::HashSetBase< CRTP, K >::const_reference = const value_type&

Definition at line 46 of file gimbal_hash_set.hpp.

◆ pointer

template<typename CRTP , typename K = void*>
using gbl::HashSetBase< CRTP, K >::pointer = value_type*

Definition at line 47 of file gimbal_hash_set.hpp.

◆ const_pointer

template<typename CRTP , typename K = void*>
using gbl::HashSetBase< CRTP, K >::const_pointer = const value_type*

Definition at line 48 of file gimbal_hash_set.hpp.

◆ const_iterator

template<typename CRTP , typename K = void*>
using gbl::HashSetBase< CRTP, K >::const_iterator = HashSetIterator<std::add_const_t<HashSetBase<CRTP, K> >, K>

Definition at line 49 of file gimbal_hash_set.hpp.

◆ allocator_type

template<typename CRTP , typename K = void*>
using gbl::HashSetBase< CRTP, K >::allocator_type = Context*

Definition at line 50 of file gimbal_hash_set.hpp.

◆ size_type

template<typename CRTP , typename K = void*>
using gbl::HashSetBase< CRTP, K >::size_type = Size

Definition at line 51 of file gimbal_hash_set.hpp.

◆ difference_type

template<typename CRTP , typename K = void*>
using gbl::HashSetBase< CRTP, K >::difference_type = ptrdiff_t

Definition at line 52 of file gimbal_hash_set.hpp.

Member Function Documentation

◆ operator const GblHashSet *()

template<typename CRTP , typename K >
gbl::HashSetBase< CRTP, K >::operator const GblHashSet * ( ) const
inline

Definition at line 335 of file gimbal_hash_set.hpp.

335{ return getSet(); }

◆ getSet() [1/2]

template<typename CRTP , typename K >
decltype(auto) gbl::HashSetBase< CRTP, K >::getSet ( void  ) const
inline

Definition at line 314 of file gimbal_hash_set.hpp.

314{ return static_cast<const CRTP*>(this)->set_(); }

◆ getSet() [2/2]

template<typename CRTP , typename K >
decltype(auto) gbl::HashSetBase< CRTP, K >::getSet ( void  )
inline

Definition at line 317 of file gimbal_hash_set.hpp.

317{ return static_cast<CRTP*>(this)->set_(); }

◆ size()

template<typename CRTP , typename K >
auto gbl::HashSetBase< CRTP, K >::size ( void  ) const
inlinenoexcept

Definition at line 320 of file gimbal_hash_set.hpp.

320{ return GblHashSet_size(getSet()); }

◆ bucket_count()

template<typename CRTP , typename K >
auto gbl::HashSetBase< CRTP, K >::bucket_count ( void  ) const
inlinenoexcept

Definition at line 323 of file gimbal_hash_set.hpp.

323{ return GblHashSet_bucketCount(getSet()); }

◆ bucket_size()

template<typename CRTP , typename K >
auto gbl::HashSetBase< CRTP, K >::bucket_size ( void  ) const
inlinenoexcept

Definition at line 326 of file gimbal_hash_set.hpp.

326{ return GblHashSet_bucketSize(getSet()); }

◆ empty()

template<typename CRTP , typename K >
bool gbl::HashSetBase< CRTP, K >::empty ( void  ) const
inlinenoexcept

Definition at line 329 of file gimbal_hash_set.hpp.

329{ return GblHashSet_empty(getSet()); }

◆ context()

template<typename CRTP , typename K >
GblContext * gbl::HashSetBase< CRTP, K >::context ( void  ) const
inlinenoexcept

Definition at line 332 of file gimbal_hash_set.hpp.

332{ return GblHashSet_context(getSet()); }

◆ get()

template<typename CRTP , typename K >
auto gbl::HashSetBase< CRTP, K >::get ( const key_type &  key) const
inlinenoexcept

Definition at line 338 of file gimbal_hash_set.hpp.

338 {
339 return static_cast<const_pointer>(GblHashSet_get(getSet(), &key));
340}

◆ at()

template<typename CRTP , typename K >
auto gbl::HashSetBase< CRTP, K >::at ( const key_type &  key) const
inline

Definition at line 343 of file gimbal_hash_set.hpp.

343 {
344 const GblCallRecord* pRecord = nullptr;
345 const key_type* pKey = nullptr;
346 GblThread_callRecordSet(NULL, NULL);
347 pKey = reinterpret_cast<const key_type*>(GblHashSet_at(getSet(), &key));
348 pRecord = GblThread_callRecord(NULL);
349 Exception::checkThrow(*pRecord);
350 return *pKey;
351}
Captures a result, its stringified message, and a source context.

◆ count()

template<typename CRTP , typename K >
auto gbl::HashSetBase< CRTP, K >::count ( const key_type &  key) const
inlinenoexcept

Definition at line 354 of file gimbal_hash_set.hpp.

354 {
355 return GblHashSet_count(getSet(), &key);
356}

◆ contains()

template<typename CRTP , typename K >
bool gbl::HashSetBase< CRTP, K >::contains ( const key_type &  key) const
inlinenoexcept

Definition at line 359 of file gimbal_hash_set.hpp.

359 {
360 return GblHashSet_contains(getSet(), &key);
361}

◆ probe()

template<typename CRTP , typename K >
auto gbl::HashSetBase< CRTP, K >::probe ( size_type  position) const
inlinenoexcept

Definition at line 369 of file gimbal_hash_set.hpp.

369 {
370 return GblHashSet_probe(getSet(), position);
371}

◆ find()

template<typename CRTP , typename K >
auto gbl::HashSetBase< CRTP, K >::find ( const key_type &  key) const
inlinenoexcept

Definition at line 364 of file gimbal_hash_set.hpp.

364 {
365 return GblHashSet_find(getSet(), &key);
366}

◆ for_each()

template<typename CRTP , typename K >
requires std::is_invocable_r_v<bool, F, const K&>
template<typename F >
requires std::is_invocable_r_v<bool, F, const K&>
bool gbl::HashSetBase< CRTP, K >::for_each ( F &&  fn) const
inlinenoexcept

Definition at line 376 of file gimbal_hash_set.hpp.

376 {
377 return GblHashSet_foreach(getSet(), [](const GblHashSet* pSelf,
378 void* pKey,
379 void* pUd) -> Bool
380 {
381 GBL_UNUSED(pSelf);
382 auto* pFn = static_cast<F*>(pUd);
383 return (*pFn)(*static_cast<const_pointer>(pKey));
384 },
385 &fn);
386}
Hash-table based abstract associative container with C++-style STL std::unoredered_set API.

◆ next()

template<typename CRTP , typename K >
auto gbl::HashSetBase< CRTP, K >::next ( const_iterator pPrev) const
inline

Definition at line 389 of file gimbal_hash_set.hpp.

389 {
390 return GblHashSet_next(getSet(), pPrev);
391}

◆ cbegin()

template<typename CRTP , typename K >
auto gbl::HashSetBase< CRTP, K >::cbegin ( void  ) const
inline

Definition at line 394 of file gimbal_hash_set.hpp.

394 {
395 return GblHashSet_next(getSet(), nullptr);
396}

◆ begin()

template<typename CRTP , typename K >
auto gbl::HashSetBase< CRTP, K >::begin ( void  ) const
inline

Definition at line 399 of file gimbal_hash_set.hpp.

399{ return cbegin(); }

◆ cend()

template<typename CRTP , typename K >
auto gbl::HashSetBase< CRTP, K >::cend ( void  ) const
inline

Definition at line 402 of file gimbal_hash_set.hpp.

402{ return const_iterator(this, bucket_count()); }

◆ end()

template<typename CRTP , typename K >
auto gbl::HashSetBase< CRTP, K >::end ( void  ) const
inline

Definition at line 405 of file gimbal_hash_set.hpp.

405{ return cend(); }

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