Photon Quantum 3.0.0

Public Member Functions | Static Public Member Functions | Properties | List of all members
Quantum.Collections.QHashSet< T > Class Template Reference

A Quantum hashset-like collection which uses the frame heap. This collection relies on Frame and on its API for allocating, deallocating and resolving. More...

Public Member Functions

bool Add (T value)
 Adds an element into the hash set. It might expand the capacity if needed. More...
 
void Clear ()
 Removes all elements from the hash set. It does not reset the hash set QHashSet<T>.Capacity. More...
 
bool Contains (T value)
 Checks whether the hash set contains a specific value. More...
 
QHashSetIterator< T > GetEnumerator ()
 Returns an iterator that traverses through the QHashSet<T>. More...
 
bool Remove (T value)
 Removes the element from the hash set. More...
 

Static Public Member Functions

static QHashSet< T > Allocate (FrameHeap heap, int capacity)
 Allocates a QHashSet<T> in the frame heap. It must be used before trying to resolve and use the hash set. More...
 
static implicit operator QHashSetPtr< T > (QHashSet< T > hashSet)
 Operator which allocates a QHashSet<T> based on another QHashSet<T>. More...
 
static void Serialize< T > (QHashSetPtr< T > *ptr, FrameSerializer serializer, FrameSerializer.Delegate valSerializer)
 Serializes the QHashSet<T> Ptr into a FrameSerializer to write or read from a frame snapshot. More...
 

Properties

int Capacity [get]
 Gets the QHashSet<T> current capacity. The capacity automatically expands, if necessary, when adding new entries. More...
 
int Count [get]
 Gets the QHashSet<T> current entries amount. More...
 

Detailed Description

A Quantum hashset-like collection which uses the frame heap. This collection relies on Frame and on its API for allocating, deallocating and resolving.

Type Constraints
T :unmanaged 
T :IEquatable<T> 

Member Function Documentation

◆ operator QHashSetPtr< T >()

static implicit Quantum.Collections.QHashSet< T >.operator QHashSetPtr< T > ( QHashSet< T >  hashSet)
inlinestatic

Operator which allocates a QHashSet<T> based on another QHashSet<T>.

◆ Contains()

bool Quantum.Collections.QHashSet< T >.Contains ( value)
inline

Checks whether the hash set contains a specific value.

Parameters
valueThe value to locate in the hash set.

◆ Clear()

void Quantum.Collections.QHashSet< T >.Clear ( )
inline

Removes all elements from the hash set. It does not reset the hash set QHashSet<T>.Capacity.

◆ Add()

bool Quantum.Collections.QHashSet< T >.Add ( value)
inline

Adds an element into the hash set. It might expand the capacity if needed.

Parameters
valueThe value to add.
Returns
true if the element was not set in the hash set.

◆ Remove()

bool Quantum.Collections.QHashSet< T >.Remove ( value)
inline

Removes the element from the hash set.

Parameters
valueThe element to remove.
Returns
true if the element is successfully removed; otherwise, false if the element is not found in the dictionary.

◆ GetEnumerator()

QHashSetIterator<T> Quantum.Collections.QHashSet< T >.GetEnumerator ( )
inline

Returns an iterator that traverses through the QHashSet<T>.

Returns
An enumerator object for the hash set.

◆ Allocate()

static QHashSet<T> Quantum.Collections.QHashSet< T >.Allocate ( FrameHeap  heap,
int  capacity 
)
inlinestatic

Allocates a QHashSet<T> in the frame heap. It must be used before trying to resolve and use the hash set.

Returns
The allocated QHashSet<T>.

◆ Serialize< T >()

static void Quantum.Collections.QHashSet< T >.Serialize< T > ( QHashSetPtr< T > *  ptr,
FrameSerializer  serializer,
FrameSerializer.Delegate  valSerializer 
)
inlinestatic

Serializes the QHashSet<T> Ptr into a FrameSerializer to write or read from a frame snapshot.

Parameters
ptrThe QHashSet<T> Ptr.
serializerThe FrameSerializer instance into which the struct will be serialized.
valSerializerA delegate for serializing the hash set values.
Type Constraints
T :unmanaged 

Property Documentation

◆ Count

int Quantum.Collections.QHashSet< T >.Count
get

Gets the QHashSet<T> current entries amount.

◆ Capacity

int Quantum.Collections.QHashSet< T >.Capacity
get

Gets the QHashSet<T> current capacity. The capacity automatically expands, if necessary, when adding new entries.