Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Protected Member Functions | List of all members
dart::HashSet< BaseIterTable, StorageTraits > Class Template Reference

#include <hash_table.h>

Inheritance diagram for dart::HashSet< BaseIterTable, StorageTraits >:

Public Types

typedef StorageTraits::ArrayPtr ArrayPtr
 
typedef StorageTraits::ArrayHandle ArrayHandle
 

Public Member Functions

 HashSet (ArrayPtr data)
 
 HashSet (Zone *zone, ArrayPtr data)
 
 HashSet (Object *key, Smi *value, ArrayHandle *data)
 
bool Insert (const Object &key)
 
ObjectPtr InsertOrGet (const Object &key) const
 
template<typename Key >
ObjectPtr InsertNewOrGet (const Key &key) const
 
template<typename Key >
ObjectPtr GetOrNull (const Key &key, bool *present=nullptr) const
 
template<typename Key >
bool Remove (const Key &key) const
 
void Clear () const
 

Protected Member Functions

void EnsureCapacity () const
 

Detailed Description

template<typename BaseIterTable, typename StorageTraits>
class dart::HashSet< BaseIterTable, StorageTraits >

Definition at line 792 of file hash_table.h.

Member Typedef Documentation

◆ ArrayHandle

template<typename BaseIterTable , typename StorageTraits >
typedef StorageTraits::ArrayHandle dart::HashSet< BaseIterTable, StorageTraits >::ArrayHandle

Definition at line 795 of file hash_table.h.

◆ ArrayPtr

template<typename BaseIterTable , typename StorageTraits >
typedef StorageTraits::ArrayPtr dart::HashSet< BaseIterTable, StorageTraits >::ArrayPtr

Definition at line 794 of file hash_table.h.

Constructor & Destructor Documentation

◆ HashSet() [1/3]

template<typename BaseIterTable , typename StorageTraits >
dart::HashSet< BaseIterTable, StorageTraits >::HashSet ( ArrayPtr  data)
inlineexplicit

Definition at line 796 of file hash_table.h.

797 : BaseIterTable(Thread::Current()->zone(), data) {}
static Thread * Current()
Definition: thread.h:362
static int8_t data[kExtLength]

◆ HashSet() [2/3]

template<typename BaseIterTable , typename StorageTraits >
dart::HashSet< BaseIterTable, StorageTraits >::HashSet ( Zone zone,
ArrayPtr  data 
)
inline

Definition at line 798 of file hash_table.h.

798: BaseIterTable(zone, data) {}

◆ HashSet() [3/3]

template<typename BaseIterTable , typename StorageTraits >
dart::HashSet< BaseIterTable, StorageTraits >::HashSet ( Object key,
Smi value,
ArrayHandle data 
)
inline

Definition at line 799 of file hash_table.h.

800 : BaseIterTable(key, value, data) {}
uint8_t value

Member Function Documentation

◆ Clear()

template<typename BaseIterTable , typename StorageTraits >
void dart::HashSet< BaseIterTable, StorageTraits >::Clear ( ) const
inline

Definition at line 859 of file hash_table.h.

void Initialize(zx::channel directory_request, std::optional< zx::eventpair > view_ref)
Initializes Dart bindings for the Fuchsia application model.
Definition: fuchsia.cc:103

◆ EnsureCapacity()

template<typename BaseIterTable , typename StorageTraits >
void dart::HashSet< BaseIterTable, StorageTraits >::EnsureCapacity ( ) const
inlineprotected

Definition at line 862 of file hash_table.h.

862 {
864 }
static constexpr double kMaxLoadFactor
Definition: hash_table.h:617
static void EnsureLoadFactor(double high, const Table &table)
Definition: hash_table.h:620

◆ GetOrNull()

template<typename BaseIterTable , typename StorageTraits >
template<typename Key >
ObjectPtr dart::HashSet< BaseIterTable, StorageTraits >::GetOrNull ( const Key key,
bool *  present = nullptr 
) const
inline

Definition at line 840 of file hash_table.h.

840 {
841 intptr_t entry = BaseIterTable::FindKey(key);
842 if (present != nullptr) {
843 *present = (entry != -1);
844 }
845 return (entry == -1) ? Object::null() : BaseIterTable::GetKey(entry);
846 }
static ObjectPtr null()
Definition: object.h:433

◆ Insert()

template<typename BaseIterTable , typename StorageTraits >
bool dart::HashSet< BaseIterTable, StorageTraits >::Insert ( const Object key)
inline

Definition at line 801 of file hash_table.h.

801 {
803 intptr_t entry = -1;
804 bool present = BaseIterTable::FindKeyOrDeletedOrUnused(key, &entry);
805 if (!present) {
806 BaseIterTable::InsertKey(entry, key);
807 }
808 return present;
809 }
void EnsureCapacity() const
Definition: hash_table.h:862

◆ InsertNewOrGet()

template<typename BaseIterTable , typename StorageTraits >
template<typename Key >
ObjectPtr dart::HashSet< BaseIterTable, StorageTraits >::InsertNewOrGet ( const Key key) const
inline

Definition at line 826 of file hash_table.h.

826 {
828 intptr_t entry = -1;
829 if (!BaseIterTable::FindKeyOrDeletedOrUnused(key, &entry)) {
830 BaseIterTable::KeyHandle() =
831 BaseIterTable::BaseTable::Traits::NewKey(key);
832 BaseIterTable::InsertKey(entry, BaseIterTable::KeyHandle());
833 return BaseIterTable::KeyHandle().ptr();
834 } else {
835 return BaseIterTable::GetKey(entry);
836 }
837 }

◆ InsertOrGet()

template<typename BaseIterTable , typename StorageTraits >
ObjectPtr dart::HashSet< BaseIterTable, StorageTraits >::InsertOrGet ( const Object key) const
inline

Definition at line 813 of file hash_table.h.

813 {
815 intptr_t entry = -1;
816 if (!BaseIterTable::FindKeyOrDeletedOrUnused(key, &entry)) {
817 BaseIterTable::InsertKey(entry, key);
818 return key.ptr();
819 } else {
820 return BaseIterTable::GetKey(entry);
821 }
822 }

◆ Remove()

template<typename BaseIterTable , typename StorageTraits >
template<typename Key >
bool dart::HashSet< BaseIterTable, StorageTraits >::Remove ( const Key key) const
inline

Definition at line 849 of file hash_table.h.

849 {
850 intptr_t entry = BaseIterTable::FindKey(key);
851 if (entry == -1) {
852 return false;
853 } else {
854 BaseIterTable::DeleteEntry(entry);
855 return true;
856 }
857 }

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