Click or drag to resize
Ab4d.SharpEngine logo

DynamicMemoryBlockT Class

DynamicMemoryBlock creates an array of T structs that can be accessed with the Data field. It provides GetNextFreeIndex method to get index of next free item in the Data array (this method sets the returned index as used). The FreeIndex(Int32) method frees the specified index. The class is using a very memory efficient bits from an array of ulong values to mark which elements in the Data array are used and which are free.
Inheritance Hierarchy
SystemObject
  Ab4d.SharpEngine.UtilitiesDynamicMemoryBlockT

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public class DynamicMemoryBlock<T>
where T : struct, new()

Type Parameters

T

The DynamicMemoryBlockT type exposes the following members.

Constructors
 NameDescription
Public methodDynamicMemoryBlockT Creates a new DynamicMemoryBlock with the specified capacity.
Top
Properties
 NameDescription
Public propertyCount 
Public propertyIsEmpty 
Public propertyIsFull 
Public propertyLastUsedIndex 
Public propertyMemorySize 
Public propertyName 
Public propertyPreventZeroBlockIndex When false (by default) then first block index starts with 0. If true then the first block index starts with 1 (this is used for StandardEffect where material index that is sent to shader can be negative to invert normal; because of this material index must not be zero). This property must be set before calling GetNextFreeIndex.
Top
Methods
Fields
 NameDescription
Public fieldCapacity 
Public fieldData 
Public fieldEmptyForFramesCount 
Top
See Also