Search Results for

    Show / Hide Table of Contents

    Class HashSet

    Template for unordered set of values (without duplicates with O(1) lookup access).

    Inheritance
    HashSetBase
    HashSet
    Inherited Members
    HashSetBase::_allocation
    HashSetBase::_deletedCount
    HashSetBase::_elementsCount
    HashSetBase::_size
    HashSet
    HashSet
    HashSet
    HashSetBase::Capacity()
    HashSetBase::Clear()
    HashSetBase::Compact()
    HashSetBase::Count()
    HashSetBase::EnsureCapacity(int32 minCapacity, const bool preserveContents=true)
    HashSetBase::FindPosition(const KeyComparableType& key, FindPositionResult& result)
    HashSetBase::HashSetBase()
    HashSetBase::HasItems()
    HashSetBase::IsEmpty()
    HashSetBase::MoveToEmpty(HashSetBase&& other)
    HashSetBase::OnAdd(const KeyComparableType& key, bool checkUnique=true)
    HashSetBase::SetCapacity(int32 capacity, const bool preserveContents=true)
    HashSetBase::Swap(HashSetBase& other)
    HashSetBase::~HashSetBase()
    Assembly: FlaxEngine.dll
    File: Engine/Core/Collections/HashSet.h
    Syntax
    public class HashSet<T, AllocationType> : public HashSetBase
    Type Parameters
    T

    The type of elements in the set.

    AllocationType

    The type of memory allocator.

    Constructors

    ~HashSet()

    Finalizes an instance of the HashSet class.

    Declaration
    public ~HashSet()

    DEPRECATED("Use Add with separate Key and Value from iterator.") void Add(const Iterator& i)

    Add element at iterator to the collection

    Declaration
    public DEPRECATED("Use Add with separate Key and Value from iterator.") void Add(const Iterator& i)
    Parameters
    "Use Add with separate Key and Value from iterator." HashSet_DEPRECATED__Use_Add_with_separate_Key_and_Value_from_iterator___

    HashSet()

    Initializes an empty HashSet without reserving any space.

    Declaration
    public HashSet()

    HashSet(const HashSet& other)

    Initializes HashSet by copying the elements from the other collection.

    Declaration
    public HashSet(const HashSet& other)
    Parameters
    HashSet other

    Other collection to copy

    HashSet(HashSet&& other)

    Initializes a new instance of the HashSet class.

    Declaration
    public HashSet(HashSet&& other) noexcept
    Parameters
    HashSet other

    The other collection to move.

    Methods

    Add(const ItemType& item)

    Add element to the collection.

    Declaration
    public bool Add(const ItemType& item)
    Parameters
    ItemType item

    The element to add to the set.

    Returns
    bool

    True if element has been added to the collection, otherwise false if the element is already present.

    Type Parameters
    typename ItemType

    Add(T&& item)

    Add element to the collection.

    Declaration
    public bool Add(T&& item)
    Parameters
    T item

    The element to add to the set.

    Returns
    bool

    True if element has been added to the collection, otherwise false if the element is already present.

    Begin()

    Declaration
    public Iterator Begin()
    Returns
    Iterator

    begin()

    Declaration
    public Iterator begin()
    Returns
    Iterator

    ClearDelete()

    Clears the collection and delete value objects. Note: collection must contain pointers to the objects that have public destructor and be allocated using New method.

    Declaration
    public void ClearDelete()

    Clone(const HashSet& other)

    Clones other collection into this.

    Declaration
    public void Clone(const HashSet& other)
    Parameters
    HashSet other

    The other collection to clone.

    Contains(const ItemType& item)

    Determines whether a collection contains the specified element.

    Declaration
    public bool Contains(const ItemType& item) const
    Parameters
    ItemType item

    The item to locate.

    Returns
    bool

    True if value has been found in a collection, otherwise false

    Type Parameters
    typename ItemType

    End()

    Declaration
    public Iterator End()
    Returns
    Iterator

    end()

    Declaration
    public Iterator end()
    Returns
    Iterator

    Find(const ItemType& item)

    Find element with given item in the collection

    Declaration
    public Iterator Find(const ItemType& item)
    Parameters
    ItemType item

    Item to find

    Returns
    Iterator

    Iterator for the found element or End if cannot find it

    Type Parameters
    typename ItemType

    GetItems(Array<T, ArrayAllocation>& result)

    Gets the items collection to the output array (will contain unique items).

    Declaration
    public void GetItems(Array<T, ArrayAllocation>& result) const
    Parameters
    Array<T, ArrayAllocation> result

    The result.

    Type Parameters
    typename ArrayAllocation

    HashSet(const int32 capacity)

    Initializes HashSet by reserving space.

    Declaration
    public HashSet(const int32 capacity)
    Parameters
    int32 capacity

    The number of elements that can be added without a need to allocate more memory.

    Returns
    FORCE_INLINE

    operator=(const HashSet& other)

    Clones the data from the other collection.

    Declaration
    public HashSet operator=(const HashSet& other)
    Parameters
    HashSet other

    The other collection to copy.

    Returns
    HashSet

    The reference to this.

    operator=(HashSet&& other)

    Moves the data from the other collection.

    Declaration
    public HashSet operator=(HashSet&& other) noexcept
    Parameters
    HashSet other

    The other collection to move.

    Returns
    HashSet

    The reference to this.

    Remove(const ItemType& item)

    Removes the specified element from the collection.

    Declaration
    public bool Remove(const ItemType& item)
    Parameters
    ItemType item

    The element to remove.

    Returns
    bool

    True if cannot remove item from the collection because cannot find it, otherwise false.

    Type Parameters
    typename ItemType

    Remove(const Iterator& i)

    Removes an element at specified iterator position.

    Declaration
    public bool Remove(const Iterator& i)
    Parameters
    Iterator i

    The element iterator to remove.

    Returns
    bool

    True if cannot remove item from the collection because cannot find it, otherwise false.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat