winmr-api/Models/MemoryRegion.cs

30 lines
687 B
C#
Raw Permalink Normal View History

2025-07-02 16:06:50 +03:00
// File: Models/MemoryRegion.cs
using System.Text.Json.Serialization;
2025-07-03 15:22:40 +03:00
using WebmrAPI.Utils;
2025-07-02 16:06:50 +03:00
namespace WebmrAPI.Models
{
2025-07-03 15:22:40 +03:00
public class MemoryRegion : ConcurrentObject
2025-07-02 16:06:50 +03:00
{
private long _addr = 0;
private ulong _size = 0;
[JsonIgnore]
public long MemoryAddress
{
get => LockedGet(ref _addr);
set => LockedSet(ref _addr, value);
}
public ulong MemorySize
{
get => LockedGet(ref _size);
set => LockedSet(ref _size, value);
}
public string? BaseAddress
{
2025-07-02 18:13:00 +03:00
get => (MemoryAddress > 0) ? $"0x{MemoryAddress:X16}" : null;
2025-07-02 16:06:50 +03:00
}
}
}