winmr-api/Models/MemoryRegion.cs
2025-07-04 00:04:51 +03:00

31 lines
793 B
C#

/* This software is licensed by the MIT License, see LICENSE file */
/* Copyright © 2024-2025 Gregory Lirent */
using System.Text.Json.Serialization;
using WebmrAPI.Utils;
namespace WebmrAPI.Models
{
public class MemoryRegion : ConcurrentObject
{
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
{
get => (MemoryAddress > 0) ? $"0x{MemoryAddress:X16}" : null;
}
}
}