mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-11-16 01:55:27 +00:00
35 lines
993 B
C#
35 lines
993 B
C#
|
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);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|