using System;
namespace Ryujinx.Memory.Tracking
{
public interface IMultiRegionHandle : IDisposable
{
///
/// True if any write has occurred to the whole region since the last use of QueryModified (with no subregion specified).
///
bool Dirty { get; }
///
/// Check if any part of the region has been modified, and perform an action for each.
/// Contiguous modified regions are combined.
///
/// Action to perform for modified regions
void QueryModified(Action modifiedAction);
///
/// Check if part of the region has been modified within a given range, and perform an action for each.
/// The range is aligned to the level of granularity of the contained handles.
/// Contiguous modified regions are combined.
///
/// Start address of the range
/// Size of the range
/// Action to perform for modified regions
void QueryModified(ulong address, ulong size, Action modifiedAction);
///
/// Check if part of the region has been modified within a given range, and perform an action for each.
/// The sequence number provided is compared with each handle's saved sequence number.
/// If it is equal, then the handle's dirty flag is ignored. Otherwise, the sequence number is saved.
/// The range is aligned to the level of granularity of the contained handles.
/// Contiguous modified regions are combined.
///
/// Start address of the range
/// Size of the range
/// Action to perform for modified regions
/// Current sequence number
void QueryModified(ulong address, ulong size, Action modifiedAction, int sequenceNumber);
///
/// Signal that one of the subregions of this multi-region has been modified. This sets the overall dirty flag.
///
void SignalWrite();
}
}