Class ManagedMemoryBlock
ManagedMemoryBlock class. Used to read and write a managed memory block.
Inheritance
Namespace: Cosmos.Core
Assembly: Cosmos.Core.dll
Syntax
public class ManagedMemoryBlock : object
Constructors
| Improve this Doc View SourceManagedMemoryBlock(UInt32)
Create a new buffer with the given size, not aligned
Declaration
public ManagedMemoryBlock(UInt32 size)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | size | Size of buffer |
ManagedMemoryBlock(UInt32, Int32)
Create a new buffer with the given size, aligned on the byte boundary specified
Declaration
public ManagedMemoryBlock(UInt32 size, int alignment)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | size | Size of buffer |
System.Int32 | alignment | Byte Boundary alignment |
ManagedMemoryBlock(UInt32, Int32, Boolean)
Create a new buffer with the given size, and aligned on the byte boundary if align is true
Declaration
public ManagedMemoryBlock(UInt32 size, int alignment, bool align)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | size | Size of buffer |
System.Int32 | alignment | Byte Boundary alignment |
System.Boolean | align | true if buffer should be aligned, false otherwise |
Fields
| Improve this Doc View SourceOffset
Offset.
Declaration
public UInt32 Offset
Field Value
Type | Description |
---|---|
UInt32 |
Size
Size.
Declaration
public UInt32 Size
Field Value
Type | Description |
---|---|
UInt32 |
Properties
| Improve this Doc View SourceItem[UInt32]
Get or set the byte at the given offset
Declaration
public byte this[uint offset] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | offset | Address Offset |
Property Value
Type | Description |
---|---|
System.Byte | Byte value at given offset |
Methods
| Improve this Doc View SourceCopy(MemoryBlock)
Copy MemoryBlock into ManagedMemoryBlock
Declaration
public void Copy(MemoryBlock block)
Parameters
Type | Name | Description |
---|---|---|
MemoryBlock | block | MemoryBlock to copy. |
Copy(Int32, Int32[], Int32, Int32)
Declaration
public void Copy(int aStart, int[] aData, int aIndex, int aCount)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | aStart | |
System.Int32[] | aData | |
System.Int32 | aIndex | |
System.Int32 | aCount |
Fill(Int32, Int32, Int32)
Fill data to memory block.
Declaration
public void Fill(int aStart, int aCount, int aData)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | aStart | A starting position in the memory block. |
System.Int32 | aCount | Data size. |
System.Int32 | aData | A data to fill memory block with. |
Fill(UInt32)
Fill memory block.
Declaration
public void Fill(uint aData)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | aData | A data to fill. |
Fill(UInt32, UInt32, UInt32)
Fill memory block.
Declaration
public void Fill(uint aStart, uint aCount, uint aData)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | aStart | A start. |
System.UInt32 | aCount | A count. |
System.UInt32 | aData | A data. |
Read16(UInt32)
Read 16-bit from the memory block.
Declaration
public UInt16 Read16(uint offset)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | offset | Data offset. |
Returns
Type | Description |
---|---|
UInt16 | UInt16 value. |
Read32(UInt32)
Read 32-bit from the memory block.
Declaration
public UInt32 Read32(uint offset)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | offset | Data offset. |
Returns
Type | Description |
---|---|
UInt32 | UInt32 value. |
Write16(UInt32, UInt16)
Write 16-bit to the memory block.
Declaration
public void Write16(uint offset, UInt16 value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | offset | Data offset. |
UInt16 | value | Value to write. |
Write32(UInt32, UInt32)
Write 32-bit to the memory block.
Declaration
public void Write32(uint offset, UInt32 value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | offset | Data offset. |
UInt32 | value | Value to write. |