Flutter Engine
The Flutter Engine
Classes | Public Types | Public Member Functions | List of all members
skia_private::THashSet< T, HashT > Class Template Reference

#include <SkTHash.h>

Public Types

using Iter = typename THashTable< T, T, Traits >::template Iter< T >
 

Public Member Functions

 THashSet ()=default
 
 THashSet (THashSet< T, HashT > &&that)=default
 
 THashSet (const THashSet< T, HashT > &that)=default
 
THashSet< T, HashT > & operator= (THashSet< T, HashT > &&that)=default
 
THashSet< T, HashT > & operator= (const THashSet< T, HashT > &that)=default
 
 THashSet (std::initializer_list< T > vals)
 
void reset ()
 
int count () const
 
bool empty () const
 
size_t approxBytesUsed () const
 
void swap (THashSet &that)
 
void swap (THashSet &&that)
 
void add (T item)
 
bool contains (const T &item) const
 
const Tfind (const T &item) const
 
void remove (const T &item)
 
template<typename Fn >
void foreach (Fn &&fn) const
 
Iter begin () const
 
Iter end () const
 

Detailed Description

template<typename T, typename HashT = SkGoodHash>
class skia_private::THashSet< T, HashT >

Definition at line 556 of file SkTHash.h.

Member Typedef Documentation

◆ Iter

template<typename T , typename HashT = SkGoodHash>
using skia_private::THashSet< T, HashT >::Iter = typename THashTable<T, T, Traits>::template Iter<T>

Definition at line 620 of file SkTHash.h.

Constructor & Destructor Documentation

◆ THashSet() [1/4]

template<typename T , typename HashT = SkGoodHash>
skia_private::THashSet< T, HashT >::THashSet ( )
default

◆ THashSet() [2/4]

template<typename T , typename HashT = SkGoodHash>
skia_private::THashSet< T, HashT >::THashSet ( THashSet< T, HashT > &&  that)
default

◆ THashSet() [3/4]

template<typename T , typename HashT = SkGoodHash>
skia_private::THashSet< T, HashT >::THashSet ( const THashSet< T, HashT > &  that)
default

◆ THashSet() [4/4]

template<typename T , typename HashT = SkGoodHash>
skia_private::THashSet< T, HashT >::THashSet ( std::initializer_list< T vals)
inline

Definition at line 568 of file SkTHash.h.

568 {
569 fTable.resize(vals.size() * 5 / 3);
570 for (const T& val : vals) {
571 fTable.set(val);
572 }
573 }
void resize(int capacity)
Definition: SkTHash.h:163
#define T
Definition: precompiler.cc:65

Member Function Documentation

◆ add()

template<typename T , typename HashT = SkGoodHash>
void skia_private::THashSet< T, HashT >::add ( T  item)
inline

Definition at line 592 of file SkTHash.h.

592{ fTable.set(std::move(item)); }

◆ approxBytesUsed()

template<typename T , typename HashT = SkGoodHash>
size_t skia_private::THashSet< T, HashT >::approxBytesUsed ( ) const
inline

Definition at line 585 of file SkTHash.h.

585{ return fTable.approxBytesUsed(); }
size_t approxBytesUsed() const
Definition: SkTHash.h:74

◆ begin()

template<typename T , typename HashT = SkGoodHash>
Iter skia_private::THashSet< T, HashT >::begin ( ) const
inline

Definition at line 622 of file SkTHash.h.

622 {
623 return Iter::MakeBegin(&fTable);
624 }

◆ contains()

template<typename T , typename HashT = SkGoodHash>
bool skia_private::THashSet< T, HashT >::contains ( const T item) const
inline

Definition at line 595 of file SkTHash.h.

595{ return SkToBool(this->find(item)); }
static constexpr bool SkToBool(const T &x)
Definition: SkTo.h:35
const T * find(const T &item) const
Definition: SkTHash.h:599

◆ count()

template<typename T , typename HashT = SkGoodHash>
int skia_private::THashSet< T, HashT >::count ( ) const
inline

Definition at line 579 of file SkTHash.h.

579{ return fTable.count(); }
int count() const
Definition: SkTHash.h:67

◆ empty()

template<typename T , typename HashT = SkGoodHash>
bool skia_private::THashSet< T, HashT >::empty ( ) const
inline

Definition at line 582 of file SkTHash.h.

582{ return fTable.count() == 0; }

◆ end()

template<typename T , typename HashT = SkGoodHash>
Iter skia_private::THashSet< T, HashT >::end ( ) const
inline

Definition at line 626 of file SkTHash.h.

626 {
627 return Iter::MakeEnd(&fTable);
628 }

◆ find()

template<typename T , typename HashT = SkGoodHash>
const T * skia_private::THashSet< T, HashT >::find ( const T item) const
inline

Definition at line 599 of file SkTHash.h.

599{ return fTable.find(item); }
T * find(const K &key) const
Definition: SkTHash.h:107

◆ foreach()

template<typename T , typename HashT = SkGoodHash>
template<typename Fn >
void skia_private::THashSet< T, HashT >::foreach ( Fn &&  fn) const
inline

Definition at line 609 of file SkTHash.h.

609 {
610 fTable.foreach(fn);
611 }
void foreach(Fn &&fn)
Definition: SkTHash.h:184

◆ operator=() [1/2]

template<typename T , typename HashT = SkGoodHash>
THashSet< T, HashT > & skia_private::THashSet< T, HashT >::operator= ( const THashSet< T, HashT > &  that)
default

◆ operator=() [2/2]

template<typename T , typename HashT = SkGoodHash>
THashSet< T, HashT > & skia_private::THashSet< T, HashT >::operator= ( THashSet< T, HashT > &&  that)
default

◆ remove()

template<typename T , typename HashT = SkGoodHash>
void skia_private::THashSet< T, HashT >::remove ( const T item)
inline

Definition at line 602 of file SkTHash.h.

602 {
603 SkASSERT(this->contains(item));
604 fTable.remove(item);
605 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
bool contains(const T &item) const
Definition: SkTHash.h:595
void remove(const K &key)
Definition: SkTHash.h:157

◆ reset()

template<typename T , typename HashT = SkGoodHash>
void skia_private::THashSet< T, HashT >::reset ( )
inline

Definition at line 576 of file SkTHash.h.

576{ fTable.reset(); }

◆ swap() [1/2]

template<typename T , typename HashT = SkGoodHash>
void skia_private::THashSet< T, HashT >::swap ( THashSet< T, HashT > &&  that)
inline

Definition at line 589 of file SkTHash.h.

589{ fTable.swap(std::move(that.fTable)); }
void swap(THashTable &that)
Definition: SkTHash.h:77

◆ swap() [2/2]

template<typename T , typename HashT = SkGoodHash>
void skia_private::THashSet< T, HashT >::swap ( THashSet< T, HashT > &  that)
inline

Definition at line 588 of file SkTHash.h.

588{ fTable.swap(that.fTable); }

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