libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gbl::HashSetIterator< C, K > Struct Template Reference
Inheritance diagram for gbl::HashSetIterator< C, K >:
GblHashSetIter

Public Types

using object_type = C
 
using iterator_type = HashSetIterator< C, K >
 
using const_iterator_type = HashSetIterator< std::add_const_t< C >, K >
 
using nonconst_iterator_type = HashSetIterator< std::remove_const_t< C >, K >
 
using value_type = K
 
using reference = std::conditional_t< std::is_const_v< C >, std::add_lvalue_reference_t< std::add_const_t< K > >, std::add_lvalue_reference_t< K > >
 
using const_reference = std::add_const_t< reference >
 
using pointer = std::conditional_t< std::is_const_v< C >, std::add_pointer_t< std::add_const_t< K > >, std::add_pointer_t< K > >
 
using difference_type = std::ptrdiff_t
 
using iterator_category = std::forward_iterator_tag
 

Public Member Functions

C * set (void)
 
const C * set (void) const
 
reference operator* (void)
 
const_reference operator* (void) const
 
pointer operator-> (void)
 
const pointer operator-> (void) const
 
iterator_typeoperator++ ()
 
iterator_type operator++ (int)
 
bool operator== (const iterator_type &rhs) const
 
bool operator<= (const iterator_type &rhs) const
 
bool operator< (const iterator_type &rhs) const
 
bool operator> (const iterator_type &rhs) const
 
bool operator>= (const iterator_type &rhs) const
 
bool operator!= (const iterator_type &rhs) const
 
 HashSetIterator (C *pCont=nullptr, Size bucketIdx=-1)
 
 HashSetIterator (const GblHashSetIter gblIt)
 
 HashSetIterator (const const_iterator_type &rhs)
 
 HashSetIterator (const nonconst_iterator_type &rhs)
 
const C * getContainer (void) const
 
bool valid (void) const
 
K & value (void)
 

Static Public Attributes

static constexpr bool is_const
 

Additional Inherited Members

- Data Fields inherited from GblHashSetIter
struct { 
 
   GblHashSet *   pSet 
 
