Photon Quantum 3.0.0

Public Member Functions | Public Attributes | List of all members
Quantum.MailboxSet8 Class Reference

A utility class to optimize periodic checks by saving a iteration value for each index of the initial capacity. More...

Public Member Functions

 MailboxSet8 (int capacity, Native.Allocator allocator)
 Create a mailbox buffer with a given capacity. Allocates one byte per Capacity. More...
 
bool AlreadyChecked (int index)
 Check if a certain index has already been checked this pass. Will set the index to the current key if it was not checked yet. More...
 
void Dispose (Native.Allocator allocator)
 Dispose and free memory. More...
 
void SetCapacity (int capacity, Native.Allocator allocator)
 Set the capacity of the mailbox buffer. More...
 
bool ShouldCheck (int index)
 Check if a certain index has already not been checked this pass. Will set the index to the current key if it was not checked yet. More...
 
void StartSearch ()
 Start a new search by incrementing the key. Will reset the mailbox buffer and restart at 0 when overflowing the byte (255). More...
 

Public Attributes

int Capacity => _capacity
 The size of the mailbox buffer. More...
 

Detailed Description

A utility class to optimize periodic checks by saving a iteration value for each index of the initial capacity.

Constructor & Destructor Documentation

◆ MailboxSet8()

Quantum.MailboxSet8.MailboxSet8 ( int  capacity,
Native.Allocator  allocator 
)
inline

Create a mailbox buffer with a given capacity. Allocates one byte per Capacity.

Parameters
capacityCapacity
allocatorMemory allocator.

Member Function Documentation

◆ Dispose()

void Quantum.MailboxSet8.Dispose ( Native.Allocator  allocator)
inline

Dispose and free memory.

Parameters
allocatorAllocator

◆ SetCapacity()

void Quantum.MailboxSet8.SetCapacity ( int  capacity,
Native.Allocator  allocator 
)
inline

Set the capacity of the mailbox buffer.

Parameters
capacityNew Capacity
allocatorAllocator

◆ StartSearch()

void Quantum.MailboxSet8.StartSearch ( )
inline

Start a new search by incrementing the key. Will reset the mailbox buffer and restart at 0 when overflowing the byte (255).

◆ AlreadyChecked()

bool Quantum.MailboxSet8.AlreadyChecked ( int  index)
inline

Check if a certain index has already been checked this pass. Will set the index to the current key if it was not checked yet.

Parameters
indexIndex to check, must be Capacity
Returns
true if the index was already processed this key

◆ ShouldCheck()

bool Quantum.MailboxSet8.ShouldCheck ( int  index)
inline

Check if a certain index has already not been checked this pass. Will set the index to the current key if it was not checked yet.

Parameters
indexIndex to check, must be Capacity
Returns
true if the index was not already processed this key

Member Data Documentation

◆ Capacity

int Quantum.MailboxSet8.Capacity => _capacity

The size of the mailbox buffer.