0
0
Fork 0
This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ryujinx-final/Ryujinx.Horizon/Sdk/Sf/Cmif/ServiceObjectHolder.cs

35 lines
993 B
C#
Raw Normal View History

using Ryujinx.Horizon.Common;
using System;
namespace Ryujinx.Horizon.Sdk.Sf.Cmif
{
class ServiceObjectHolder
{
public IServiceObject ServiceObject { get; }
private readonly ServiceDispatchMeta _dispatchMeta;
public ServiceObjectHolder(ServiceObjectHolder objectHolder)
{
ServiceObject = objectHolder.ServiceObject;
_dispatchMeta = objectHolder._dispatchMeta;
}
public ServiceObjectHolder(IServiceObject serviceImpl)
{
ServiceObject = serviceImpl;
_dispatchMeta = new ServiceDispatchMeta(ServiceDispatchTable.Create(serviceImpl));
}
public ServiceObjectHolder Clone()
{
return new ServiceObjectHolder(this);
}
public Result ProcessMessage(ref ServiceDispatchContext context, ReadOnlySpan<byte> inRawData)
{
return _dispatchMeta.DispatchTable.ProcessMessage(ref context, inRawData);
}
}
}