   size_t   bucketIdx 
 
private_ 
 

Detailed Description

template<typename C, typename K>
struct gbl::HashSetIterator< C, K >

Definition at line 230 of file gimbal_hash_set.hpp.

Member Typedef Documentation

◆ object_type

template<typename C , typename K >
using gbl::HashSetIterator< C, K >::object_type = C

Definition at line 234 of file gimbal_hash_set.hpp.

◆ iterator_type

template<typename C , typename K >
using gbl::HashSetIterator< C, K >::iterator_type = HashSetIterator<C, K>

Definition at line 236 of file gimbal_hash_set.hpp.

◆ const_iterator_type

template<typename C , typename K >
using gbl::HashSetIterator< C, K >::const_iterator_type = HashSetIterator<std::add_const_t<C>, K>

Definition at line 237 of file gimbal_hash_set.hpp.

◆ nonconst_iterator_type

template<typename C , typename K >
using gbl::HashSetIterator< C, K >::nonconst_iterator_type = HashSetIterator<std::remove_const_t<C>, K>

Definition at line 238 of file gimbal_hash_set.hpp.

◆ value_type

template<typename C , typename K >
using gbl::HashSetIterator< C, K >::value_type = K

Definition at line 239 of file gimbal_hash_set.hpp.

◆ reference

template<typename C , typename K >
using gbl::HashSetIterator< C, K >::reference = std::conditional_t<std::is_const_v<C>, std::add_lvalue_reference_t<std::add_const_t<K> >, std::add_lvalue_reference_t<K> >

Definition at line 240 of file gimbal_hash_set.hpp.

◆ const_reference

template<typename C , typename K >
using gbl::HashSetIterator< C, K >::const_reference = std::add_const_t<reference>

Definition at line 243 of file gimbal_hash_set.hpp.

◆ pointer

template<typename C , typename K >
using gbl::HashSetIterator< C, K >::pointer = std::conditional_t<std::is_const_v<C>, std::add_pointer_t<std::add_const_t<K> >, std::add_pointer_t<K> >

Definition at line 244 of file gimbal_hash_set.hpp.

◆ difference_type

template<typename C , typename K >
using gbl::HashSetIterator< C, K >::difference_type = std::ptrdiff_t

Definition at line 247 of file gimbal_hash_set.hpp.

◆ iterator_category

template<typename C , typename K >
using gbl::HashSetIterator< C, K >::iterator_category = std::forward_iterator_tag

Definition at line 248 of file gimbal_hash_set.hpp.

Constructor & Destructor Documentation

◆ HashSetIterator() [1/4]

template<typename C , typename K >
gbl::HashSetIterator< C, K >::HashSetIterator ( C pCont = nullptr,
Size  bucketIdx = -1 
)
inline

Definition at line 289 of file gimbal_hash_set.hpp.

289 :
290 GblHashSetIter({pCont, bucketIdx}) {}
Iterator structure used for iterating over GblHashSet.

◆ HashSetIterator() [2/4]

template<typename C , typename K >
gbl::HashSetIterator< C, K >::HashSetIterator ( const GblHashSetIter  gblIt)
inline

Definition at line 292 of file gimbal_hash_set.hpp.

292 :
293 HashSetIterator(static_cast<C*>(gblIt.pSet), gblIt.bucketIdx) {}

◆ HashSetIterator() [3/4]

template<typename C , typename K >
gbl::HashSetIterator< C, K >::HashSetIterator ( const const_iterator_type rhs)
inline

Definition at line 295 of file gimbal_hash_set.hpp.

295 :
296 HashSetIterator(rhs.pSet, rhs.bucketIdx) {}

◆ HashSetIterator() [4/4]

template<typename C , typename K >
gbl::HashSetIterator< C, K >::HashSetIterator ( const nonconst_iterator_type rhs)
inline

Definition at line 298 of file gimbal_hash_set.hpp.

298 :
299 HashSetIterator(rhs.pSet, rhs.bucketIdx) {}

Member Function Documentation

◆ set() [1/2]

template<typename C , typename K >
C * gbl::HashSetIterator< C, K >::set ( void  )
inline

Definition at line 250 of file gimbal_hash_set.hpp.

250{ return static_cast<C*>(this->pSet); }

◆ set() [2/2]

template<typename C , typename K >
const C * gbl::HashSetIterator< C, K >::set ( void  ) const
inline

Definition at line 251 of file gimbal_hash_set.hpp.

251{ return static_cast<const C*>(this->pSet); }

◆ operator*() [1/2]

template<typename C , typename K >
reference gbl::HashSetIterator< C, K >::operator* ( void  )
inline

Definition at line 253 of file gimbal_hash_set.hpp.

253 {
254 return *reinterpret_cast<pointer>(set()->probe(this->bucketIdx));
255 }

◆ operator*() [2/2]

template<typename C , typename K >
const_reference gbl::HashSetIterator< C, K >::operator* ( void  ) const
inline

Definition at line 257 of file gimbal_hash_set.hpp.

257 {
258 return *reinterpret_cast<const pointer>(set()->probe(this->bucketIdx));
259 }

◆ operator->() [1/2]

template<typename C , typename K >
pointer gbl::HashSetIterator< C, K >::operator-> ( void  )
inline

Definition at line 261 of file gimbal_hash_set.hpp.

261 {
262 return reinterpret_cast<pointer>(set()->probe(this->bucketIdx));
263 }

◆ operator->() [2/2]

template<typename C , typename K >
const pointer gbl::HashSetIterator< C, K >::operator-> ( void  ) const
inline

Definition at line 265 of file gimbal_hash_set.hpp.

265 {
266 return reinterpret_cast<const pointer>(set()->probe(this->bucketIdx));
267 }

◆ operator++() [1/2]

template<typename C , typename K >
iterator_type & gbl::HashSetIterator< C, K >::operator++ ( )
inline

Definition at line 269 of file gimbal_hash_set.hpp.

269 {
270 auto nextIt = set()->next(this);
271 this->bucketIdx = nextIt.bucketIdx;
272 return *this;
273 }

◆ operator++() [2/2]

template<typename C , typename K >
iterator_type gbl::HashSetIterator< C, K >::operator++ ( int  )
inline

Definition at line 275 of file gimbal_hash_set.hpp.

275 {
276 const auto temp(*this);
277 ++*this;
278 return temp;
279 }

◆ operator==()

template<typename C , typename K >
bool gbl::HashSetIterator< C, K >::operator== ( const iterator_type rhs) const
inline

Definition at line 281 of file gimbal_hash_set.hpp.

281{ return this->pSet == rhs.pSet && this->bucketIdx == rhs.bucketIdx; }

◆ operator<=()

template<typename C , typename K >
bool gbl::HashSetIterator< C, K >::operator<= ( const iterator_type rhs) const
inline

Definition at line 282 of file gimbal_hash_set.hpp.

282{ return this->pSet == rhs.pSet && this->bucketIdx <= rhs.bucketIdx; }

◆ operator<()

template<typename C , typename K >
bool gbl::HashSetIterator< C, K >::operator< ( const iterator_type rhs) const
inline

Definition at line 283 of file gimbal_hash_set.hpp.

283{ return this->pSet == rhs.pSet && this->bucketIdx < rhs.bucketIdx; }

◆ operator>()

template<typename C , typename K >
bool gbl::HashSetIterator< C, K >::operator> ( const iterator_type rhs) const
inline

Definition at line 284 of file gimbal_hash_set.hpp.

284{ return this->pSet == rhs.pSet && this->bucketIdx > rhs.bucketIdx; }

◆ operator>=()

template<typename C , typename K >
bool gbl::HashSetIterator< C, K >::operator>= ( const iterator_type rhs) const
inline

Definition at line 285 of file gimbal_hash_set.hpp.

285{ return this->pSet == rhs.pSet && this->bucketIdx >= rhs.bucketIdx; }

◆ operator!=()

template<typename C , typename K >
bool gbl::HashSetIterator< C, K >::operator!= ( const iterator_type rhs) const
inline

Definition at line 286 of file gimbal_hash_set.hpp.

286{ return !(*this == rhs); }

◆ getContainer()

template<typename C , typename K >
const C * gbl::HashSetIterator< C, K >::getContainer ( void  ) const
inline

Definition at line 301 of file gimbal_hash_set.hpp.

301{ return reinterpret_cast<C*>(GblHashSetIter_container(this)); }

◆ valid()

template<typename C , typename K >
bool gbl::HashSetIterator< C, K >::valid ( void  ) const
inline

Definition at line 302 of file gimbal_hash_set.hpp.

302{ return GblHashSetIter_valid(this); }

◆ value()

template<typename C , typename K >
K & gbl::HashSetIterator< C, K >::value ( void  )
inline

Definition at line 303 of file gimbal_hash_set.hpp.

303{ return *reinterpret_cast<K*>(GblHashSetIter_value(this)); }

Field Documentation

◆ is_const

template<typename C , typename K >
constexpr bool gbl::HashSetIterator< C, K >::is_const
staticconstexpr

Definition at line 235 of file gimbal_hash_set.hpp.


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